----------------
505112
function() {
  // set the emitter
  events.EventEmitter.call(this);
  this.jobs = {};
  this.taskQ = new task.TaskQ();
  this.maxTasks = os.cpus().length;
  winston.info(_pkgname + 'max workers['+this.maxTasks+']');
}
1009299
public function join($element)
	{
		if($element->slave!==null)
			$this->join($element->slave);
		if(!empty($element->relation->select))
			$this->selects[]=$element->getColumnSelect($element->relation->select);
		$this->conditions[]=$element->relation->condition;
		$this->orders[]=$element->relation->order;
		$this->joins[]=$element->getJoinCondition();
		$this->joins[]=$element->relation->join;
		$this->groups[]=$element->relation->group;
		$this->havings[]=$element->relation->having;

		if(is_array($element->relation->params))
		{
			if(is_array($this->params))
				$this->params=array_merge($this->params,$element->relation->params);
			else
				$this->params=$element->relation->params;
		}
		$this->elements[$element->id]=true;
	}
948396
public function exists(){
		if($this->from_db)
		{
            foreach ($this->identifiers as $id) {
                if(!isset($this->properties[$id]))
                    return false;
            }
            return true;
       }
       return false;
    }
367409
private void onEnd()
   {
      long result = System.currentTimeMillis() - currentTime.get().poll();
      times.incrementAndGet();
      if (result < min.get())
      {
         min.set(result);
      }
      if (max.get() < result)
      {
         max.set(result);
      }
      total.addAndGet(result);
   }
1350673
public function decrement()
    {
        if (0 >= --$this->listeners && null !== $this->observable) {
            $this->observable->dispose(new AutoDisposedException());
        }
    }
747808
public function init(): void
    {
        parent::init();

        if ($this->default !== '' && $this->default !== null && !is_array($this->default)) {
            try {
                $default = Json::decode($this->default);

                if (is_array($default)) {
                    $this->default = $default;
                }
            } catch (InvalidArgumentException $exception) {}
        }
    }
798330
public function notBetween()
    {
        $this->failIf(
            $this->data[0] >= $this->data[1] &&
            $this->data[0] <= $this->data[2]
        );
    }
1136189
function(){
        while(this.numPairs>0){
            var pair=this.pairs[--this.numPairs];
            pair.shape1=null;
            pair.shape2=null;
        }
        this.numPairChecks=0;
        this.collectPairs();
    }
1033482
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        try {
            $integer_value = $this->getNumericValue($this->value);

            if ($integer_value === null) {
                $this->addMessage($this->getValidationMessage('integer'));
            } else {
                $this->value = $integer_value;
            }
        } catch (SwatIntegerOverflowException $e) {
            if ($e->getSign() > 0) {
                $this->addMessage(
                    $this->getValidationMessage('integer-maximum')
                );
            } else {
                $this->addMessage(
                    $this->getValidationMessage('integer-minimum')
                );
            }

            $integer_value = null;
        }
    }
359433
public function commit()
    {
        if ($this->_hasChanges) {
            $this->_getIndexWriter()->commit();

            $this->_updateDocCount();

            $this->_hasChanges = false;
        }
    }
645207
public function save()
    {
        if ($this->_isSaved) {
            $this->update($this->id);
        } else {
            $this->id = $this->insert();
            $this->_isSaved = true;
        }
    }
205372
public function execute()
    {
        $data = $this->getData();

        /*
         * Step 1) Apply sorting
         *
         * @see http://php.net/manual/de/function.array-multisort.php
         * @see example number 3
         */
        if (!empty($this->getSortConditions())) {
            $data = $this->sortArrayMultiple($data, $this->getSortConditions());
        }

        /*
         * Step 2) Apply filters
         */
        foreach ($this->getFilters() as $filter) {
            /* @var $filter \ZfcDatagrid\Filter */
            if ($filter->isColumnFilter() === true) {
                $data = array_filter($data, [
                    new PhpArray\Filter($filter),
                    'applyFilter',
                ]);
            }
        }

        /**
         * Step 3) Remove unneeded columns.
         *
         * @todo ? Better performance or let it be?
         */
        $selectedColumns = [];
        foreach ($this->getColumns() as $col) {
            if (! $col instanceof Column\Select) {
                continue;
            }

            $colString = $col->getSelectPart1();
            if ($col->getSelectPart2() != '') {
                $colString = $col->getSelectPart1().'_'.$col->getSelectPart2();
            }

            $selectedColumns[] = $colString;
        }

        foreach ($data as &$row) {
            foreach ($row as $keyRowCol => $rowCol) {
                if (! in_array($keyRowCol, $selectedColumns)) {
                    unset($row[$keyRowCol]);
                }
            }
        }

        /*
         * Step 4) Pagination
         */
        $this->setPaginatorAdapter(new PaginatorAdapter($data));
    }
1341358
public function init() {

		parent::init();

		$this->countryService	= Yii::$app->factory->get( 'countryService' );
		$this->provinceService 	= Yii::$app->factory->get( 'provinceService' );
		$this->regionService 	= Yii::$app->factory->get( 'regionService' );
		$this->addressService	= Yii::$app->factory->get( 'addressService' );
	}
1374179
public function process()
    {
        parent::process();

        if ($this->value === null) {
            return;
        }

        $float_value = $this->getNumericValue($this->value);

        if ($float_value === null) {
            $this->addMessage($this->getValidationMessage('float'));
        } else {
            $this->value = $float_value;
        }
    }
3113
public function execute($n)
    {
        $stack = array();
        $i = 0;
        $total = count($this->tokens);
        while ($i < $total) {
            $next = $this->tokens[$i];
            $i++;
            if ($next[0] === 'var') {
                $stack[] = $n;
                continue;
            } elseif ($next[0] === 'value') {
                $stack[] = $next[1];
                continue;
            }

            // Only operators left.
            switch ($next[1]) {
                case '%':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 % $v2;
                    break;

                case '||':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 || $v2;
                    break;

                case '&&':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 && $v2;
                    break;

                case '<':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 < $v2;
                    break;

                case '<=':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 <= $v2;
                    break;

                case '>':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 > $v2;
                    break;

                case '>=':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 >= $v2;
                    break;

                case '!=':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 != $v2;
                    break;

                case '==':
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 == $v2;
                    break;

                case '?:':
                    $v3 = array_pop($stack);
                    $v2 = array_pop($stack);
                    $v1 = array_pop($stack);
                    $stack[] = $v1 ? $v2 : $v3;
                    break;

                default:
                    throw new Exception(sprintf('Unknown operator "%s"', $next[1]));
            }
        }

        if (count($stack) !== 1) {
            throw new Exception('Too many values remaining on the stack');
        }

        return (int) $stack[0];
    }
1006281
public function init()
    {
        parent::init();
        if ($this->user !== false) {
            $this->user = Instance::ensure($this->user, User::class);
        }
    }
1142015
public function init()
    {
        parent::init();

        if (!$this->our_field) {
            $this->our_field = $this->link;
        }

        if (!$this->owner->hasField($this->our_field)) {
            $this->owner->addField($this->our_field, [
                'type'              => $this->type,
                'reference'         => $this,
                'system'            => $this->system,
                'join'              => $this->join,
                'default'           => $this->default,
                'never_persist'     => $this->never_persist,
                'read_only'         => $this->read_only,
                'caption'           => $this->caption,
                'ui'                => $this->ui,
                'mandatory'         => $this->mandatory,
                'required'          => $this->required,
                'typecast'          => $this->typecast,
                'serialize'         => $this->serialize,
                'persist_format'    => $this->persist_format,
                'persist_timezone'  => $this->persist_timezone,
                'dateTimeClass'     => $this->dateTimeClass,
                'dateTimeZoneClass' => $this->dateTimeZoneClass,
            ]);
        }
    }