@param   Context $op_context

@return  void
543746
public function updateChecks(Context $op_context)
    {
        $this->check_classes = $this->check_classes && $op_context->check_classes;
        $this->check_variables = $this->check_variables && $op_context->check_variables;
        $this->check_methods = $this->check_methods && $op_context->check_methods;
        $this->check_functions = $this->check_functions && $op_context->check_functions;
        $this->check_consts = $this->check_consts && $op_context->check_consts;
    }
1189323
protected function evaluateOperations()
    {
        while ($op = array_shift($this->operations)) {
            $operation = $this->operationResolver->resolveOperation($op['name'], $this->context);
            $lastOperationResult = $operation->evaluate($this, $op['arguments']);
        }
        return $lastOperationResult;
    }
1250055
public function addContext(Context $context) {
    $contexts = $this->get('contextOut');
    $contexts[] = $context;
    $this->add('contextOut', $contexts);
  }
390566
def set_op_upstreams(op_run, op):
    """"""
    # We get a list of all upstream ops or the current op
    upstream_ops = op.upstream_operations.values_list('id', flat=True)
    # We get latest op runs for the upstream_ops
    latest_op_runs = OperationRun.objects.filter(id__in=upstream_ops)
    latest_op_runs = latest_op_runs.annotate(max_date=Max('created_at'))
    latest_op_runs = latest_op_runs.filter(date=F('max_date'))
    # Set the upstream ops
    op_run.set(latest_op_runs)
772023
def set_context_menu(self, context_menu):
        
        self.context_menu = context_menu
        self.context_menu.tree_view = self
        self.context_menu.init_actions()
        for action in self.context_menu.actions():
            self.addAction(action)
1080591
protected function findContext($context_name = 'default')
    {
        $context_full_name = strtolower($context_name);

        /* @var $context DefaultResourceContext */
        $context = $this->findOneOrNullBy(array('name' => $context_full_name));

        if (is_null($context)) {
            $context = $this->createNewInstance();
            $context->setName($context_full_name);
            $context->setTitle($context_name);
            $this->persist($context);
        }

        return $context;
    }
56310
public function _performOperation($key, FieldOperation $operation)
    {
        $oldValue = null;
        if (isset($this->estimatedData[$key]))
        {
            $oldValue = $this->estimatedData[$key];
        }
        $newValue = $operation->_apply($oldValue, $this, $key);
        if ($newValue !== null)
        {
            $this->estimatedData[$key] = $newValue;
        } else if (isset($this->estimatedData[$key]))
        {
            unset($this->estimatedData[$key]);
        }

        if (isset($this->operationSet[$key]))
        {
            $oldOperations = $this->operationSet[$key];
            $newOperations = $operation->_mergeWithPrevious($oldOperations);
            $this->operationSet[$key] = $newOperations;
        } else
        {
            $this->operationSet[$key] = $operation;
        }
        $this->dataAvailability[$key] = true;
    }
858615
public static function delete_data_for_all_users_in_context(\context $context) {
        global $DB;

        if (!$context instanceof \context_course) {
            return;
        }

        $DB->delete_records('enrol_paypal', array('courseid' => $context->instanceid));
    }
274649
public function evaluate(Context $context)
    {
        /** @var Proposition $operand */
        list($operand) = $this->getOperands();

        return !$operand->evaluate($context);
    }
144845
public function initializeContext(Context $context)
    {
        if ($context instanceof ResourceContext) {
            $reflector = new ReflectionClass(get_class($context));

            if ($this->builder->getLoader() instanceof FileResourceLoader) {
                if ($this->builder->getLoader()->getBasePath() == null) {
                    $this->builder->getLoader()->setBasePath(dirname($reflector->getFileName()));
                }
            }

            if ($context->getResourceFactory()) {
                $this->builder->setFactory($context->getResourceFactory());
            }

            $context->setResourceBuilder($this->builder);
        }
    }
8694
protected function convertFlag(Op\FlagOp $op)
    {
        return $op->isEnabled()
            ? ProtoBuf\MapUpdate\FlagOp::ENABLE
            : ProtoBuf\MapUpdate\FlagOp::DISABLE;
    }
1067981
public void applyToOccupants (OccupantOp op)
    {
        if (_plobj != null) {
            for (OccupantInfo info : _plobj.occupantInfo) {
                op.apply(info);
            }
        }
    }
778646
public function initializeContext(Context $context)
    {
        if (false === $context instanceof AliceContextInterface) {
            return;
        }

        /* @var AliceContextInterface $context */
        $fixturesBasePath = $this->fixturesBasePath;
        switch (true) {

            case $context instanceof AliceODMContext:
                $fixturesBasePath .= '/ODM';
                break;

            case $context instanceof AliceORMContext:
                $fixturesBasePath .= '/ORM';
                break;

            case $context instanceof AlicePHPCRContext:
                $fixturesBasePath .= '/PHPCR';
                break;
        }

        if (null === $context->getBasePath()) {
            $context->setBasePath($fixturesBasePath);
        }
    }
1008464
function unregisterOperator( $op_name )
    {
        if ( is_array( $op_name ) )
        {
            foreach ( $op_name as $op )
            {
                $this->unregisterOperator( $op_name );
            }
        }
        else if ( isset( $this->Operators ) )
            unset( $this->Operators[$op_name] );
        else
            $this->warning( "unregisterOpearator()", "Operator $op_name is not registered, cannot unregister" );
    }
579378
public function or_on($c1, $op, $c2)
	{
		$this->_on[] = array($c1, $op, $c2, 'OR');

		return $this;
	}
841051
protected function _pushContext(&$local_context) {
		$new = array();
		$new[] =& $local_context;
		foreach (array_keys($this->_context) as $key) {
			$new[] =& $this->_context[$key];
		}
		$this->_context = $new;
	}
96500
protected function runOperation($op, $method = 'post', array $body = [])
    {
        if (!$this->operationAvailable($op, true)) {
            throw new OperationUnavailableException("Operation not available: $op");
        }
        $options = [];
        if (!empty($body)) {
            $options['json'] = $body;
        }
        $request= new Request($method, $this->getLink("#$op"));
        $data = $this->send($request, $this->client, $options);

        return new Result($data, $this->baseUrl, $this->client, get_called_class());
    }