Associates various constructs with each other.
771702
def correlate(self):
        

        print("Correlating information from different parts of your project...")
                        
        non_local_mods = INTRINSIC_MODS        
        for item in self.settings['extra_mods']:
            i = item.index(':')
            if i < 0:
                print('Warning: could not parse extra modules ""'.format(item))
                continue
            name = item[:i].strip()
            url = item[i+1:].strip()
            non_local_mods[name.lower()] = '<a href="{}">{}</a>'.format(url,name)
        
        # Match USE statements up with the right modules
        for s in self.modules:
            id_mods(s, self.modules, non_local_mods, self.submodules)
        for s in self.procedures:
            id_mods(s, self.modules, non_local_mods, self.submodules)
        for s in self.programs:
            id_mods(s, self.modules, non_local_mods, self.submodules)
        for s in self.submodules:
            id_mods(s, self.modules, non_local_mods, self.submodules)
        for s in self.blockdata:
            id_mods(s, self.modules, non_local_mods, self.submodules)
            
        # Get the order to process other correlations with
        deplist = {}
        
        def get_deps(item):
            uselist = [m[0] for m in item.uses]
            for proc in getattr(item,'subroutines',[]):
                uselist.extend(get_deps(proc))
            for proc in getattr(item,'functions',[]):
                uselist.extend(get_deps(proc))
            for proc in getattr(item,'modprocedures',[]):
                uselist.extend(get_deps(proc))
            return uselist
        
        for mod in self.modules:
            uselist = get_deps(mod)
            uselist = [m for m in uselist if type(m) == ford.sourceform.FortranModule]
            deplist[mod] = set(uselist)
            mod.deplist = uselist
        for mod in self.submodules:
            if type(mod.ancestor_mod) is ford.sourceform.FortranModule:
                uselist = get_deps(mod)
                uselist = [m for m in uselist if type(m) == ford.sourceform.FortranModule]
                if mod.ancestor:
                    if type(mod.ancestor) is ford.sourceform.FortranSubmodule:
                        uselist.insert(0,mod.ancestor)
                    elif self.settings['warn'].lower() == 'true':
                        print('Warning: could not identify parent SUBMODULE of SUBMODULE ' + mod.name)
                else:
                    uselist.insert(0,mod.ancestor_mod)
                mod.deplist = uselist
                deplist[mod] = set(uselist)
            elif self.settings['warn'].lower() == 'true':
                print('Warning: could not identify parent MODULE of SUBMODULE ' + mod.name)
        # Get dependencies for programs and top-level procedures as well,
        # if dependency graphs are to be produced
        if self.settings['graph'].lower() == 'true':
            for proc in self.procedures:
                proc.deplist = set([m for m in get_deps(proc) if type(m) == ford.sourceform.FortranModule])
            for prog in self.programs:
                prog.deplist = set([m for m in get_deps(prog) if type(m) == ford.sourceform.FortranModule])
            for block in self.blockdata:
                block.deplist = set([m for m in get_deps(block) if type(m) == ford.sourceform.FortranModule])
        ranklist = toposort.toposort_flatten(deplist)
        for proc in self.procedures:
            if proc.parobj == 'sourcefile': ranklist.append(proc)
        ranklist.extend(self.programs)
        ranklist.extend(self.blockdata)

        # Perform remaining correlations for the project
        for container in ranklist:
            if type(container) != str: container.correlate(self)
        for container in ranklist:
            if type(container) != str: container.prune()

        if self.settings['project_url'] == '.':
            url = '..'
        else:
            url = self.settings['project_url']

        for sfile in self.files:
            for module in sfile.modules:
                for function in module.functions:
                    self.procedures.append(function)
                for subroutine in module.subroutines:
                    self.procedures.append(subroutine)
                for interface in module.interfaces:
                    self.procedures.append(interface)
                for absint in module.absinterfaces:
                    self.absinterfaces.append(absint)
                for dtype in module.types:
                    self.types.append(dtype)

            for module in sfile.submodules:
                for function in module.functions:
                    self.procedures.append(function)
                for subroutine in module.subroutines:
                    self.procedures.append(subroutine)
                for function in module.modfunctions:
                    self.submodprocedures.append(function)
                for subroutine in module.modsubroutines:
                    self.submodprocedures.append(subroutine)
                for modproc in module.modprocedures:
                    self.submodprocedures.append(modproc)
                for interface in module.interfaces:
                    self.procedures.append(interface)
                for absint in module.absinterfaces:
                    self.absinterfaces.append(absint)
                for dtype in module.types:
                    self.types.append(dtype)

            for program in sfile.programs:
                for function in program.functions:
                    self.procedures.append(function)
                for subroutine in program.subroutines:
                    self.procedures.append(subroutine)
                for interface in program.interfaces:
                    self.procedures.append(interface)
                for absint in program.absinterfaces:
                    self.absinterfaces.append(absint)
                for dtype in program.types:
                    self.types.append(dtype)

            for block in sfile.blockdata:
                for dtype in block.types:
                    self.types.append(dtype)

        def sum_lines(*argv, **kwargs):
            """ Wrapper for minimizing memory consumption """
            routine = kwargs.get('func', 'num_lines')
            n = 0
            for arg in argv:
                for item in arg:
                    n += getattr(item, routine)
            return n
        self.mod_lines = sum_lines(self.modules, self.submodules)
        self.proc_lines = sum_lines(self.procedures)
        self.file_lines = sum_lines(self.files)
        self.type_lines = sum_lines(self.types)
        self.type_lines_all = sum_lines(self.types, func='num_lines_all')
        self.absint_lines = sum_lines(self.absinterfaces)
        self.prog_lines = sum_lines(self.programs)
        self.block_lines = sum_lines(self.blockdata)
        print()
1199475
def _merge_inplace(self, other):
        """"""
        if other is None:
            yield
        else:
            # don't include indexes in priority_vars, because we didn't align
            # first
            priority_vars = OrderedDict(
                kv for kv in self.variables.items() if kv[0] not in self.dims)
            variables = merge_coords_for_inplace_math(
                [self.variables, other.variables], priority_vars=priority_vars)
            yield
            self._update_coords(variables)
1353240
def add_relations(self, relations):
        """"""
        for source, destination in relations:
            self.add_relation(source, destination)
126583
function mergeCompositionAreasWithPageAreas( composition, definition, containerItems, compositionItem ) {
      forEachArea( composition, (items, areaName) => {
         if( areaName === '.' ) {
            insertAfterEntry( containerItems, compositionItem, items );
            return;
         }

         if( !( areaName in definition.areas ) ) {
            definition.areas[ areaName ] = items;
            return;
         }

         mergeItemLists( definition.areas[ areaName ], items, definition );
      } );

      removeEntry( containerItems, compositionItem );

      function insertAfterEntry( arr, entry, replacements ) {
         const index = arr.indexOf( entry );
         arr.splice( index, 0, ...replacements );
      }

      function removeEntry( arr, entry ) {
         const index = arr.indexOf( entry );
         arr.splice( index, 1 );
      }
   }
935881
private function buildObjects(): void
    {
        //deep dependency level, start to array end for not use array_reverse
        for ($i = \count($this->tree) - 1; $i >= 0; $i--) {

            //class
            foreach ($this->tree[$i] as $class => $arguments) {

                //try to find object in class
                $object = $this->cache[$class] ?? null;

                //if object is not in cache and need arguments try to build
                if ($object === null && \count($arguments)) {

                    //build arguments
                    $args = $this->buildArguments($class, $arguments);

                    //store object with dependencies in cache
                    $this->cache[$class] = (new ReflectionClass($class))->newInstanceArgs($args);

                    continue;
                }

                if ($object === null) {

                    //store object in cache
                    $this->cache[$class] = (new ReflectionClass($class))->newInstance();
                }
            }
        }
    }
103099
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Contact::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Contact::class
        );
    }
993682
public function buildRelations()
    {
        $this->addRelation('Skill', '\\gossi\\trixionary\\model\\Skill', RelationMap::MANY_TO_ONE, array (
  0 =>
  array (
    0 => ':skill_id',
    1 => ':id',
  ),
), 'CASCADE', null, null, false);
        $this->addRelation('StructureNodeParentRelatedByStructureNodeId', '\\gossi\\trixionary\\model\\StructureNodeParent', RelationMap::ONE_TO_MANY, array (
  0 =>
  array (
    0 => ':structure_node_id',
    1 => ':id',
  ),
), null, null, 'StructureNodeParentsRelatedByStructureNodeId', false);
        $this->addRelation('StructureNodeParentRelatedByParentId', '\\gossi\\trixionary\\model\\StructureNodeParent', RelationMap::ONE_TO_MANY, array (
  0 =>
  array (
    0 => ':parent_id',
    1 => ':id',
  ),
), 'CASCADE', null, 'StructureNodeParentsRelatedByParentId', false);
        $this->addRelation('Kstruktur', '\\gossi\\trixionary\\model\\Kstruktur', RelationMap::ONE_TO_ONE, array (
  0 =>
  array (
    0 => ':id',
    1 => ':id',
  ),
), 'CASCADE', null, null, false);
        $this->addRelation('FunctionPhase', '\\gossi\\trixionary\\model\\FunctionPhase', RelationMap::ONE_TO_ONE, array (
  0 =>
  array (
    0 => ':id',
    1 => ':id',
  ),
), 'CASCADE', null, null, false);
        $this->addRelation('StructureNodeRelatedByParentId', '\\gossi\\trixionary\\model\\StructureNode', RelationMap::MANY_TO_MANY, array(), 'CASCADE', null, 'StructureNodesRelatedByParentId');
        $this->addRelation('StructureNodeRelatedByStructureNodeId', '\\gossi\\trixionary\\model\\StructureNode', RelationMap::MANY_TO_MANY, array(), null, null, 'StructureNodesRelatedByStructureNodeId');
    }
599262
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Abandoned::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Abandoned::class
        );
    }
679192
function setup(subject) {
        context.subject = subject;
        context.subjectType = null;
        context.subjectConstructor = null;
        context.isSet = false;
    }
368092
def build(self, *args, **kwargs):
        """"""
        # Create the directories of the work.
        self.indir.makedirs()
        self.outdir.makedirs()
        self.tmpdir.makedirs()

        # Build dirs and files of each task.
        for task in self:
            task.build(*args, **kwargs)

        # Connect signals within the work.
        self.connect_signals()
839487
function(s, p, o)
{
   if(p in s)
   {
      if(s[p].constructor === Array)
      {
         s[p].push(o);
      }
      else
      {
         s[p] = [s[p], o];
      }
   }
   else
   {
      s[p] = o;
   }
}
1031376
function concat(a, b) {
  if (!a && !b) throw new Error("Please specify valid arguments for parameters a and b.");
  if (!b || b.length === 0) return a;
  if (!a || a.length === 0) return b;
  const c = new a.constructor(a.length + b.length);
  c.set(a);
  c.set(b, a.length);
  return c;
}
594074
private void buildItems()
  {
    Preconditions.checkState(items == null);
    items = OPFItems.build(itemBuilders.values(), spineIDs);

    for (OPFItem item : items.getItems())
    {
      reportItem(item);
    }
  }
752115
protected function _construct()
    {
        $this->_controller = 'thesaurus';
        $this->_headerText = __('Thesaurus');
        $this->_addButtonLabel = __('Add New Thesaurus');

        parent::_construct();
    }
299862
public function _construct()
    {
        $this->_controller = 'adminhtml_dashboard';
        $this->_headerText = __('Dashboard');
        parent::_construct();

        /**
         * Contact sync.
         */
        $this->buttonList->add(
            'contact_sync',
            [
                'label' => __('Run Contact Sync'),
                'class' => 'primary'
            ]
        );

        /**
         * Importer sync.
         */
        $this->buttonList->add(
            'importer_sync',
            [
                'label' => __('Run Importer Sync'),
                'class' => 'primary'
            ]
        );
    }
1287273
@PostConstruct
	protected void postConstruct() {
		if (null == authenticationServices) {
			authenticationServices = new ArrayList<AuthenticationService>();
		}
		if (!excludeDefault) {
			authenticationServices.add(staticAuthenticationService);
		}
	}
465430
public function buildRelations()
    {
        $this->addRelation('Sport', '\\gossi\\trixionary\\model\\Sport', RelationMap::MANY_TO_ONE, array (
  0 =>
  array (
    0 => ':sport_id',
    1 => ':id',
  ),
), 'CASCADE', null, null, false);
        $this->addRelation('SkillGroup', '\\gossi\\trixionary\\model\\SkillGroup', RelationMap::ONE_TO_MANY, array (
  0 =>
  array (
    0 => ':group_id',
    1 => ':id',
  ),
), 'CASCADE', null, 'SkillGroups', false);
        $this->addRelation('Skill', '\\gossi\\trixionary\\model\\Skill', RelationMap::MANY_TO_MANY, array(), 'CASCADE', null, 'Skills');
    }