*****************************************************************************************************************
486904
public function replicate($src, $dst, $create = false, $continuous = false, $filter = null, array $params = array()) {
    $post = (object)array(
      'source'        => $this->_validator()->dbUrl($src),
      'target'        => $this->_validator()->dbUrl($dst),
      'continuous'    => $this->_validator()->boolean($continuous),
      'create_target' => $this->_validator()->boolean($create),
    );
    if (!empty($filter)) {
      $post->filter = $this->_validator()->filter($filter);
      if (!empty($params)) {
        $post->filterQueryParams = $params;
      }
    }
    return $this->_call(__FUNCTION__, self::METHOD_POST, '_replicate', array(), $post);
  }
6957
private void init() {
        quantiles = new double[data.length][8];
        for (int i = 0; i < data.length; i++) {
            int n = data[i].length;
            Arrays.sort(data[i]);
            quantiles[i][1] = data[i][n / 4];
            quantiles[i][2] = data[i][n / 2];
            quantiles[i][3] = data[i][3 * n / 4];
            quantiles[i][5] = quantiles[i][3] - quantiles[i][1]; // interquartile range
            quantiles[i][6] = quantiles[i][1] - 1.5 * quantiles[i][5];
            quantiles[i][7] = quantiles[i][3] + 1.5 * quantiles[i][5];
            quantiles[i][0] = quantiles[i][6] < data[i][0] ? data[i][0] : quantiles[i][6];
            quantiles[i][4] = quantiles[i][7] > data[i][data[i].length - 1] ? data[i][data[i].length - 1] : quantiles[i][7];
        }
    }
152362
public function update()
    {
        if (!$this->exists()) {
            throw new \RuntimeException('Cannot update a table that doesn\'t exist!');
        }

        // update table
        foreach ($this->getPendingColumns() as $column) {
            $this->getAdapter()->addColumn($this, $column);
        }

        foreach ($this->getIndexes() as $index) {
            $this->getAdapter()->addIndex($this, $index);
        }

        foreach ($this->getForeignKeys() as $foreignKey) {
            $this->getAdapter()->addForeignKey($this, $foreignKey);
        }

        $this->saveData();
        $this->reset(); // reset pending changes
    }
555672
function(data_source) {

		this.guid = Lava.guid++;

		if (data_source) {

			var count = 0,
				i = 0,
				name;

			if (Array.isArray(data_source)) {

				for (count = data_source.length; i < count; i++) {

					this._push(this._uid++, data_source[i], null);

				}

			} else if (data_source.isCollection) {

				this._data_names = data_source.getNames();
				this._data_values = data_source.getValues();
				for (count = this._data_values.length; i < count; i++) {

					this._data_uids.push(this._uid++);

				}

			} else {

				if (data_source.isProperties) {

					data_source = data_source.getProperties();

				}

				for (name in data_source) {

					this._push(this._uid++, data_source[name], name);

				}

			}

			this._count = this._data_uids.length;

		}

	}
1109121
public function validate($order, Constraint $constraint): void
    {
        /** @var OrderInterface $order */
        Assert::isInstanceOf($order, OrderInterface::class);

        /** @var OrderProductEligibility $constraint */
        Assert::isInstanceOf($constraint, OrderProductEligibility::class);

        /** @var OrderItemInterface[] $orderItems */
        $orderItems = $order->getItems();

        foreach ($orderItems as $orderItem) {
            if (!$orderItem->getProduct()->isEnabled()) {
                $this->context->addViolation(
                    $constraint->message,
                    ['%productName%' => $orderItem->getProduct()->getName()]
                );
            }
        }
    }
893009
private function doBeforeCompileLaziness(): void
	{
		$builder = $this->getContainerBuilder();
		$dispatcher = $builder->getDefinition($this->prefix('dispatcher'));

		$subscribers = $builder->findByType(EventSubscriberInterface::class);
		foreach ($subscribers as $name => $subscriber) {
			$events = call_user_func([$subscriber->getEntity(), 'getSubscribedEvents']);

			/**
			 * ['eventName' => 'methodName']
			 * ['eventName' => ['methodName', $priority]]
			 * ['eventName' => [['methodName1', $priority], ['methodName2']]]
			 */
			foreach ($events as $event => $args) {
				if (is_string($args)) {
					if (!method_exists((string) $subscriber->getType(), $args)) {
						throw new ServiceCreationException(sprintf('Event listener %s does not have callable method %s', $subscriber->getType(), $args));
					}

					$dispatcher->addSetup('addSubscriberLazy', [$event, $name]);
				} elseif (is_string($args[0])) {
					if (!method_exists((string) $subscriber->getType(), $args[0])) {
						throw new ServiceCreationException(sprintf('Event listener %s does not have callable method %s', $subscriber->getType(), $args[0]));
					}

					$dispatcher->addSetup('addSubscriberLazy', [$event, $name]);
				} else {
					foreach ($args as $arg) {
						if (!method_exists((string) $subscriber->getType(), $arg[0])) {
							throw new ServiceCreationException(sprintf('Event listener %s does not have callable method %s', $subscriber->getType(), $arg[0]));
						}

						$dispatcher->addSetup('addSubscriberLazy', [$event, $name]);
					}
				}
			}
		}
	}
918945
public function process()
    {
        parent::process();

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

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

        if (!$this->validateEmailAddress()) {
            $this->addMessage($this->getValidationMessage('email'));
        }
    }
163931
public function initialize()
    {
        parent::initialize();
        $this->select = new SelectClause($this);
        $this->from   = new FromClause($this);
        $this->group  = new GroupClause($this);
    }
401588
public function Bind()
	{
		if ( ! is_null( $this->_childs ) )
		{
			foreach ( $this->_childs as $node)
			{
				$node->Bind();
			}
		}
	}
1174745
public function onBeforeWrite()
    {
        if (!$this->isInDB()) {
            $this->CreatorID = Member::currentUserID();
        }

        if (!$this->VersionNumber) {
            $versions = DataObject::get(
                'FileVersion', sprintf('"FileID" = %d', $this->FileID)
            );

            if ($versions) {
                $this->VersionNumber = $versions->Count() + 1;
            } else {
                $this->VersionNumber = 1;
            }
        }

        if (!$this->Filename) {
            $this->Filename = $this->saveCurrentVersion();
        }

        parent::onBeforeWrite();
    }
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];
    }
1215301
function(scope){
    var memberMap = this.members_;
    var rule = this.rule;
    var sourceCount = this.sources.length;
    var inserted = [];
    var deleted = [];
    var memberCounter;
    var isMember;
    var delta;

    if (!scope)
      scope = memberMap;

    for (var objectId in scope)
    {
      memberCounter = memberMap[objectId];
      isMember = sourceCount && memberCounter.count && rule(memberCounter.count, sourceCount);

      if (isMember != memberCounter.isMember)
      {
        if (isMember)
        {
          // not in items -> insert
          memberCounter.isMember = true;
          inserted.push(memberCounter.object);
        }
        else
        {
          // already in items -> delete
          memberCounter.isMember = false;
          deleted.push(memberCounter.object);
        }
      }

      if (memberCounter.count == 0)
        delete memberMap[objectId];
    }

    // fire event if delta found
    if (delta = getDelta(inserted, deleted))
      this.emit_itemsChanged(delta);

    return delta;
  }
1008357
public function next()
    {
        parent::next();
        if ($this->_validValues) {
            $this->_values->next();
        }
        $this->_validValues = $this->_values->valid();
    }
341406
public final void sample()
  {
    long sum = _sum.getAndSet(0);
    int count = _count.getAndSet(0);

    if (count != 0)
      _value =sum / (double) count;
    else
      _value = 0;
  }
798330
public function notBetween()
    {
        $this->failIf(
            $this->data[0] >= $this->data[1] &&
            $this->data[0] <= $this->data[2]
        );
    }
132156
public function initialize()
    {
        if ($this->initialized === false) {
            $this->data = $this->cursor->toArray();
        }
        $this->initialized = true;
    }
1146524
public function validate($order, Constraint $constraint): void
    {
        /** @var OrderInterface $order */
        Assert::isInstanceOf($order, OrderInterface::class);

        /** @var OrderShippingMethodEligibility $constraint */
        Assert::isInstanceOf($constraint, OrderShippingMethodEligibility::class);

        $shipments = $order->getShipments();
        if ($shipments->isEmpty()) {
            return;
        }

        foreach ($shipments as $shipment) {
            if (!$this->methodEligibilityChecker->isEligible($shipment, $shipment->getMethod())) {
                $this->context->addViolation(
                    $constraint->message,
                    ['%shippingMethodName%' => $shipment->getMethod()->getName()]
                );
            }
        }
    }