text:
package com.heaven7.java.data.io.music.provider;

import com.google.gson.Gson;
import com.heaven7.java.base.util.ResourceLoader;
import com.heaven7.java.data.io.bean.CutConfigBean;

/**
 * @author heaven7
 */
public class MusicCutProviderV1 implements MusicCutProvider{

    private final CutConfigBean mBean;

    public MusicCutProviderV1(String cutConfigFile) {
        String json = ResourceLoader.getDefault().loadFileAsString(null, cutConfigFile);
        mBean = new Gson().fromJson(json, CutConfigBean.class);
    }

    @Override
    public String getCuts(String rowName) {
        CutConfigBean.CutItem cutItem = mBean.getCutItem(rowName);
        if(cutItem == null){
            return null;
        }
        return cutItem.getCuts();
    }
}


text:
<?php

class Drug_Model extends CI_Model {

    function __construct(){
         parent::__construct();
    }

    public function updateStatus($pres_id){

        $sql = "UPDATE opd_prescription SET prescription_status = '1' WHERE prescription_id =".$pres_id;
        $this->db->query($sql);
        return 'hello';

    }

    public function updateAsTbl($DSrNo, $userid, $NewQty){
        //drugQty - qty
        $data = array (
            'requestedUserID' => $userid,
            'drugQty' => $NewQty
        );

        $this->db->where('drug_srno', $DSrNo);
        $this->db->update('', $data);
    }

    public function getQty($DSrNo){
        $this->db->select('drugQty');
        $this->db->where('drug_srno', $DSrNo);
        $result = $this->db->get('pharm_asst_stock');
        return $result->row();

    }

    public function insertAsTbl($data){
        //return $this->db->insert('pharm_asst_stock',$data);
        $this->db->insert('pharm_asst_stock',$data);
    }

    public function getDrugName($id){
        $this->db->select('drug_name');
        $this->db->where('drug_srno', $id);
        $query = $this->db->get('pharm_drug');
        return $query->row();
    }

    public function getPhamDrugQty($id){
        $this->db->select('drug_quantity');
        $this->db->where('drug_srno', $id);
        $query = $this->db->get('pharm_drug');
        return $query->row();
    }

    public function updatePham($id, $qty){
          $data = array (
            'drug_qantity' => $qty
        );

        $this->db->where('drug_srno', $id);
        $this->db->update('pharm_drug', $data);
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
/* #################################################################################### */
/* Option Tree theme options file
 *
 * @author		Dennis Osterkamp aka "doitmax"
 * @copyright	Copyright (c) Dennis Osterkamp
 * @link		  http://www.doitmax.de
 *
 * @filedesc 	This file creates the teme options for the
 				      Option Tree plugin.
 *
/* #################################################################################### */

global $ot_sidebars;

/*-----------------------------------------------------------------------------------*/
/*  THE THEME OPTIONS
/*-----------------------------------------------------------------------------------*/
/**
 * Initialize the options before anything else.
 */
add_action( 'admin_init', 'custom_theme_options', 1 );

function custom_theme_options() {

  /**
   * Get a copy of the saved settings array.
   */
  $saved_settings = get_option( 'option_tree_settings', array() );
  $saved_options = get_option( 'option_tree' );

  // update option_tree options wiht social icon array
  update_option( 'option_tree', $saved_options );

  /**
   * Create your own custom array that will be passes to the
   * OptionTree Settings API Class.
   */
  $custom_settings = array(

	'sections' => array(

		// Fonts Tab
		array(
			'id'          => 'fonts',
			'title'       => __('Typography', MAX_SHORTNAME),
		),

		// Fonts Tab
		array(
			'id'          => 'expert',
			'title'       => __('Expert', MAX_SHORTNAME),
		)

	),

  'settings'        => array(

  	/* "Fonts" tab
   	================================================== */

  		array( // Google Font API
  			'id'          => 'google-font-api',
  			'label'       => __('Google Font API Key', MAX_SHORTNAME),
  			'desc'        => __('Enter your Google Font API Key to ensure updates of the google font library.', MAX_SHORTNAME),
  			'std'         => '',
  			'type'        => 'text',
  			'section'     => 'fonts',
  			'class'       => ''
  		),

  		array( // Body Font
  			'id'          => 'font-body',
  			'label'       => __('Body font-style', MAX_SHORTNAME),
  			'desc'        => __('Your main body font-style. If you don\'t want to use this font-style anymore, reset the styles to the default values. The styles from the main style.css file are used then.', MAX_SHORTNAME),
  			'std'         => '',
  			'type'        => 'typography',
  			'section'     => 'fonts',
  			'class'       => ''
  		),

  	/* "Expert" tab
   	================================================== */

  		array( // Custom CSS Code
  			'id'          => 'dynamic-css',
  			'label'       => 'Dynamic CSS Code',
  			'desc'        => __('Add dynamic CSS code with values from the theme options. Only edit if you know what to do! If you edit this without any knowledge on Option Tree dynamic css including it might break the theme!', MAX_SHORTNAME),
  			'type'        => 'css',
  			'section'     => 'expert',
  			'rows'		  => 12,
  			'std'		  => '/* Font-Styles - DO NOT EDIT OR REMOVE THIS VALUES */
  body { {{font-body}} }'
  		),

    ) // end of settings
  );

  /* settings are not the same update the DB */
  if ( $saved_settings !== $custom_settings ) {
    update_option( 'option_tree_settings', $custom_settings );
  }

}

?>


text:
<?php
namespace Vivo\Controller\CLI;

use Vivo\CMS\Api\CMS;
use Vivo\SiteManager\Event\SiteEvent;
use Vivo\Repository\RepositoryInterface;
use Vivo\Uuid\GeneratorInterface as UuidGeneratorInterface;
use Vivo\CMS\Api\IndexerInterface as IndexerApiInterface;

/**
 * CmsController
 * Vivo CLI controller for command 'cms'
 */
class CmsController extends AbstractCliController
{
    const COMMAND = 'cms';

    /**
     * CMS Api
     * @var CMS
     */
    protected $cms;

    /**
     * SiteEvent
     * @var SiteEvent
     */
    protected $siteEvent;

    /**
     * Repository
     * @var RepositoryInterface
     */
    protected $repository;

    /**
     * UUID Generator
     * @var UuidGeneratorInterface
     */
    protected $uuidGenerator;

    /**
     * Indexer API
     * @var IndexerApiInterface
     */
    protected $indexerApi;

    /**
     * Constructor
     * @param \Vivo\CMS\Api\CMS $cms
     * @param \Vivo\SiteManager\Event\SiteEvent $siteEvent
     * @param \Vivo\Repository\RepositoryInterface $repository
     * @param \Vivo\Uuid\GeneratorInterface $uuidGenerator
     * @param \Vivo\CMS\Api\IndexerInterface $indexerApi
     */
    public function __construct(CMS $cms,
                                SiteEvent $siteEvent,
                                RepositoryInterface $repository,
                                UuidGeneratorInterface $uuidGenerator,
                                IndexerApiInterface $indexerApi)
    {
        $this->cms              = $cms;
        $this->siteEvent        = $siteEvent;
        $this->repository       = $repository;
        $this->uuidGenerator    = $uuidGenerator;
        $this->indexerApi       = $indexerApi;
    }

    public function getConsoleUsage()
    {
        $output = "\nCMS usage:";
        $output .= "\ncms duplicateuuids <host>";
        $output .= "\ncms uniqueuuids <host> [--force|-f]";

        return $output;
    }

    /**
     * Returns list of duplicate UUIDs
     * @return string
     */
    public function duplicateUuidsAction()
    {
        //Prepare params
        $request    = $this->getRequest();
        /* @var $request \Zend\Console\Request */
        $host   = $request->getParam('host');
        if (!$this->siteEvent->getSite()) {
            $output = sprintf("No site object created; host = '%s'", $host);
            return $output;
        }
        $site   = $this->siteEvent->getSite();
        $path   = $site->getPath();
        $duplicateUuids = $this->cms->getDuplicateUuidsInStorage($path);
        $numOfDuplicates    = count($duplicateUuids);
        if ($numOfDuplicates == 0) {
            $output = "\nThere are no duplicate uuids";
        } else {
            $output = sprintf("\n%s UUIDs are duplicated (not unique) in repository:", $numOfDuplicates);
            foreach ($duplicateUuids as $uuid => $paths) {
                $output .= sprintf("\n\n%s", $uuid);
                foreach ($paths as $path) {
                    $output .= sprintf("\n    %s", $path);
                }
            }
        }
        return $output;
    }

    /**
     * Replaces duplicate uuids with newly generated ones
     * For development purposes only!
     * @return string
     */
    public function uniqueUuidsAction()
    {
        //Prepare params
        $request    = $this->getRequest();
        /* @var $request \Zend\Console\Request */
        $host   = $request->getParam('host');
        if (!$this->siteEvent->getSite()) {
            $output = sprintf("No site object created; host = '%s'", $host);
            return $output;
        }
        // Check force flag
        $force  = $request->getParam('force') || $request->getParam('f');

        $site   = $this->siteEvent->getSite();
        $path   = $site->getPath();

        if ($force) {
            //Replace all UUIDs
            $entities   = $this->repository->getDescendantsFromStorage($path);
            $me         = $this->repository->getEntityFromStorage($path);
            if ($me) {
                $entities[] = $me;
            }
            $output     = "\nReplacing all UUIDs...";
            $count      = 0;
            foreach ($entities as $entity) {
                $newUuid    = $this->uuidGenerator->create();
                $entity->setUuid($newUuid);
                $this->cms->saveEntity($entity, false);
                $count++;
            }
            $this->repository->commit();
            $output     .= sprintf("\nCommitted %s updated entities into repository", $count);
        } else {
            //Replace only duplicate UUIDs
            $duplicateUuids     = $this->cms->getDuplicateUuidsInStorage($path);
            $numOfDuplicates    = count($duplicateUuids);
            if ($numOfDuplicates == 0) {
                $output = "\nThere are no duplicate uuids";
            } else {
                $output = sprintf("\n%s UUIDs are duplicated (not unique) in repository", $numOfDuplicates);
                foreach ($duplicateUuids as $uuid => $paths) {
                    $output .= sprintf("\n\n%s", $uuid);
                    array_shift($paths);
                    foreach ($paths as $pathOfDup) {
                        $entity = $this->repository->getEntity($pathOfDup);
                        $newUuid    = $this->uuidGenerator->create();
                        $entity->setUuid($newUuid);
                        $this->cms->saveEntity($entity, false);
                        $output .= sprintf("\n    %s -> %s", $pathOfDup, $newUuid);
                    }
                }
                $this->repository->commit();
            }
        }
        //Reindex
        $reindexedNum   = $this->indexerApi->reindex($site, '/', true);
        $output         .= sprintf("\n\nReindexed %s", $reindexedNum);
        return $output;
    }
}


text:
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                         "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
	<display-name>Archetype Created Web Application</display-name>
	<servlet>
		<servlet-name>Upload</servlet-name>
		<display-name>Upload</display-name>
		<description>Upload</description>
		<servlet-class>com.linkwithweb.demos.CommonsFileUploadServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>Upload</servlet-name>
		<url-pattern>/Upload</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>/index.jsp</welcome-file>
	</welcome-file-list>
</web-app>


text:
class CreateLockings < ActiveRecord::Migration
  def change
    create_table :lockings do |t|
      t.integer :file_id
      t.integer :user_id
      t.timestamp :lock_time

      t.timestamps
    end
  end
end


text:
package org.bitcoins.testkit.wallet

import com.typesafe.config.Config
import org.bitcoins.rpc.client.common.BitcoindRpcClient
import org.bitcoins.rpc.client.v19.BitcoindV19RpcClient
import org.bitcoins.testkit.EmbeddedPg
import org.bitcoins.testkit.chain.SyncUtil
import org.bitcoins.testkit.fixtures.BitcoinSFixture
import org.bitcoins.testkit.rpc.{
  BitcoindRpcTestUtil,
  CachedBitcoind,
  CachedBitcoindNewest,
  CachedBitcoindV19
}
import org.bitcoins.testkit.wallet.BitcoinSWalletTest.{
  createWalletWithBitcoind,
  createWalletWithBitcoindCallbacks,
  destroyOnlyWalletWithBitcoindCached
}
import org.bitcoins.wallet.config.WalletAppConfig
import org.scalatest.{FutureOutcome, Outcome}

import scala.concurrent.Future
import scala.util.{Failure, Success}

/** Bitcoin-s wallet test trait that uses cached bitcoinds
  * rather than fresh bitcoinds.
  *
  * This should be used by default unless there is a reason your
  * test suite needs fresh bitcoin's for every unit test inside of it
  */
trait BitcoinSWalletTestCachedBitcoind
    extends BitcoinSFixture
    with BaseWalletTest
    with EmbeddedPg { _: CachedBitcoind[_] =>

  /** Creates a funded wallet fixture with bitcoind
    * This is different than [[withFundedWalletAndBitcoind()]]
    * in the sense that it does NOT destroy the given bitcoind.
    * It is the responsibility of the caller of this method to
    * do that, if needed.
    */
  def withFundedWalletAndBitcoindCached(
      test: OneArgAsyncTest,
      bitcoind: BitcoindRpcClient)(implicit
      walletAppConfig: WalletAppConfig): FutureOutcome = {
    val builder: () => Future[WalletWithBitcoind[_]] = { () =>
      for {
        walletWithBitcoind <- createWalletWithBitcoindCallbacks(
          bitcoind = bitcoind)
        fundedWallet <- FundWalletUtil.fundWalletWithBitcoind(
          walletWithBitcoind)
        _ <- SyncUtil.syncWalletFullBlocks(wallet = fundedWallet.wallet,
                                           bitcoind = bitcoind)
        _ <- BitcoinSWalletTest.awaitWalletBalances(fundedWallet)
      } yield fundedWallet
    }

    makeDependentFixture[WalletWithBitcoind[_]](
      builder,
      { case walletWithBitcoind: WalletWithBitcoind[_] =>
        destroyOnlyWalletWithBitcoindCached(walletWithBitcoind)
      })(test)
  }

  def withNewWalletAndBitcoindCached(
      test: OneArgAsyncTest,
      bitcoind: BitcoindRpcClient)(implicit
      walletAppConfig: WalletAppConfig): FutureOutcome = {
    val builder: () => Future[WalletWithBitcoind[_]] =
      BitcoinSFixture.composeBuildersAndWrap(
        builder = { () =>
          Future.successful(bitcoind)
        },
        dependentBuilder = { (bitcoind: BitcoindRpcClient) =>
          createWalletWithBitcoind(bitcoind)
        },
        wrap =
          (_: BitcoindRpcClient, walletWithBitcoind: WalletWithBitcoind[_]) =>
            walletWithBitcoind
      )

    makeDependentFixture[WalletWithBitcoind[_]](
      builder,
      { case walletWithBitcoind: WalletWithBitcoind[_] =>
        destroyOnlyWalletWithBitcoindCached(walletWithBitcoind)
      })(test)
  }

  def withFundedWalletAndBitcoind(test: OneArgAsyncTest)(implicit
      walletAppConfig: WalletAppConfig): FutureOutcome = {
    val bitcoindF = BitcoinSFixture
      .createBitcoindWithFunds(None)

    //create a bitcoind, then pretend that it is cached
    //so we can re-use code in withFundedWalletBitcoindCached
    val resultF = for {
      bitcoind <- bitcoindF
      outcome = withFundedWalletAndBitcoindCached(test = test,
                                                  bitcoind = bitcoind)
      f <- outcome.toFuture
    } yield f

    //since we aren't actually caching the bitcoind, we need
    //to shut it down now
    val stoppedBitcoind: Future[Outcome] = resultF.transformWith({
      case Success(outcome) =>
        stopBitcoind(bitcoindF)
          .map(_ => outcome)
      case Failure(err) =>
        stopBitcoind(bitcoindF)
          .flatMap(_ => Future.failed(err))
    })

    val futureOutcome = new FutureOutcome(stoppedBitcoind)
    futureOutcome
  }

  /** Helper method to stop a Future[BitcoindRpcClient] */
  private def stopBitcoind(
      bitcoindF: Future[BitcoindRpcClient]): Future[Unit] = {
    for {
      bitcoind <- bitcoindF
      _ <- BitcoindRpcTestUtil.stopServer(bitcoind)
    } yield ()
  }

  override def afterAll(): Unit = {
    super[BaseWalletTest].afterAll()
  }
}

trait BitcoinSWalletTestCachedBitcoindNewest
    extends BitcoinSWalletTestCachedBitcoind
    with CachedBitcoindNewest {

  override def withFixture(test: OneArgAsyncTest): FutureOutcome = {
    val f: Future[Outcome] = for {
      bitcoind <- cachedBitcoindWithFundsF
      futOutcome = withFundedWalletAndBitcoindCached(test, bitcoind)(
        getFreshWalletAppConfig)
      fut <- futOutcome.toFuture
    } yield fut
    new FutureOutcome(f)
  }

  override def afterAll(): Unit = {
    super[CachedBitcoindNewest].afterAll()
    super[BitcoinSWalletTestCachedBitcoind].afterAll()
  }
}

trait BitcoinSWalletTestCachedBitcoinV19
    extends BitcoinSWalletTestCachedBitcoind
    with CachedBitcoindV19 {

  override def afterAll(): Unit = {
    super[CachedBitcoindV19].afterAll()
    super[BitcoinSWalletTestCachedBitcoind].afterAll()
  }

  /** Creates a funded wallet fixture with bitcoind
    * This is different than [[withFundedWalletAndBitcoind()]]
    * in the sense that it does NOT destroy the given bitcoind.
    * It is the responsibility of the caller of this method to
    * do that, if needed.
    */
  def withFundedWalletAndBitcoindCachedV19(
      test: OneArgAsyncTest,
      bip39PasswordOpt: Option[String],
      bitcoind: BitcoindV19RpcClient,
      walletAppConfig: WalletAppConfig): FutureOutcome = {
    val bip39PasswordConfig: Config =
      BitcoinSWalletTest.buildBip39PasswordConfig(bip39PasswordOpt)

    implicit val newWalletConf =
      walletAppConfig.withOverrides(bip39PasswordConfig)
    val builder: () => Future[WalletWithBitcoindV19] = { () =>
      for {
        walletWithBitcoind <- createWalletWithBitcoindCallbacks(
          bitcoind = bitcoind)
        walletWithBitcoindV19 = WalletWithBitcoindV19(
          walletWithBitcoind.wallet,
          bitcoind,
          walletWithBitcoind.walletConfig)
        fundedWallet <- FundWalletUtil
          .fundWalletWithBitcoind(walletWithBitcoindV19)
        _ <- SyncUtil.syncWalletFullBlocks(wallet = fundedWallet.wallet,
                                           bitcoind = bitcoind)
        _ <- BitcoinSWalletTest.awaitWalletBalances(fundedWallet)
      } yield fundedWallet
    }

    makeDependentFixture[WalletWithBitcoind[_]](
      builder,
      destroy = { case walletWithBitcoind: WalletWithBitcoind[_] =>
        destroyOnlyWalletWithBitcoindCached(walletWithBitcoind)
      })(test)
  }

  def withNewWalletAndBitcoindCachedV19(
      test: OneArgAsyncTest,
      bitcoind: BitcoindV19RpcClient)(implicit
      walletAppConfig: WalletAppConfig): FutureOutcome = {
    val builder: () => Future[WalletWithBitcoind[_]] =
      BitcoinSFixture.composeBuildersAndWrap(
        builder = { () =>
          Future.successful(bitcoind)
        },
        dependentBuilder = { (bitcoind: BitcoindV19RpcClient) =>
          BitcoinSWalletTest.createWalletWithBitcoindV19(bitcoind)
        },
        wrap =
          (_: BitcoindRpcClient, walletWithBitcoind: WalletWithBitcoindV19) =>
            walletWithBitcoind
      )

    makeDependentFixture[WalletWithBitcoind[_]](
      builder,
      { case walletWithBitcoind: WalletWithBitcoind[_] =>
        destroyOnlyWalletWithBitcoindCached(walletWithBitcoind)
      })(test)
  }

  override def withFixture(test: OneArgAsyncTest): FutureOutcome = {
    val f: Future[Outcome] = for {
      bitcoind <- cachedBitcoindWithFundsF
      futOutcome = withFundedWalletAndBitcoindCachedV19(test,
                                                        getBIP39PasswordOpt(),
                                                        bitcoind,
                                                        getFreshWalletAppConfig)
      fut <- futOutcome.toFuture
    } yield fut
    new FutureOutcome(f)
  }
}


text:
'Revit API .NET Labs

'Copyright (C) 2006-2021 by Autodesk, Inc.

'Permission to use, copy, modify, and distribute this software
'for any purpose and without fee is hereby granted, provided
'that the above copyright notice appears in all copies and
'that both that copyright notice and the limited warranty and
'restricted rights notice below appear in all supporting
'documentation.

'AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
'AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
'MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
'DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
'UNINTERRUPTED OR ERROR FREE.

'Use, duplication, or disclosure by the U.S. Government is subject to
'restrictions set forth in FAR 52.227-19 (Commercial Computer
'Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
'(Rights in Technical Data and Computer Software), as applicable.
#End Region

#Region "Namespaces"
Imports System
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.IO
Imports System.Linq
Imports Autodesk.Revit.ApplicationServices
Imports Autodesk.Revit.Attributes
Imports Autodesk.Revit.DB
Imports Autodesk.Revit.DB.Architecture
Imports Autodesk.Revit.DB.Structure
Imports Autodesk.Revit.UI
Imports Autodesk.Revit.UI.Selection
Imports Microsoft.VisualBasic.Constants
#End Region

Namespace XtraVb

#Region "Lab3_1_StandardFamiliesAndTypes"
  ''' <summary>
  ''' List all loaded standard families and types.
  ''' As a result of the issues explained below, we implemented
  ''' the LabUtils utility methods FamilyCategory and GetFamilies.
  ''' <include file='../doc/labs.xml' path='labs/lab[@name="3-1"]/*' />
  ''' </summary>
  <Transaction(TransactionMode.ReadOnly)> _
  Public Class Lab3_1_StandardFamiliesAndTypes
    Implements IExternalCommand

    Public Function Execute( _
        ByVal commandData As ExternalCommandData, _
        ByRef message As String, _
        ByVal elements As ElementSet) As Result _
        Implements IExternalCommand.Execute

      Dim app As UIApplication = commandData.Application
      Dim doc As Document = app.ActiveUIDocument.Document

      Dim a As New List(Of String)()
      Dim families As FilteredElementCollector

      '#region 3.1.a Retrieve and iterate over all Family objects in document:
      '
      ' get all family elements in current document:
      '
      families = New FilteredElementCollector(doc)

      families.OfClass(GetType(Family))

      For Each f As Family In families

        ' Get its category name; notice that the Category property is not
        ' implemented for the Family class; use FamilyCategory instead;
        ' notice that that is also not always implemented; in that case,
        ' use the workaround demonstrated below, looking at the contained
        ' family symbols' category:

        a.Add("Name=" + f.Name _
              + "; Category=" + If(f.Category Is Nothing, "?", f.Category.Name) _
              + "; FamilyCategory=" + If(f.FamilyCategory Is Nothing, "?", f.FamilyCategory.Name))
      Next
      '#endregion 3.1.a

      Dim msg As String = "{0} standard familie{1} are loaded in this model{2}"
      LabUtils.InfoMsg(msg, a)

      ' Loop through the collection of families, and now look at
      ' the child symbols (types) as well. These symbols can be
      ' used to determine the family category.

      For Each f As Family In families
        Dim catName As String
        Dim first As Boolean = True

        ' Loop all contained symbols (types):

        'For Each s As FamilySymbol In f.Symbols ' 2014
        For Each id As ElementId In f.GetFamilySymbolIds() ' 2015

          Dim s As FamilySymbol = doc.GetElement(id)

          ' you can determine the family category from its first symbol.

          If first Then
            first = False

            '#region 3.1.b Retrieve category name of first family symbol:
            catName = s.Category.Name
            '#endregion 3.1.b

            msg = "Family: Name=" + f.Name _
                + "; Id=" + f.Id.IntegerValue.ToString() _
                + "; Category=" + catName + vbCrLf + "Contains Types:"
          End If
          msg += vbCrLf + "    " + s.Name + "; Id=" + s.Id.IntegerValue.ToString()
        Next

        ' Show the symbols for this family and allow user to proceed
        ' to the next family (OK) or cancel (Cancel)

        msg += vbCrLf + "Continue?"
        If Not LabUtils.QuestionMsg(msg) Then
          Exit For
        End If
      Next
      Return Result.Failed
    End Function

  End Class
#End Region

#Region "Lab3_2_LoadStandardFamilies"
  ''' <summary>
  ''' Load an entire family or a specific type from a family.
  ''' <include file='../doc/labs.xml' path='labs/lab[@name="3-2"]/*' />
  ''' </summary>
  <Transaction(TransactionMode.ReadOnly)>
  Public Class Lab3_2_LoadStandardFamilies
    Implements IExternalCommand

    Public Function Execute( _
        ByVal commandData As ExternalCommandData, _
        ByRef message As String, _
        ByVal elements As ElementSet) _
        As Result _
        Implements IExternalCommand.Execute

      Dim app As UIApplication = commandData.Application
      Dim doc As Document = app.ActiveUIDocument.Document
      Dim rc As Boolean

      Using t As New Transaction(doc)
        t.Start("Load Family")

        '#region 3.2.a Load an entire RFA family file:

        ' Load a whole Family
        '
        ' Example for a family WITH TXT file:

        rc = doc.LoadFamily(LabConstants.WholeFamilyFileToLoad1)
        '#endregion 3.2.a

        If rc Then
          LabUtils.InfoMsg("Successfully loaded family " _
                           + LabConstants.WholeFamilyFileToLoad1 + ".")
        Else
          LabUtils.ErrorMsg("ERROR loading family " _
                            + LabConstants.WholeFamilyFileToLoad1 + ".")
        End If

        ' Example for a family WITHOUT TXT file:

        If doc.LoadFamily(LabConstants.WholeFamilyFileToLoad2) Then
          LabUtils.InfoMsg("Successfully loaded family " _
                           + LabConstants.WholeFamilyFileToLoad2 + ".")
        Else
          LabUtils.ErrorMsg("ERROR loading family " _
                            + LabConstants.WholeFamilyFileToLoad2 + ".")
        End If

        '#region 3.2.b Load an individual type from a RFA family file:

        ' Load only a specific symbol (type):

        rc = doc.LoadFamilySymbol(
            LabConstants.FamilyFileToLoadSingleSymbol,
            LabConstants.SymbolName)
        '#endregion 3.2.b

        If rc Then
          LabUtils.InfoMsg("Successfully loaded family symbol " _
                         + LabConstants.FamilyFileToLoadSingleSymbol _
                         + " : " + LabConstants.SymbolName + ".")
        Else
          LabUtils.ErrorMsg("ERROR loading family symbol " _
                          + LabConstants.FamilyFileToLoadSingleSymbol _
                          + " : " + LabConstants.SymbolName + ".")
        End If
        t.Commit()
      End Using
      Return Result.Succeeded
    End Function
  End Class
#End Region

#Region "Lab3_3_DetermineInstanceTypeAndFamily"
  ''' <summary>
  ''' For a selected family instance in the model, determine its type and family.
  ''' <include file='../doc/labs.xml' path='labs/lab[@name="3-3"]/*' />
  ''' </summary>
  <Transaction(TransactionMode.ReadOnly)>
  Public Class Lab3_3_DetermineInstanceTypeAndFamily
    Implements IExternalCommand

    Public Function Execute( _
        ByVal commandData As ExternalCommandData, _
        ByRef message As String, _
        ByVal elements As ElementSet) As Result _
        Implements IExternalCommand.Execute

      Dim app As UIApplication = commandData.Application
      Dim uidoc As UIDocument = app.ActiveUIDocument
      Dim doc As Document = uidoc.Document

      ' retrieve all FamilySymbol objects of "Windows" category:

      Dim bic As BuiltInCategory = BuiltInCategory.OST_Windows
      Dim symbols As FilteredElementCollector = LabUtils.GetFamilySymbols(doc, bic)

      Dim a As New List(Of String)()

      For Each s As FamilySymbol In symbols
        Dim fam As Family = s.Family

        a.Add(s.Name + ", Id=" + s.Id.IntegerValue.ToString() _
              + "; Family name=" + fam.Name _
              + ", Family Id=" + fam.Id.IntegerValue.ToString())
      Next
      LabUtils.InfoMsg("{0} windows family symbol{1} loaded in the model{1}", a)

      ' loop through the selection set and check for
      ' standard family instances of "Windows" category:

      Dim iBic As Integer = CInt(bic)
      Dim msg As String, content As String

      For Each id As ElementId In uidoc.Selection.GetElementIds()
        Dim e As Element = doc.GetElement(id)
        If TypeOf e Is FamilyInstance _
            AndAlso e.Category IsNot Nothing _
            AndAlso e.Category.Id.IntegerValue.Equals(iBic) Then

          msg = "Selected window Id=" + e.Id.IntegerValue.ToString()

          Dim inst As FamilyInstance = TryCast(e, FamilyInstance)

          '#region 3.3 Retrieve the type of the family instance, and the family of the type:

          Dim fs As FamilySymbol = inst.Symbol

          Dim f As Family = fs.Family

          '#endregion 3.3

          content = "FamilySymbol = " + fs.Name _
              + "; Id=" + fs.Id.IntegerValue.ToString()

          content += vbCrLf + " Family = " + f.Name _
              + "; Id=" + f.Id.IntegerValue.ToString()

          LabUtils.InfoMsg(msg, content)
        End If
      Next
      Return Result.Succeeded
    End Function

  End Class
#End Region

#Region "Lab3_4_ChangeSelectedInstanceType"
  ''' <summary>
  ''' Form-based utility to change the type or symbol of a selected standard instance.
  ''' <include file='../doc/labs.xml' path='labs/lab[@name="3-4"]/*' />
  ''' </summary>
  <Transaction(TransactionMode.Manual)>
  Public Class Lab3_4_ChangeSelectedInstanceType
    Implements IExternalCommand

    Public Function Execute( _
        ByVal commandData As ExternalCommandData, _
        ByRef message As String, _
        ByVal elements As ElementSet) As Result _
        Implements IExternalCommand.Execute

      Dim app As UIApplication = commandData.Application
      Dim uidoc As UIDocument = app.ActiveUIDocument
      Dim doc As Document = uidoc.Document

      Dim inst As FamilyInstance = TryCast( _
          LabUtils.GetSingleSelectedElementOrPrompt( _
              uidoc, GetType(FamilyInstance)), FamilyInstance)

      If inst Is Nothing Then
        LabUtils.ErrorMsg("Selected element is not a standard family instance.")
        Return Result.Cancelled
      End If

      Dim instCat As Category = inst.Category

      Dim mapFamilyToSymbols As New Dictionary(Of String, List(Of FamilySymbol))()

      If True Then
        Dim waitCursor As New WaitCursor()

        ' Collect all types applicable to this category and sort them into
        ' a dictionary mapping the family name to a list of its types.
        '
        ' We create a collection of all loaded families for this category
        ' and for each one, the list of all loaded types (symbols).
        '
        ' There are many ways how to store the matching objects, but we choose
        ' whatever is most suitable for the relevant UI. We could use Revit's
        ' generic Map class, but it is probably more efficient to use the .NET
        ' strongly-typed Dictionary with
        ' KEY = Family name (String)
        ' VALUE = list of corresponding FamilySymbol objects
        '
        ' Find all the corresponding Families/Types:

        Dim families As New FilteredElementCollector(doc)

        families.OfClass(GetType(Family))

        For Each f As Family In families
          Dim categoryMatches As Boolean = False

          Dim ids As ISet(Of ElementId) = f.GetFamilySymbolIds() ' 2015

          ' we cannot trust f.Category or f.FamilyCategory,
          ' grab category from first family symbol instead:

          'For Each sym As FamilySymbol In f.Symbols ' 2014
          For Each id As ElementId In ids ' 2015
            Dim sym As FamilySymbol = doc.GetElement(id)
            categoryMatches = sym.Category.Id.Equals(instCat.Id)
            Exit For
          Next

          If categoryMatches Then
            Dim symbols As New List(Of FamilySymbol)()

            For Each id As ElementId In ids
              Dim sym As FamilySymbol = doc.GetElement(id)
              symbols.Add(sym)
            Next

            mapFamilyToSymbols.Add(f.Name, symbols)
          End If
        Next
      End If

      ' Display the form, allowing the user to select a family
      ' and a type, and assign this type to the instance.

      Dim form As Lab3_4_Form

      form = New Lab3_4_Form(mapFamilyToSymbols)

      If System.Windows.Forms.DialogResult.OK = form.ShowDialog() Then
        Using t As New Transaction(doc)
          t.Start("Change Selected Instance Type")
          inst.Symbol = TryCast(form.cmbType.SelectedItem, FamilySymbol)
          t.Commit()
        End Using

        LabUtils.InfoMsg(
          "Successfully changed family : type to " _
          + form.cmbFamily.Text + " : " + form.cmbType.Text)

      End If
      Return Result.Succeeded
    End Function

  End Class
#End Region

#Region "Lab3_5_WallAndFloorTypes"
  ''' <summary>
  ''' Access and modify system family type, similarly
  ''' to the standard families looked at above:
  '''
  ''' List all wall and floor types and
  ''' change the type of selected walls and floors.
  ''' <include file='../doc/labs.xml' path='labs/lab[@name="3-5"]/*' />
  ''' </summary>
  <Transaction(TransactionMode.Manual)>
  Public Class Lab3_5_WallAndFloorTypes
    Implements IExternalCommand

    Public Function Execute( _
        ByVal commandData As ExternalCommandData, _
        ByRef message As String, _
        ByVal elements As ElementSet) As Result _
        Implements IExternalCommand.Execute

      Dim app As UIApplication = commandData.Application
      Dim uidoc As UIDocument = app.ActiveUIDocument
      Dim doc As Document = uidoc.Document

      ' Find all wall types and their system families (or kinds):

      Dim newWallType As WallType = Nothing

      Dim msg As String = "All wall types and families in the model:"
      Dim content As String = String.Empty

      'For Each wt As WallType In doc.WallTypes ' 2014

      Dim wallTypes As FilteredElementCollector = New FilteredElementCollector(doc).OfClass(GetType(WallType)) '2015

      For Each wt As WallType In wallTypes ' 2015
        content += vbCrLf + "Type=" + wt.Name + " Family=" + wt.Kind.ToString()
        newWallType = wt
      Next

      content += vbCrLf + "Stored WallType " + newWallType.Name + " (Id=" + newWallType.Id.IntegerValue.ToString() + ") for later use."

      LabUtils.InfoMsg(msg, content)

      ' Find all floor types:

      Dim newFloorType As FloorType = Nothing

      msg = "All floor types in the model:"
      content = String.Empty

      'For Each ft As FloorType In doc.FloorTypes ' 2014

      Dim floorTypes As FilteredElementCollector = New FilteredElementCollector(doc).OfClass(GetType(FloorType)) '2015

      For Each ft As FloorType In floorTypes ' 2015
        content += vbCrLf + "Type=" + ft.Name + ", Id=" + ft.Id.IntegerValue.ToString()

        ' In 9.0, the "Foundation Slab" system family from "Structural
        ' Foundations" category ALSO contains FloorType class instances.
        ' Be careful to exclude those as choices for standard floor types.

        Dim p As Parameter = ft.Parameter(BuiltInParameter.SYMBOL_FAMILY_NAME_PARAM)
        Dim famName As String = If(p Is Nothing, "?", p.AsString())
        Dim cat As Category = ft.Category
        content += ", Family=" + famName + ", Category=" + cat.Name

        ' store for the new floor type only if it has the proper Floors category:

        If cat.Id.Equals(CInt(BuiltInCategory.OST_Floors)) Then
          newFloorType = ft
        End If
      Next

      content += vbCrLf + If(newFloorType Is Nothing, "No floor type found.", _
                    "Stored FloorType " + newFloorType.Name + " (Id=") _
                    + newFloorType.Id.IntegerValue.ToString() + ") for later use"

      LabUtils.InfoMsg(msg, content)

      ' Change the type for selected walls and floors:

      Using t As New Transaction(doc)
        t.Start("Change Type of Walls and Floors")

        msg = "{0} {1}: Id={2}" + vbCrLf _
          + " changed from old type={3}; Id={4}" _
          + " to new type={5}; Id={6}."

        'Dim sel As ElementSet = uidoc.Selection.Elements ' 2014

        Dim ids As ICollection(Of ElementId) = uidoc.Selection.GetElementIds()

        Dim iWall As Integer = 0
        Dim iFloor As Integer = 0

        For Each id As ElementId In ids
          Dim e As Element = doc.GetElement(id)
          If TypeOf e Is Wall Then
            iWall += 1
            Dim wall As Wall = TryCast(e, Wall)
            Dim oldWallType As WallType = wall.WallType

            ' change wall type and report the old/new values

            wall.WallType = newWallType

            LabUtils.InfoMsg(String.Format(msg, "Wall", iWall, wall.Id.IntegerValue,
                                         oldWallType.Name, oldWallType.Id.IntegerValue,
          wall.WallType.Name, wall.WallType.Id.IntegerValue))
          ElseIf newFloorType IsNot Nothing AndAlso TypeOf e Is Floor Then
            iFloor += 1
            Dim f As Floor = TryCast(e, Floor)
            Dim oldFloorType As FloorType = f.FloorType
            f.FloorType = newFloorType

            LabUtils.InfoMsg(String.Format(msg, "Floor", iFloor, f.Id.IntegerValue,
                                         oldFloorType.Name, oldFloorType.Id.IntegerValue,
          f.FloorType.Name, f.FloorType.Id.IntegerValue))
          End If
        Next
        t.Commit()
      End Using
      Return Result.Succeeded
    End Function

  End Class
#End Region

#Region "Lab3_6_DuplicateWallType"
  ''' <summary>
  ''' Create a new family symbol or type by calling Duplicate()
  ''' on an existing one and then modifying its parameters.
  ''' </summary>
  <Transaction(TransactionMode.Manual)>
  Public Class Lab3_6_DuplicateWallType
    Implements IExternalCommand

    Public Function Execute( _
        ByVal commandData As ExternalCommandData, _
        ByRef message As String, _
        ByVal elements As ElementSet) As Result _
        Implements IExternalCommand.Execute

      Dim app As UIApplication = commandData.Application
      Dim uidoc As UIDocument = app.ActiveUIDocument
      Dim doc As Document = uidoc.Document
      'Dim a As ElementSet = uidoc.Selection.Elements ' 2014
      Dim ids As ICollection(Of ElementId) = uidoc.Selection.GetElementIds()

      Const newWallTypeName As String = "NewWallType_with_Width_doubled"

      Using t As New Transaction(doc)
        t.Start("Duplicate Wall Type")

        For Each id As ElementId In ids
          Dim e As Element = doc.GetElement(id)
          Dim wall As Wall = TryCast(e, Wall)
          If wall IsNot Nothing Then
            Dim wallType As WallType = wall.WallType
            Dim newWallType As WallType = TryCast(wallType.Duplicate(newWallTypeName), WallType)
            'Dim layers As CompoundStructureLayerArray = newWallType.CompoundStructure.Layers ' 2011
            Dim layers As IList(Of CompoundStructureLayer) = newWallType.GetCompoundStructure().GetLayers() ' 2012
            For Each layer As CompoundStructureLayer In layers
              ' double each layer thickness:
              'layer.Thickness *= 2.0R ' 2011
              layer.Width *= 2.0R ' 2012
            Next
            ' assign the new wall type back to the wall:
            wall.WallType = newWallType
            ' only process the first wall, if one was selected:
            Exit For
          End If
        Next
        t.Commit()
      End Using
      Return Result.Succeeded

    End Function
  End Class

#End Region

#Region "Lab3_7_DeleteFamilyType"
  ''' <summary>
  ''' Delete a specific individual type from a family.
  ''' Hard-coded to a column type named "475 x 610mm".
  ''' </summary>
  <Transaction(TransactionMode.Manual)>
  Public Class Lab3_7_DeleteFamilyType
    Implements IExternalCommand

    Public Function Execute( _
        ByVal commandData As ExternalCommandData, _
        ByRef message As String, _
        ByVal elements As ElementSet) As Result _
        Implements IExternalCommand.Execute

      Dim app As UIApplication = commandData.Application
      Dim doc As Document = app.ActiveUIDocument.Document

      Dim collector As FilteredElementCollector _
          = LabUtils.GetFamilySymbols( _
              doc, BuiltInCategory.OST_Columns)

      'Dim column_types = From element In collector _
      '    Where element.Name.Equals("475 x 610mm") _
      '    Select Element
      '
      'Dim column_types_ienum As IEnumerable(Of Element)
      'column_types_ienum = CType(column_types, IEnumerable(Of Element))
      '
      'Dim column_types_famsym As IEnumerable(Of FamilySymbol)
      'column_types_famsym = column_types_ienum.Cast(Of FamilySymbol)()
      '
      'Dim symbol As FamilySymbol = column_types_famsym.First()

      'Dim name_equals = Function(e) e.Name.Equals("475 x 610mm")

      'Dim name_equals As Func(Of Element, Boolean) _
      '    = Function(e As Element) e.Name.Equals("475 x 610mm")
      '
      'Dim symbol As Element = collector.First(name_equals)

      Dim symbol As Element = collector.First( _
          Function(e As Element) e.Name.Equals("475 x 610mm"))

      Using t As New Transaction(doc)
        t.Start("Delete Family Type")
        'doc.Delete(symbol) ' 2013
        doc.Delete(symbol.Id) ' 2014
        t.Commit()
      End Using
      Return Result.Succeeded
    End Function

  End Class

#End Region

End Namespace


text:
package de.tavendo.autobahn;

import android.os.Bundle;

public interface WebSocket {

   /**
    * Session handler for WebSocket sessions.
    */
   public interface ConnectionHandler {

      /**
       * Connection was closed normally.
       */
      public static final int CLOSE_NORMAL = 1;

      /**
       * Connection could not be established in the first place.
       */
      public static final int CLOSE_CANNOT_CONNECT = 2;

      /**
       * A previously established connection was lost unexpected.
       */
      public static final int CLOSE_CONNECTION_LOST = 3;

      /**
       * The connection was closed because a protocol violation
       * occurred.
       */
      public static final int CLOSE_PROTOCOL_ERROR = 4;

	   /**
	    * Internal error.
	    */
	   public static final int CLOSE_INTERNAL_ERROR = 5;

	   /**
	    * Server returned error while connecting
	    */
	   public static final int CLOSE_SERVER_ERROR = 6;

	   /**
	    * Server connection lost, scheduled reconnect
	    */
	   public static final int CLOSE_RECONNECT = 7;

      /**
       * Fired when the WebSockets connection has been established.
       * After this happened, messages may be sent.
       */
      public void onOpen();

      /**
       * Fired when the WebSockets connection has deceased (or could
       * not established in the first place).
       *
       * @param code       Close code.
       * @param data       Additional data
       */
      public void onClose(int code, Bundle data);

      /**
       * Fired when a text message has been received (and text
       * messages are not set to be received raw).
       *
       * @param payload    Text message payload or null (empty payload).
       */
      public void onTextMessage(String payload);

      /**
       * Fired when a text message has been received (and text
       * messages are set to be received raw).
       *
       * @param payload    Text message payload as raw UTF-8 or null (empty payload).
       */
      public void onRawTextMessage(byte[] payload);

      /**
       * Fired when a binary message has been received.
       *
       * @param payload    Binar message payload or null (empty payload).
       */
      public void onBinaryMessage(byte[] payload);
   }

   public void connect(String wsUri, ConnectionHandler wsHandler) throws WebSocketException;
   public void connect(String wsUri, ConnectionHandler wsHandler, WebSocketOptions options) throws WebSocketException;
   public void disconnect();
   public boolean isConnected();
   public void sendBinaryMessage(byte[] payload);
   public void sendRawTextMessage(byte[] payload);
   public void sendTextMessage(String payload);
}


text:
var Marker = require('./marker');
var Token = require('./token');

var formatPosition = require('../utils/format-position');

var Level = {
  BLOCK: 'block',
  COMMENT: 'comment',
  DOUBLE_QUOTE: 'double-quote',
  RULE: 'rule',
  SINGLE_QUOTE: 'single-quote'
};

var AT_RULES = [
  '@charset',
  '@import'
];

var BLOCK_RULES = [
  '@-moz-document',
  '@document',
  '@-moz-keyframes',
  '@-ms-keyframes',
  '@-o-keyframes',
  '@-webkit-keyframes',
  '@keyframes',
  '@media',
  '@supports'
];

var RULE_WORD_SEPARATOR_PATTERN = /[\s\(]/;
var TAIL_BROKEN_VALUE_PATTERN = /[\s|\}]*$/;

function tokenize(source, externalContext) {
  var internalContext = {
    level: Level.BLOCK,
    position: {
      source: externalContext.source || undefined,
      line: 1,
      column: 0,
      index: 0
    }
  };

  return intoTokens(source, externalContext, internalContext, false);
}

function intoTokens(source, externalContext, internalContext, isNested) {
  var allTokens = [];
  var newTokens = allTokens;
  var lastToken;
  var ruleToken;
  var ruleTokens = [];
  var propertyToken;
  var metadata;
  var metadatas = [];
  var level = internalContext.level;
  var levels = [];
  var buffer = [];
  var buffers = [];
  var serializedBuffer;
  var roundBracketLevel = 0;
  var isQuoted;
  var isSpace;
  var isNewLineNix;
  var isNewLineWin;
  var isCommentStart;
  var wasCommentStart = false;
  var isCommentEnd;
  var wasCommentEnd = false;
  var isEscaped;
  var wasEscaped = false;
  var seekingValue = false;
  var seekingPropertyBlockClosing = false;
  var position = internalContext.position;

  for (; position.index < source.length; position.index++) {
    var character = source[position.index];

    isQuoted = level == Level.SINGLE_QUOTE || level == Level.DOUBLE_QUOTE;
    isSpace = character == Marker.SPACE || character == Marker.TAB;
    isNewLineNix = character == Marker.NEW_LINE_NIX;
    isNewLineWin = character == Marker.NEW_LINE_NIX && source[position.index - 1] == Marker.NEW_LINE_WIN;
    isCommentStart = !wasCommentEnd && level != Level.COMMENT && !isQuoted && character == Marker.ASTERISK && source[position.index - 1] == Marker.FORWARD_SLASH;
    isCommentEnd = !wasCommentStart && level == Level.COMMENT && character == Marker.FORWARD_SLASH && source[position.index - 1] == Marker.ASTERISK;

    metadata = buffer.length === 0 ?
      [position.line, position.column, position.source] :
      metadata;

    if (isEscaped) {
      // previous character was a backslash
      buffer.push(character);
    } else if (!isCommentEnd && level == Level.COMMENT) {
      buffer.push(character);
    } else if (isCommentStart && (level == Level.BLOCK || level == Level.RULE) && buffer.length > 1) {
      // comment start within block preceded by some content, e.g. div/*<--
      metadatas.push(metadata);
      buffer.push(character);
      buffers.push(buffer.slice(0, buffer.length - 2));

      buffer = buffer.slice(buffer.length - 2);
      metadata = [position.line, position.column - 1, position.source];

      levels.push(level);
      level = Level.COMMENT;
    } else if (isCommentStart) {
      // comment start, e.g. /*<--
      levels.push(level);
      level = Level.COMMENT;
      buffer.push(character);
    } else if (isCommentEnd) {
      // comment end, e.g. /* comment */<--
      serializedBuffer = buffer.join('').trim() + character;
      lastToken = [Token.COMMENT, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]];
      newTokens.push(lastToken);

      level = levels.pop();
      metadata = metadatas.pop() || null;
      buffer = buffers.pop() || [];
    } else if (character == Marker.SINGLE_QUOTE && !isQuoted) {
      // single quotation start, e.g. a[href^='https<--
      levels.push(level);
      level = Level.SINGLE_QUOTE;
      buffer.push(character);
    } else if (character == Marker.SINGLE_QUOTE && level == Level.SINGLE_QUOTE) {
      // single quotation end, e.g. a[href^='https'<--
      level = levels.pop();
      buffer.push(character);
    } else if (character == Marker.DOUBLE_QUOTE && !isQuoted) {
      // double quotation start, e.g. a[href^="<--
      levels.push(level);
      level = Level.DOUBLE_QUOTE;
      buffer.push(character);
    } else if (character == Marker.DOUBLE_QUOTE && level == Level.DOUBLE_QUOTE) {
      // double quotation end, e.g. a[href^="https"<--
      level = levels.pop();
      buffer.push(character);
    } else if (!isCommentStart && !isCommentEnd && character != Marker.CLOSE_ROUND_BRACKET && character != Marker.OPEN_ROUND_BRACKET && level != Level.COMMENT && !isQuoted && roundBracketLevel > 0) {
      // character inside any function, e.g. hsla(.<--
      buffer.push(character);
    } else if (character == Marker.OPEN_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) {
      // round open bracket, e.g. @import url(<--
      buffer.push(character);

      roundBracketLevel++;
    } else if (character == Marker.CLOSE_ROUND_BRACKET && !isQuoted && level != Level.COMMENT && !seekingValue) {
      // round open bracket, e.g. @import url(test.css)<--
      buffer.push(character);

      roundBracketLevel--;
    } else if (character == Marker.SEMICOLON && level == Level.BLOCK && buffer[0] == Marker.AT) {
      // semicolon ending rule at block level, e.g. @import '...';<--
      serializedBuffer = buffer.join('').trim();
      allTokens.push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

      buffer = [];
    } else if (character == Marker.COMMA && level == Level.BLOCK && ruleToken) {
      // comma separator at block level, e.g. a,div,<--
      serializedBuffer = buffer.join('').trim();
      ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, ruleToken[1].length)]]);

      buffer = [];
    } else if (character == Marker.COMMA && level == Level.BLOCK && tokenTypeFrom(buffer) == Token.AT_RULE) {
      // comma separator at block level, e.g. @import url(...) screen,<--
      // keep iterating as end semicolon will create the token
      buffer.push(character);
    } else if (character == Marker.COMMA && level == Level.BLOCK) {
      // comma separator at block level, e.g. a,<--
      ruleToken = [tokenTypeFrom(buffer), [], []];
      serializedBuffer = buffer.join('').trim();
      ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, 0)]]);

      buffer = [];
    } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && ruleToken && ruleToken[0] == Token.NESTED_BLOCK) {
      // open brace opening at-rule at block level, e.g. @media{<--
      serializedBuffer = buffer.join('').trim();
      ruleToken[1].push([Token.NESTED_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      allTokens.push(ruleToken);

      levels.push(level);
      position.column++;
      position.index++;
      buffer = [];

      ruleToken[2] = intoTokens(source, externalContext, internalContext, true);
      ruleToken = null;
    } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK && tokenTypeFrom(buffer) == Token.NESTED_BLOCK) {
      // open brace opening at-rule at block level, e.g. @media{<--
      serializedBuffer = buffer.join('').trim();
      ruleToken = ruleToken || [Token.NESTED_BLOCK, [], []];
      ruleToken[1].push([Token.NESTED_BLOCK_SCOPE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      allTokens.push(ruleToken);

      levels.push(level);
      position.column++;
      position.index++;
      buffer = [];

      ruleToken[2] = intoTokens(source, externalContext, internalContext, true);
      ruleToken = null;
    } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.BLOCK) {
      // open brace opening rule at block level, e.g. div{<--
      serializedBuffer = buffer.join('').trim();
      ruleToken = ruleToken || [tokenTypeFrom(buffer), [], []];
      ruleToken[1].push([tokenScopeFrom(ruleToken[0]), serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext, ruleToken[1].length)]]);
      newTokens = ruleToken[2];
      allTokens.push(ruleToken);

      levels.push(level);
      level = Level.RULE;
      buffer = [];
    } else if (character == Marker.OPEN_CURLY_BRACKET && level == Level.RULE && seekingValue) {
      // open brace opening rule at rule level, e.g. div{--variable:{<--
      ruleTokens.push(ruleToken);
      ruleToken = [Token.PROPERTY_BLOCK, []];
      propertyToken.push(ruleToken);
      newTokens = ruleToken[1];

      levels.push(level);
      level = Level.RULE;
      seekingValue = false;
    } else if (character == Marker.COLON && level == Level.RULE && !seekingValue) {
      // colon at rule level, e.g. a{color:<--
      serializedBuffer = buffer.join('').trim();
      propertyToken = [Token.PROPERTY, [Token.PROPERTY_NAME, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]];
      newTokens.push(propertyToken);

      seekingValue = true;
      buffer = [];
    } else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && ruleTokens.length > 0 && buffer.length > 0 && buffer[0] == Marker.AT) {
      // semicolon at rule level for at-rule, e.g. a{--color:{@apply(--other-color);<--
      serializedBuffer = buffer.join('').trim();
      ruleToken[1].push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

      buffer = [];
    } else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && buffer.length > 0) {
      // semicolon at rule level, e.g. a{color:red;<--
      serializedBuffer = buffer.join('').trim();
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

      propertyToken = null;
      seekingValue = false;
      buffer = [];
    } else if (character == Marker.SEMICOLON && level == Level.RULE && propertyToken && buffer.length === 0) {
      // semicolon after bracketed value at rule level, e.g. a{color:rgb(...);<--
      propertyToken = null;
      seekingValue = false;
    } else if (character == Marker.SEMICOLON && level == Level.RULE && buffer.length > 0 && buffer[0] == Marker.AT) {
      // semicolon for at-rule at rule level, e.g. a{@apply(--variable);<--
      serializedBuffer = buffer.join('');
      newTokens.push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

      seekingValue = false;
      buffer = [];
    } else if (character == Marker.SEMICOLON && level == Level.RULE && seekingPropertyBlockClosing) {
      // close brace after a property block at rule level, e.g. a{--custom:{color:red;};<--
      seekingPropertyBlockClosing = false;
      buffer = [];
    } else if (character == Marker.SEMICOLON && level == Level.RULE && buffer.length === 0) {
      // stray semicolon at rule level, e.g. a{;<--
      // noop
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && seekingValue && buffer.length > 0 && ruleTokens.length > 0) {
      // close brace at rule level, e.g. a{--color:{color:red}<--
      serializedBuffer = buffer.join('');
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      propertyToken = null;
      ruleToken = ruleTokens.pop();
      newTokens = ruleToken[2];

      level = levels.pop();
      seekingValue = false;
      buffer = [];
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && buffer.length > 0 && buffer[0] == Marker.AT && ruleTokens.length > 0) {
      // close brace at rule level for at-rule, e.g. a{--color:{@apply(--other-color)}<--
      serializedBuffer = buffer.join('');
      ruleToken[1].push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      propertyToken = null;
      ruleToken = ruleTokens.pop();
      newTokens = ruleToken[2];

      level = levels.pop();
      seekingValue = false;
      buffer = [];
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && ruleTokens.length > 0) {
      // close brace at rule level after space, e.g. a{--color:{color:red }<--
      propertyToken = null;
      ruleToken = ruleTokens.pop();
      newTokens = ruleToken[2];

      level = levels.pop();
      seekingValue = false;
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && propertyToken && buffer.length > 0) {
      // close brace at rule level, e.g. a{color:red}<--
      serializedBuffer = buffer.join('');
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      propertyToken = null;
      ruleToken = ruleTokens.pop();
      newTokens = allTokens;

      level = levels.pop();
      seekingValue = false;
      buffer = [];
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && buffer.length > 0 && buffer[0] == Marker.AT) {
      // close brace after at-rule at rule level, e.g. a{@apply(--variable)}<--
      propertyToken = null;
      ruleToken = null;
      serializedBuffer = buffer.join('').trim();
      newTokens.push([Token.AT_RULE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      newTokens = allTokens;

      level = levels.pop();
      seekingValue = false;
      buffer = [];
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE && levels[levels.length - 1] == Level.RULE) {
      // close brace after a property block at rule level, e.g. a{--custom:{color:red;}<--
      propertyToken = null;
      ruleToken = ruleTokens.pop();
      newTokens = ruleToken[2];

      level = levels.pop();
      seekingValue = false;
      seekingPropertyBlockClosing = true;
      buffer = [];
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.RULE) {
      // close brace after a rule, e.g. a{color:red;}<--
      propertyToken = null;
      ruleToken = null;
      newTokens = allTokens;

      level = levels.pop();
      seekingValue = false;
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK && !isNested && position.index <= source.length - 1) {
      // stray close brace at block level, e.g. a{color:red}color:blue}<--
      externalContext.warnings.push('Unexpected \'}\' at ' + formatPosition([position.line, position.column, position.source]) + '.');
      buffer.push(character);
    } else if (character == Marker.CLOSE_CURLY_BRACKET && level == Level.BLOCK) {
      // close brace at block level, e.g. @media screen {...}<--
      break;
    } else if (character == Marker.OPEN_ROUND_BRACKET && level == Level.RULE && seekingValue) {
      // round open bracket, e.g. a{color:hsla(<--
      buffer.push(character);
      roundBracketLevel++;
    } else if (character == Marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue && roundBracketLevel == 1) {
      // round close bracket, e.g. a{color:hsla(0,0%,0%)<--
      buffer.push(character);
      serializedBuffer = buffer.join('').trim();
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

      roundBracketLevel--;
      buffer = [];
    } else if (character == Marker.CLOSE_ROUND_BRACKET && level == Level.RULE && seekingValue) {
      // round close bracket within other brackets, e.g. a{width:calc((10rem / 2)<--
      buffer.push(character);
      roundBracketLevel--;
    } else if (character == Marker.FORWARD_SLASH && source[position.index + 1] != Marker.ASTERISK && level == Level.RULE && seekingValue && buffer.length > 0) {
      // forward slash within a property, e.g. a{background:url(image.png) 0 0/<--
      serializedBuffer = buffer.join('').trim();
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);

      buffer = [];
    } else if (character == Marker.FORWARD_SLASH && source[position.index + 1] != Marker.ASTERISK && level == Level.RULE && seekingValue) {
      // forward slash within a property after space, e.g. a{background:url(image.png) 0 0 /<--
      propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);

      buffer = [];
    } else if (character == Marker.COMMA && level == Level.RULE && seekingValue && buffer.length > 0) {
      // comma within a property, e.g. a{background:url(image.png),<--
      serializedBuffer = buffer.join('').trim();
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);
      propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);

      buffer = [];
    } else if (character == Marker.COMMA && level == Level.RULE && seekingValue) {
      // comma within a property after space, e.g. a{background:url(image.png) ,<--
      propertyToken.push([Token.PROPERTY_VALUE, character, [[position.line, position.column, position.source]]]);

      buffer = [];
    } else if ((isSpace || (isNewLineNix && !isNewLineWin)) && level == Level.RULE && seekingValue && propertyToken && buffer.length > 0) {
      // space or *nix newline within property, e.g. a{margin:0 <--
      serializedBuffer = buffer.join('').trim();
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

      buffer = [];
    } else if (isNewLineWin && level == Level.RULE && seekingValue && propertyToken && buffer.length > 1) {
      // win newline within property, e.g. a{margin:0\r\n<--
      serializedBuffer = buffer.join('').trim();
      propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

      buffer = [];
    } else if (isNewLineWin && level == Level.RULE && seekingValue) {
      // win newline
      buffer = [];
    } else if (buffer.length == 1 && isNewLineWin) {
      // ignore windows newline which is composed of two characters
      buffer.pop();
    } else if (buffer.length > 0 || !isSpace && !isNewLineNix && !isNewLineWin) {
      // any character
      buffer.push(character);
    }

    wasEscaped = isEscaped;
    isEscaped = !wasEscaped && character == Marker.BACK_SLASH;
    wasCommentStart = isCommentStart;
    wasCommentEnd = isCommentEnd;

    position.line = (isNewLineWin || isNewLineNix) ? position.line + 1 : position.line;
    position.column = (isNewLineWin || isNewLineNix) ? 0 : position.column + 1;
  }

  if (seekingValue) {
    externalContext.warnings.push('Missing \'}\' at ' + formatPosition([position.line, position.column, position.source]) + '.');
  }

  if (seekingValue && buffer.length > 0) {
    serializedBuffer = buffer.join('').replace(TAIL_BROKEN_VALUE_PATTERN, '');
    propertyToken.push([Token.PROPERTY_VALUE, serializedBuffer, [originalMetadata(metadata, serializedBuffer, externalContext)]]);

    buffer = [];
  }

  if (buffer.length > 0) {
    externalContext.warnings.push('Invalid character(s) \'' + buffer.join('') + '\' at ' + formatPosition(metadata) + '. Ignoring.');
  }

  return allTokens;
}

function originalMetadata(metadata, value, externalContext, selectorFallbacks) {
  var source = metadata[2];

  return externalContext.inputSourceMapTracker.isTracking(source) ?
    externalContext.inputSourceMapTracker.originalPositionFor(metadata, value.length, selectorFallbacks) :
    metadata;
}

function tokenTypeFrom(buffer) {
  var isAtRule = buffer[0] == Marker.AT || buffer[0] == Marker.UNDERSCORE;
  var ruleWord = buffer.join('').split(RULE_WORD_SEPARATOR_PATTERN)[0];

  if (isAtRule && BLOCK_RULES.indexOf(ruleWord) > -1) {
    return Token.NESTED_BLOCK;
  } else if (isAtRule && AT_RULES.indexOf(ruleWord) > -1) {
    return Token.AT_RULE;
  } else if (isAtRule) {
    return Token.AT_RULE_BLOCK;
  } else {
    return Token.RULE;
  }
}

function tokenScopeFrom(tokenType) {
  if (tokenType == Token.RULE) {
    return Token.RULE_SCOPE;
  } else if (tokenType == Token.NESTED_BLOCK) {
    return Token.NESTED_BLOCK_SCOPE;
  } else if (tokenType == Token.AT_RULE_BLOCK) {
    return Token.AT_RULE_BLOCK_SCOPE;
  }
}

module.exports = tokenize;


text:
<!-- GWT Module for clientlibs -->
<module>
  <source path=""/>
</module>


text:
package com.github.swalffy.api;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public  abstract class ARepository <T extends AEntity> implements Serializable {

    protected List<T> repository;

    protected ARepository(){
        repository = new ArrayList<>();
    }

    public abstract boolean add(final String[] fields);

    public boolean add(final T entity) {
        if (!isFreeId(entity.getId())) {
            return false;
        }
        repository.add(entity);
        return true;
    }

    public boolean isFreeId(final Integer id) {
        for (final T entity : repository) {
            if (id.equals(entity.getId())) {
                return false;
            }
        }
        return true;
    }

    public T findById(final Integer id) {
        for (final T entity : repository) {
            if (id.equals(entity.getId()) ) {
                return entity;
            }
        }
        return null;
    }

    public Integer generateId() {
        Integer id = 0;
        while (!isFreeId(id)) {
            id++;
        }
        return id;
    }

    public List<T> getRepository(){
        final List<T> response = new ArrayList<>();
        for (final AEntity entity : repository) {
            response.add((T) entity);
        }
        return response;
    }

    public abstract boolean update(String[] fields);

    public String getCSV() {
        final StringBuilder sb = new StringBuilder();
        for (final T entity : repository) {
            sb.append(entity.getCSVLine());
        }
        return sb.toString();
    }
}


text:
from nbgr_x import app, build_sample_db
import os

if __name__ == '__main__':
    app_dir = os.path.realpath(os.path.dirname(__file__))
    database_path = os.path.join(app_dir, app.config['DATABASE_FILE'])
    if not os.path.exists(database_path):
        build_sample_db()
    app.run()


text:
![gump](http://a1.att.hudong.com/24/64/01300001178110130097643491565.jpg)

## OPENING

**hello**, **my name is forrest**, `forrest gump`. do you want chocolate, i could eat about a `_million_` and a half of these.

my mama always **said:**

> life was like a box of chocolates.
> you never know what you are going to get.

## SHOES

these must be  **comfortable shoes**, i bet you cloud walk all day in _shoes_ like **that** and not feel a thing.i wish i have [shoes](http://www.taobao.com/) like that.

my `mama` always said:

> there's an awful lot you can tell about a person by their shoes.
> where they're gone, where they've `been`.

## REVIEWS

<http://www.github.com/guoylyy/>

* i like this film.
	* good
	* nice
		* very nice
		* perfect

---
<http://www.github.com/guoylyy/>

1. i wish jenny can marry with gump early.
2. who is you daddy
	* i love it
	* wow lol

===

<http://www.github.com/guoylyy/>

+ i wish jenny can marry with gump early.

* * *

<http://www.github.com/guoylyy/>

```
import sys
improt os

print "i like this film"

```

* * *


text:
import Ember from 'ember';
import config from '../config/environment';
import IsBeforeHelper from 'ember-moment/helpers/is-before';

export default IsBeforeHelper.extend({
  globalAllowEmpty: !!Ember.get(config, 'moment.allowEmpty')
});


text:
<?php

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Event\LifecycleEventArgs;

/**
 * @group DDC-3033
 */
class DDC3033Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
    public function testIssue()
    {
        $this->_schemaTool->createSchema(array(
            $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC3033User'),
            $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC3033Product'),
        ));

        $user = new DDC3033User();
        $user->name = "Test User";
        $this->_em->persist($user);

        $user2 = new DDC3033User();
        $user2->name = "Test User 2";
        $this->_em->persist($user2);

        $product = new DDC3033Product();
        $product->title = "Test product";
        $product->buyers[] = $user;

        $this->_em->persist($product);
        $this->_em->flush();

        $product->title = "Test Change title";
        $product->buyers[] = $user2;

        $this->_em->persist($product);
        $this->_em->flush();

        $expect = array(
            'title' => array(
                0 => 'Test product',
                1 => 'Test Change title',
            ),
        );

        $this->assertEquals($expect, $product->changeSet);
    }
}

/**
 * @Table
 * @Entity @HasLifecycleCallbacks
 */
class DDC3033Product
{
    public $changeSet = array();

    /**
     * @var integer $id
     *
     * @Column(name="id", type="integer")
     * @Id
     * @GeneratedValue(strategy="AUTO")
     */
    public $id;

    /**
     * @var string $title
     *
     * @Column(name="title", type="string", length=255)
     */
    public $title;

    /**
     * @ManyToMany(targetEntity="DDC3033User")
     * @JoinTable(
     *   name="user_purchases_3033",
     *   joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")},
     *   inverseJoinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}
     * )
     */
    public $buyers;

    /**
     * Default constructor
     */
    public function __construct()
    {
        $this->buyers = new ArrayCollection();
    }

    /**
     * @PreUpdate
     */
    public function preUpdate(LifecycleEventArgs $eventArgs)
    {
    }

    /**
     * @PostUpdate
     */
    public function postUpdate(LifecycleEventArgs $eventArgs)
    {
        $em            = $eventArgs->getEntityManager();
        $uow           = $em->getUnitOfWork();
        $entity        = $eventArgs->getEntity();
        $classMetadata = $em->getClassMetadata(get_class($entity));

        $uow->computeChangeSet($classMetadata, $entity);
        $this->changeSet = $uow->getEntityChangeSet($entity);
    }
}

/**
 * @Table
 * @Entity @HasLifecycleCallbacks
 */
class DDC3033User
{
    /**
     * @var integer
     *
     * @Column(name="id", type="integer")
     * @Id
     * @GeneratedValue(strategy="AUTO")
     */
    public $id;

    /**
     * @var string
     *
     * @Column(name="title", type="string", length=255)
     */
    public $name;
}


text:
using System.Collections.Generic;

namespace Ganss.Text
{
    /// <summary>
    /// Provides extension methods.
    /// </summary>
    public static class Extensions
    {
        /// <summary>
        /// Determines whether this instance contains the specified words.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="words">The words.</param>
        /// <returns>The matched words.</returns>
        public static IEnumerable<WordMatch> Contains(this string text, IEnumerable<string> words)
        {
            return new AhoCorasick(words).Search(text);
        }

        /// <summary>
        /// Determines whether this instance contains the specified words.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="words">The words.</param>
        /// <returns>The matched words.</returns>
        public static IEnumerable<WordMatch> Contains(this string text, params string[] words)
        {
            return new AhoCorasick(words).Search(text);
        }

        /// <summary>
        /// Determines whether this instance contains the specified words.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="comparer">The comparer used to compare individual characters.</param>
        /// <param name="words">The words.</param>
        /// <returns>The matched words.</returns>
        public static IEnumerable<WordMatch> Contains(this string text, IEqualityComparer<char> comparer, IEnumerable<string> words)
        {
            return new AhoCorasick(comparer, words).Search(text);
        }

        /// <summary>
        /// Determines whether this instance contains the specified words.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="comparer">The comparer used to compare individual characters.</param>
        /// <param name="words">The words.</param>
        /// <returns>The matched words.</returns>
        public static IEnumerable<WordMatch> Contains(this string text, IEqualityComparer<char> comparer, params string[] words)
        {
            return new AhoCorasick(comparer, words).Search(text);
        }
    }
}


text:
import page from 'page';
import stableStringify from 'json-stable-stringify';
import { fromJS, is as isDeepEqual } from 'immutable';
import { omit, omitBy, isEmpty } from 'lodash';

import { hashDifferenceDeep } from './hash-utils';
import { storageSet } from './storage-utils';

import { getDefaultTopologyOptions, initialState as initialRootState } from '../reducers/root';

//
// page.js won't match the routes below if ":state" has a slash in it, so replace those before we
// load the state into the URL.
//
const SLASH = '/';
const SLASH_REPLACEMENT = '<SLASH>';
const PERCENT = '%';
const PERCENT_REPLACEMENT = '<PERCENT>';
export const STORAGE_STATE_KEY = 'scopeViewState';

export function encodeURL(url) {
  return url
    .replace(new RegExp(PERCENT, 'g'), PERCENT_REPLACEMENT)
    .replace(new RegExp(SLASH, 'g'), SLASH_REPLACEMENT);
}

export function decodeURL(url) {
  return decodeURIComponent(url.replace(new RegExp(SLASH_REPLACEMENT, 'g'), SLASH))
    .replace(new RegExp(PERCENT_REPLACEMENT, 'g'), PERCENT);
}

export function parseHashState(hash = window.location.hash) {
  const urlStateString = hash
    .replace('#!/state/', '')
    .replace('#!/', '') || '{}';
  return JSON.parse(decodeURL(urlStateString));
}

export function clearStoredViewState() {
  storageSet(STORAGE_STATE_KEY, '');
}

export function isStoreViewStateEnabled(state) {
  return state.get('storeViewState');
}

function shouldReplaceState(prevState, nextState) {
  // Opening a new terminal while an existing one is open.
  const terminalToTerminal = (prevState.controlPipe && nextState.controlPipe);
  // Closing a terminal.
  const closingTheTerminal = (prevState.controlPipe && !nextState.controlPipe);

  return terminalToTerminal || closingTheTerminal;
}

function omitDefaultValues(urlState) {
  // A couple of cases which require special handling because their URL state
  // default values might be in different format than their Redux defaults.
  if (!urlState.controlPipe) {
    urlState = omit(urlState, 'controlPipe');
  }
  if (isEmpty(urlState.nodeDetails)) {
    urlState = omit(urlState, 'nodeDetails');
  }
  if (isEmpty(urlState.topologyOptions)) {
    urlState = omit(urlState, 'topologyOptions');
  }

  // Omit all the fields which match their initial Redux state values.
  return omitBy(urlState, (value, key) => (
    isDeepEqual(fromJS(value), initialRootState.get(key))
  ));
}

export function getUrlState(state) {
  const cp = state.get('controlPipes').last();
  const nodeDetails = state.get('nodeDetails').toIndexedSeq().map(details => ({
    id: details.id, topologyId: details.topologyId
  }));
  // Compress the topologyOptions hash by removing all the default options, to make
  // the Scope state string smaller. The default options will always be used as a
  // fallback so they don't need to be explicitly mentioned in the state.
  const topologyOptionsDiff = hashDifferenceDeep(
    state.get('topologyOptions').toJS(),
    getDefaultTopologyOptions(state).toJS(),
  );

  const urlState = {
    contrastMode: state.get('contrastMode'),
    controlPipe: cp ? cp.toJS() : null,
    gridSortedBy: state.get('gridSortedBy'),
    gridSortedDesc: state.get('gridSortedDesc'),
    nodeDetails: nodeDetails.toJS(),
    pausedAt: state.get('pausedAt'),
    pinnedMetricType: state.get('pinnedMetricType'),
    pinnedSearches: state.get('pinnedSearches').toJS(),
    searchQuery: state.get('searchQuery'),
    selectedNodeId: state.get('selectedNodeId'),
    topologyId: state.get('currentTopologyId'),
    topologyOptions: topologyOptionsDiff,
    topologyViewMode: state.get('topologyViewMode'),
  };

  if (state.get('showingNetworks')) {
    urlState.showingNetworks = true;
    if (state.get('pinnedNetwork')) {
      urlState.pinnedNetwork = state.get('pinnedNetwork');
    }
  }

  // We can omit all the fields whose values correspond to their Redux initial
  // state, as that state will be used as fallback anyway when entering routes.
  return omitDefaultValues(urlState);
}

export function updateRoute(getState) {
  const state = getUrlState(getState());
  const prevState = parseHashState();
  const dispatch = false;

  const stateUrl = encodeURL(stableStringify(state));
  const prevStateUrl = encodeURL(stableStringify(prevState));
  if (stateUrl === prevStateUrl) return;

  // back up state in storage as well
  if (isStoreViewStateEnabled(getState())) {
    storageSet(STORAGE_STATE_KEY, stateUrl);
  }

  if (shouldReplaceState(prevState, state)) {
    // Replace the top of the history rather than pushing on a new item.
    page.replace(`/state/${stateUrl}`, state, dispatch);
  } else {
    page.show(`/state/${stateUrl}`, state, dispatch);
  }
}


text:
TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

    gem 'sprockets-translate'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sprockets-translate

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
import type { HelixEventSubSubscription } from '@twurple/api';
import { rtfm } from '@twurple/common';
import type { EventSubChannelFollowEventData } from '../events/EventSubChannelFollowEvent';
import { EventSubChannelFollowEvent } from '../events/EventSubChannelFollowEvent';
import type { EventSubBase } from '../EventSubBase';
import { EventSubSubscription } from './EventSubSubscription';

/**
 * @private
 */
@rtfm('eventsub', 'EventSubSubscription')
export class EventSubChannelFollowSubscription extends EventSubSubscription<EventSubChannelFollowEvent> {
	constructor(
		handler: (data: EventSubChannelFollowEvent) => void,
		client: EventSubBase,
		private readonly _userId: string
	) {
		super(handler, client);
	}

	get id(): string {
		return `channel.follow.${this._userId}`;
	}

	protected transformData(data: EventSubChannelFollowEventData): EventSubChannelFollowEvent {
		return new EventSubChannelFollowEvent(data, this._client._apiClient);
	}

	protected async _subscribe(): Promise<HelixEventSubSubscription> {
		return await this._client._apiClient.eventSub.subscribeToChannelFollowEvents(
			this._userId,
			await this._getTransportOptions()
		);
	}
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>io.ebean.event Class Hierarchy (ebean 11.35.3 API)</title>
<meta name="date" content="2019-03-05">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package io.ebean.event

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

io.ebean.event.AbstractBeanPersistListener (implements io.ebean.event.BeanPersistListener)

io.ebean.event.BeanPersistAdapter (implements io.ebean.event.BeanPersistController)

io.ebean.event.ServletContextListener (implements javax.servlet.ServletContextListener)

Interface Hierarchy

io.ebean.event.BeanDeleteIdRequest

io.ebean.event.BeanFindController

io.ebean.event.BeanPersistController

io.ebean.event.BeanPersistListener

io.ebean.event.BeanPersistRequest<T>

io.ebean.event.BeanPostConstructListener

io.ebean.event.BeanPostLoad

io.ebean.event.BeanQueryAdapter

io.ebean.event.BeanQueryRequest<T>

io.ebean.event.BulkTableEvent

io.ebean.event.BulkTableEventListener

io.ebean.event.ServerConfigStartup

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2019. All rights reserved.


text:
<!doctype html>

		<title>LCS 2.0</title>
		<link href="/style/bootstrap.min.css" rel="stylesheet">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link href='http://fonts.googleapis.com/css?family=Roboto:200,500,300italic,700,400,600' rel='stylesheet' type='text/css'>

		<meta charset="UTF-8">
		<link rel="icon" type="image/png" href="/images/favicon.png">

		<link rel="stylesheet" href="style/style.css">

					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
						Toggle navigation

					</button>

						<li class="<?= ($active==1) ? "active" : "" ?>">Accueil

						<li class="<?= ($active==2) ? "active" : "" ?>">Mon compte


text:
@interface AdvancedSettingsSigninCoordinator : SigninCoordinator

- (instancetype)initWithBaseViewController:(UIViewController*)viewController
                                   browser:(Browser*)browser NS_UNAVAILABLE;

// Designated initializer.
// `signinState` provides the original user sign-in state before starting the
// sign-in flow.
- (instancetype)initWithBaseViewController:(UIViewController*)viewController
                                   browser:(Browser*)browser
                               signinState:(IdentitySigninState)signinState
    NS_DESIGNATED_INITIALIZER;

@end

#endif  // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_ADVANCED_SETTINGS_SIGNIN_ADVANCED_SETTINGS_SIGNIN_COORDINATOR_H_


text:
namespace YAF.Pages {

    public partial class im_xmpp {

        /// <summary>
        /// PageLinks control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Controls.PageLinks PageLinks;

        /// <summary>
        /// LocalizedLabel1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Controls.LocalizedLabel LocalizedLabel1;

        /// <summary>
        /// NotifyLabel control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label NotifyLabel;

        /// <summary>
        /// SmartScroller1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Controls.SmartScroller SmartScroller1;
    }
}


text:
Selftaught
==========

A tool, designed to aid people as they learn a new language. It keeps track of new words that the student encounters and makes sure they end up in their active vocabulary. It can make the student do different examinations, compare scores with other users and use different motivation techniques to achive its goal - a more fun and efficient way to learn a language.

AppHarbor link - http://selftaught.apphb.com/


text:
<?php //-->

class Eden_Core_Tests_Core_FactoryTest extends \PHPUnit_Framework_TestCase
{

    public function testArgument()
    {

        $class = eden('core')->argument();
        $this->assertInstanceOf('Eden\\Core\\Argument', $class);
    }

    public function testEvent()
    {

        $class = eden('core')->event();
        $this->assertInstanceOf('Eden\\Core\\Event', $class);
    }

    public function testLoader()
    {

        $class = eden('core')->loader();
        $this->assertInstanceOf('Eden\\Core\\Loader', $class);
    }

    public function testRoute()
    {

        $class = eden('core')->route();
        $this->assertInstanceOf('Eden\\Core\\Route', $class);
    }
}


text:
section-type: latest-post
---


text:
using System.Net;

namespace GeoToast.Infrastructure.Services
{
    public interface IIPAddressService
    {
        IPAddress GetRequestIpAddress();
    }
}


text:
package com.helger.photon.uictrls.bloodhound;

import java.util.List;

import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.helger.commons.ValueEnforcer;
import com.helger.commons.annotation.Nonempty;
import com.helger.commons.annotation.ReturnsMutableCopy;
import com.helger.commons.collection.CollectionHelper;
import com.helger.commons.collection.impl.ICommonsList;
import com.helger.commons.lang.ICloneable;
import com.helger.commons.string.ToStringGenerator;
import com.helger.html.jscode.IJSExpression;
import com.helger.html.jscode.JSAnonymousFunction;
import com.helger.html.jscode.JSArray;
import com.helger.html.jscode.JSAssocArray;
import com.helger.html.jscode.JSFieldRef;
import com.helger.html.jscode.JSReturn;
import com.helger.html.jscode.JSVar;

@NotThreadSafe
public class BloodhoundOptions implements ICloneable <BloodhoundOptions>
{
  public static final String JSON_DATUM_TOKENIZER = "datumTokenizer";
  public static final String JSON_QUERY_TOKENIZER = "queryTokenizer";
  public static final String JSON_LIMIT = "limit";
  public static final String JSON_DUP_DETECTOR = "dupDetector";
  public static final String JSON_SORTER = "sorter";
  public static final String JSON_LOCAL = "local";
  public static final String JSON_PREFETCH = "prefetch";
  public static final String JSON_REMOTE = "remote";

  public static final int DEFAULT_LIMIT = 5;

  private static final Logger LOGGER = LoggerFactory.getLogger (BloodhoundOptions.class);

  private IJSExpression m_aDatumTokenizer;
  private IJSExpression m_aQueryTokenizer;
  private int m_nLimit = DEFAULT_LIMIT;
  private IJSExpression m_aDupDetector;
  private IJSExpression m_aSorter;
  private ICommonsList <? extends BloodhoundDatum> m_aLocal;
  private BloodhoundPrefetch m_aPrefetch;
  private BloodhoundRemote m_aRemote;

  public BloodhoundOptions ()
  {}

  public BloodhoundOptions (@Nonnull final BloodhoundOptions aOther)
  {
    ValueEnforcer.notNull (aOther, "Other");
    m_aDatumTokenizer = aOther.m_aDatumTokenizer;
    m_aQueryTokenizer = aOther.m_aQueryTokenizer;
    m_nLimit = aOther.m_nLimit;
    m_aDupDetector = aOther.m_aDupDetector;
    m_aSorter = aOther.m_aSorter;
    m_aLocal = aOther.m_aLocal == null ? null : aOther.m_aLocal.getClone ();
    m_aPrefetch = aOther.m_aPrefetch == null ? null : aOther.m_aPrefetch.getClone ();
    m_aRemote = aOther.m_aRemote == null ? null : aOther.m_aRemote.getClone ();
  }

  /**
   * @return A function with the signature (datum) that transforms a datum into
   *         an array of string tokens. Required.
   */
  @Nullable
  public IJSExpression getDatumTokenizer ()
  {
    return m_aDatumTokenizer;
  }

  @Nonnull
  public BloodhoundOptions setDatumTokenizer (@Nullable final IJSExpression aDatumTokenizer)
  {
    m_aDatumTokenizer = aDatumTokenizer;
    return this;
  }

  @Nonnull
  private BloodhoundOptions _setSpecialDatumTokenizer (@Nonnull final JSFieldRef aFieldRef,
                                                       @Nonnull @Nonempty final String sDatumValueFieldName)
  {
    ValueEnforcer.notEmpty (sDatumValueFieldName, "DatumValueFieldName");
    final JSVar aVarDatum = new JSVar ("d");
    return setDatumTokenizer (new JSAnonymousFunction (aVarDatum, aFieldRef.invoke ().arg (aVarDatum.ref (sDatumValueFieldName))));
  }

  @Nonnull
  public BloodhoundOptions setDatumTokenizerNonword (@Nonnull @Nonempty final String sDatumValueFieldName)
  {
    return _setSpecialDatumTokenizer (BloodhoundJS.bloodhoundTokenizersNonword (), sDatumValueFieldName);
  }

  @Nonnull
  public BloodhoundOptions setDatumTokenizerWhitespace (@Nonnull @Nonempty final String sDatumValueFieldName)
  {
    return _setSpecialDatumTokenizer (BloodhoundJS.bloodhoundTokenizersWhitespace (), sDatumValueFieldName);
  }

  /**
   * Set a datum tokenizer that uses pre-tokenized tokens (e.g. from remote) as
   * contained in the datum. It therefore uses the field
   * {@link BloodhoundDatum#JSON_TOKENS} of each datum.
   *
   * @return this
   */
  @Nonnull
  public BloodhoundOptions setDatumTokenizerPreTokenized ()
  {
    final JSVar aVarDatum = new JSVar ("d");
    return setDatumTokenizer (new JSAnonymousFunction (aVarDatum, new JSReturn (aVarDatum.ref (BloodhoundDatum.JSON_TOKENS))));
  }

  /**
   * @return A function with the signature (query) that transforms a query into
   *         an array of string tokens. Required.
   */
  @Nullable
  public IJSExpression getQueryTokenizer ()
  {
    return m_aQueryTokenizer;
  }

  @Nonnull
  public BloodhoundOptions setQueryTokenizer (@Nullable final IJSExpression aQueryTokenizer)
  {
    m_aQueryTokenizer = aQueryTokenizer;
    return this;
  }

  @Nonnull
  public BloodhoundOptions setQueryTokenizerNonword ()
  {
    return setQueryTokenizer (BloodhoundJS.bloodhoundTokenizersNonword ());
  }

  @Nonnull
  public BloodhoundOptions setQueryTokenizerWhitespace ()
  {
    return setQueryTokenizer (BloodhoundJS.bloodhoundTokenizersWhitespace ());
  }

  /**
   * @return The max number of suggestions to return from Bloodhound#get. If not
   *         reached, the data source will attempt to backfill the suggestions
   *         from remote.
   */
  @Nonnegative
  public int getLimit ()
  {
    return m_nLimit;
  }

  @Nonnull
  public BloodhoundOptions setLimit (@Nonnegative final int nLimit)
  {
    m_nLimit = ValueEnforcer.isGT0 (nLimit, "Limit");
    return this;
  }

  /**
   * @return If set, this is expected to be a function with the signature
   *         (remoteMatch, localMatch) that returns true if the
   *         datums are duplicates or false otherwise. If not set,
   *         duplicate detection will not be performed.
   */
  @Nullable
  public IJSExpression getDupDetector ()
  {
    return m_aDupDetector;
  }

  @Nonnull
  public BloodhoundOptions setDupDetector (@Nullable final IJSExpression aDupDetector)
  {
    m_aDupDetector = aDupDetector;
    return this;
  }

  /**
   *

   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
   *

   *
   * @return A compare function used to sort matched datums for a given query.
   */
  @Nullable
  public IJSExpression getSorter ()
  {
    return m_aSorter;
  }

  @Nonnull
  public BloodhoundOptions setSorter (@Nullable final IJSExpression aSorter)
  {
    m_aSorter = aSorter;
    return this;
  }

  @Nullable
  @ReturnsMutableCopy
  public ICommonsList <? extends BloodhoundDatum> getLocal ()
  {
    return m_aLocal == null ? null : m_aLocal.getClone ();
  }

  @Nonnull
  public BloodhoundOptions setLocal (@Nullable final BloodhoundDatum... aLocal)
  {
    return setLocal (aLocal == null ? null : CollectionHelper.newList (aLocal));
  }

  @Nonnull
  public BloodhoundOptions setLocal (@Nullable final List <? extends BloodhoundDatum> aLocal)
  {
    m_aLocal = aLocal == null ? null : CollectionHelper.newList (aLocal);
    return this;
  }

  @Nullable
  public BloodhoundPrefetch getPrefetch ()
  {
    return m_aPrefetch;
  }

  @Nonnull
  public BloodhoundOptions setPrefetch (@Nullable final BloodhoundPrefetch aPrefetch)
  {
    m_aPrefetch = aPrefetch;
    return this;
  }

  @Nullable
  public BloodhoundRemote getRemote ()
  {
    return m_aRemote;
  }

  @Nonnull
  public BloodhoundOptions setRemote (@Nullable final BloodhoundRemote aRemote)
  {
    m_aRemote = aRemote;
    return this;
  }

  @Nonnull
  @ReturnsMutableCopy
  public JSAssocArray getAsJSObject ()
  {
    if (m_aDatumTokenizer == null)
      LOGGER.warn ("No datumTokenizer present!");
    if (m_aQueryTokenizer == null)
      LOGGER.warn ("No queryTokenizer present!");
    if (m_aLocal == null && m_aPrefetch == null && m_aRemote == null)
      LOGGER.warn ("Either local, prefetch or remote must be set!");

    final JSAssocArray ret = new JSAssocArray ();
    if (m_aDatumTokenizer != null)
      ret.add (JSON_DATUM_TOKENIZER, m_aDatumTokenizer);
    if (m_aQueryTokenizer != null)
      ret.add (JSON_QUERY_TOKENIZER, m_aQueryTokenizer);
    if (m_nLimit != DEFAULT_LIMIT)
      ret.add (JSON_LIMIT, m_nLimit);
    if (m_aDupDetector != null)
      ret.add (JSON_DUP_DETECTOR, m_aDupDetector);
    if (m_aSorter != null)
      ret.add (JSON_SORTER, m_aSorter);
    if (m_aLocal != null)
    {
      final JSArray aLocal = new JSArray ();
      for (final BloodhoundDatum aDatum : m_aLocal)
        aLocal.add (aDatum.getAsJson ());
      ret.add (JSON_LOCAL, aLocal);
    }
    if (m_aPrefetch != null)
      ret.add (JSON_PREFETCH, m_aPrefetch.getAsJSObject ());
    if (m_aRemote != null)
      ret.add (JSON_REMOTE, m_aRemote.getAsJSObject ());
    return ret;
  }

  @Nonnull
  public BloodhoundOptions getClone ()
  {
    return new BloodhoundOptions (this);
  }

  @Override
  public String toString ()
  {
    return new ToStringGenerator (this).appendIfNotNull ("datumTokenizer", m_aDatumTokenizer)
                                       .appendIfNotNull ("queryTokenizer", m_aQueryTokenizer)
                                       .append ("limit", m_nLimit)
                                       .appendIfNotNull ("dupDetector", m_aDupDetector)
                                       .appendIfNotNull ("sorter", m_aSorter)
                                       .appendIfNotNull ("local", m_aLocal)
                                       .appendIfNotNull ("prefetch", m_aPrefetch)
                                       .appendIfNotNull ("remote", m_aRemote)
                                       .getToString ();
  }
}


text:
require 'spec_helper'

describe Stage do
  it { should validate_presence_of(:name) }
  it { should validate_presence_of(:full_name) }
  it { should validate_presence_of(:description) }
  it { should validate_presence_of(:deadline) }
  it { should validate_presence_of(:committee) }

  describe 'name' do

    subject { build(:stage) }

    it 'should be unique within Committee' do
      subject.save
      duplicate = subject.dup
      duplicate.name.upcase!
      expect(duplicate).to_not accept_values(:name, subject.name)
      expect(duplicate).to_not be_valid
    end

    it 'can be same for different Committees' do
      subject.save
      duplicate = subject.dup
      duplicate.committee = create(:committee)
      expect(duplicate).to accept_values(:name, subject.name)
      expect(duplicate).to be_valid
    end
  end

end


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.network.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Start packet capture parameters on virtual network gateway. */
@Fluent
public final class VpnPacketCaptureStartParameters {
    /*
     * Start Packet capture parameters.
     */
    @JsonProperty(value = "filterData")
    private String filterData;

    /** Creates an instance of VpnPacketCaptureStartParameters class. */
    public VpnPacketCaptureStartParameters() {
    }

    /**
     * Get the filterData property: Start Packet capture parameters.
     *
     * @return the filterData value.
     */
    public String filterData() {
        return this.filterData;
    }

    /**
     * Set the filterData property: Start Packet capture parameters.
     *
     * @param filterData the filterData value to set.
     * @return the VpnPacketCaptureStartParameters object itself.
     */
    public VpnPacketCaptureStartParameters withFilterData(String filterData) {
        this.filterData = filterData;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}


text:
import unittest

import utils

class TestUtils(unittest.TestCase):
    def test_check_amount_valid(self):
        self.assertEqual(True, utils.check_amount_valid(1))
        self.assertEqual(True, utils.check_amount_valid(10))
        self.assertEqual(False, utils.check_amount_valid(0.1))
        self.assertEqual(False, utils.check_amount_valid(-1))
        self.assertEqual(True, utils.check_amount_valid("1"))
        self.assertEqual(True, utils.check_amount_valid("10"))
        self.assertEqual(False, utils.check_amount_valid("0.1"))
        self.assertEqual(False, utils.check_amount_valid("-1"))

if __name__ == '__main__':
    unittest.main()