Performs enrichment.
165264
protected function performEnrichment()
    {
        if ( ! count($this->info->export->columns)) {
            $this->fillDataForEmpty();
        } else {
            $this->enrichCustomData();
        }

        // Separate strategies may have their own column setups.
        // If not, the defaults should be copied for them.
        foreach ($this->info->export->strategies as $key => $strategyData) {

            if ( ! count($strategyData->columns)) {
                $this->info->export->strategies[ $key ]->columns = $this->info->export->columns;
            } else {
                $this->enrichCustomData($key);
            }
        }
    }
682309
protected void performSubtasks(TaskRequest req, TaskResponse res, List<Task> tasks) {
        // Assertions...
        if (req == null) {
            String msg = "Argument 'req' cannot be null.";
            throw new IllegalArgumentException(msg);
        }
        if (res == null) {
            String msg = "Argument 'res' cannot be null.";
            throw new IllegalArgumentException(msg);
        }
        if (tasks == null) {
            String msg = "Child tasks have not been initialized.  Subclasses "
                            + "of AbstractContainerTask must call super.init() "
                            + "within their own init() method.";
            throw new IllegalStateException(msg);
        }
        
        // Invoke each of our children...
        for (Task k : tasks) {
            k.perform(req, res);
        }
	}
1372898
public static void enrichContext(Context context) {
		context.setPostProperty(Context.MEMORY_TOTAL, Runtime.getRuntime().totalMemory());
		context.setPostProperty(Context.MEMORY_FREE, Runtime.getRuntime().freeMemory());
		context.setPostProperty(Context.MEMORY_USED, Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory());
	}
398473
private void perform(int operation, int position, long bs, int length) {
		checkBitsLength(length);
		position = adjPosition(position);
		checkMutable();
		performAdj(operation, position, bs, length);
	}
1237357
public function performTasks()
    {
        try { // try to execute this target
            $this->project->fireTargetStarted($this);
            $this->main();
            $this->project->fireTargetFinished($this, $null = null);
        } catch (BuildException $exc) {
            // log here and rethrow
            $this->project->fireTargetFinished($this, $exc);
            throw $exc;
        }
    }
162677
public function perform()
    {
        $this->options['to'] = $this->getRecipient();
        unset($this->data[self::RECIPIENT_FIELD]);
        unset($this->options['allowed-recipients']);

        return parent::perform();
    }
1032010
protected function _execute()
    {
        if (!$this->enabled() && !$this->focused()) {
            return;
        }
        foreach ($this->_children as $child) {
            if ($this->suite()->failfast()) {
                break;
            }
            $this->_passed = $child->process() && $this->_passed;
        }
    }
1129492
protected function enrichCustomData()
    {
        // Check filled fields and enrich them as required
        // Note that these can be either attributes or relations

        $fields = [];

        foreach ($this->info->show->fields as $key => $field) {

            try {
                $this->enrichField($key, $field, $fields);

            } catch (\Exception $e) {

                // Wrap and decorate exceptions so it is easier to track the problem source
                throw (new ModelInformationEnrichmentException(
                    "Issue with show field '{$key}' (show.fields.{$key}): \n{$e->getMessage()}",
                    $e->getCode(),
                    $e
                ))
                    ->setSection('show.fields')
                    ->setKey($key);
            }
        }

        $this->info->show->fields = $fields;
    }
788150
protected function define_execution() {
        global $DB;

        $plugins = enrol_get_plugins(true);
        $enrols = $DB->get_records('enrol', array(
                'courseid' => $this->task->get_courseid()));

        // Allow each enrol plugin to add annotations.
        foreach ($enrols as $enrol) {
            if (isset($plugins[$enrol->enrol])) {
                $plugins[$enrol->enrol]->backup_annotate_custom_fields($this, $enrol);
            }
        }
    }
824874
public function process()
    {
        $remainingChildren = $this->remainingChildren;

        // if there's no more, we're done!
        if (!count($remainingChildren)) {
            $this->isComplete = true;
            $this->handleCompletion();
            return;
        }

        $class = $this->dataClass;
        $ID = array_shift($remainingChildren);

        $record = null;

        if (class_exists('Subsite')) {
            $records = Subsite::get_from_all_subsites($class, ['ID' => $ID]);
            if ($records && $records->exists()) {
                $record = $records->First();
            }
        } else {
            $record = $class::get()->byID($ID);
        }

        if (!$record || !$record->exists()) {
            $message = sprintf('%s ID %s not found!', $class, $ID);
            $this->addMessage($message, 'WARNING');
            Injector::inst()->get(LoggerInterface::class)->warning($message);
        } else {
            $created = $record->dbObject('Created')->Nice();
            $record->delete();
            $this->addMessage(sprintf('Deleted %s ID %s (%s)', $class, $ID, $created), 'WARNING');
        }

        // Update counter
        $this->currentStep++;
        $this->remainingChildren = $remainingChildren;
    }
8842
private ZealotKhala doIn(String prefix, String field, Object[] values, boolean match, boolean positive) {
        return this.doInByType(prefix, field, values, match, ZealotConst.OBJTYPE_ARRAY, positive);
    }
583820
def each_expression(include_self = false, &block)
      traverse(include_self) do |event, exp, index|
        yield(exp, index) unless event == :exit
      end
    end
821837
def accumulate(iterable):
  "  "
  iterator = iter(iterable)
  sum_data = next(iterator)
  yield sum_data
  for el in iterator:
    sum_data += el
    yield sum_data
611923
function(callback, opt_this) {
      function visit(ec) {
        callback.call(opt_this, ec);
        ec.iterateAllChildEventContainers(visit);
      }
      visit(this);
    }
855651
public function apply()
    {
        if ($this->canApply()) {
            $subject = $this->getSubject();
            $this->createNode($subject);
            $this->updateWorkspaceInfo();
        }
    }
1202197
public function perform()
    {
        $tripod = $this->getTripod(
            $this->args[self::STORE_NAME_KEY],
            $this->args[self::POD_NAME_KEY],
            $this->getTripodOptions()
        );

        $operations = $this->args[self::OPERATIONS_KEY];

        $subjectsAndPredicatesOfChange = $this->args[self::CHANGES_KEY];

        $this->subjectCount = 0;
        foreach ($operations as $op) {
            /** @var \Tripod\Mongo\Composites\IComposite $composite */
            $composite = $tripod->getComposite($op);
            $modifiedSubjects = $composite->getImpactedSubjects(
                $subjectsAndPredicatesOfChange,
                $this->args[self::CONTEXT_ALIAS_KEY]
            );
            if (!empty($modifiedSubjects)) {
                $configInstance = $this->getConfigInstance();
                /* @var $subject \Tripod\Mongo\ImpactedSubject */
                foreach ($modifiedSubjects as $subject) {
                    $this->subjectCount++;
                    $subjectTimer = new \Tripod\Timer();
                    $subjectTimer->start();
                    if (isset($this->args[self::QUEUE_KEY]) || count($subject->getSpecTypes()) == 0) {
                        if (isset($this->args[self::QUEUE_KEY])) {
                            $queueName = $this->args[self::QUEUE_KEY];
                        } else {
                            $queueName = $configInstance::getApplyQueueName();
                        }
                        $this->addSubjectToQueue($subject, $queueName);
                    } else {
                        $specsGroupedByQueue = array();
                        foreach ($subject->getSpecTypes() as $specType) {
                            $spec = null;
                            switch ($subject->getOperation()) {
                                case OP_VIEWS:
                                    $spec = $configInstance->getViewSpecification(
                                        $this->args[self::STORE_NAME_KEY],
                                        $specType
                                    );
                                    break;
                                case OP_TABLES:
                                    $spec = $configInstance->getTableSpecification(
                                        $this->args[self::STORE_NAME_KEY],
                                        $specType
                                    );
                                    break;
                                case OP_SEARCH:
                                    $spec = $configInstance->getSearchDocumentSpecification(
                                        $this->args[self::STORE_NAME_KEY],
                                        $specType
                                    );
                                    break;
                            }
                            if (!$spec || !isset($spec['queue'])) {
                                if (!$spec) {
                                    $spec = array();
                                }
                                $spec['queue'] = $configInstance::getApplyQueueName();
                            }
                            if (!isset($specsGroupedByQueue[$spec['queue']])) {
                                $specsGroupedByQueue[$spec['queue']] = array();
                            }
                            $specsGroupedByQueue[$spec['queue']][] = $specType;
                        }

                        foreach ($specsGroupedByQueue as $queueName => $specs) {
                            $queuedSubject = new \Tripod\Mongo\ImpactedSubject(
                                $subject->getResourceId(),
                                $subject->getOperation(),
                                $subject->getStoreName(),
                                $subject->getPodName(),
                                $specs
                            );

                            $this->addSubjectToQueue($queuedSubject, $queueName);
                        }
                    }
                    $subjectTimer->stop();
                    // stat time taken to discover impacted subjects for the given subject of change
                    $this->getStat()->timer(MONGO_QUEUE_DISCOVER_SUBJECT, $subjectTimer->result());
                }
                if (!empty($this->subjectsGroupedByQueue)) {
                    foreach ($this->subjectsGroupedByQueue as $queueName => $subjects) {
                        $this->getApplyOperation()->createJob($subjects, $queueName, $this->getTripodOptions());
                    }
                    $this->subjectsGroupedByQueue = array();
                }
            }
        }
    }
939797
public void run(Entry entry) {	
		
		// get availabilities
		final Set<String> avail = new HashSet<String>();
		if(entry.hasAvailabilities()) {
			for (Availability a : entry.getAvailabilities())
				if (a.hasValue()) 
					avail.add(a.getValue());	
		}
		
		// get data source
		final Provenance pro = createProvenance(entry.getSource());
		
		//build a skip-set of "interactions" linked by participant.interactionRef element;
		//we'll then create Complex type participants from these in-participant interactions.
		Set<Interaction> participantInteractions = new HashSet<Interaction>();
		for(Interaction interaction : entry.getInteractions()) {
			for(Participant participant : interaction.getParticipants()) {
				//checking for hasInteraction()==true only is sufficient; 
				//i.e., we ignore hasInteractionRef(), getInteractionRefs(), 
				//because these in fact get cleared by the PSI-MI parser:
				if(participant.hasInteraction()) {
					participantInteractions.add(participant.getInteraction());
				}
			}
		}
		
		// iterate through the "root" psimi interactions only and create biopax interactions or complexes
		for (Interaction interaction : entry.getInteractions()) {
			if(!participantInteractions.contains(interaction)) {
				// TODO future (hard): make a Complex or Interaction based on the interaction type ('direct interaction' or 'physical association' (IntAct) -> complex)
				processInteraction(interaction, avail, pro, false);
			}
		}
	}