Calculate test dependencies
        First do a topological sorting based on the dependencies.
        Then sort the different dependency groups based on priorities.
518726
def calculate_dependencies():
        
        order = []
        for group in toposort(dependencies):
            priority_sorted_group = sorted(group, key=lambda x: (priorities[x], x))
            order.extend(priority_sorted_group)

        return order
774436
def depends_on(options, **kwargs):
    
    include_graph = options['include_graph']

    include_graph.render('full_graph')

    result = None

    if 'graph' in kwargs:
        name = kwargs['graph']
        del kwargs['graph']

        result = _Result(kwargs)

        dep_graph = build_dependency_graph(include_graph, **kwargs)

        dep_graph.render(name)

        result.add_result("Rendered dep graph at {}".format(name))

    else:
        result = _Result(kwargs)

        dep_graph = build_dependency_graph(include_graph, **kwargs)

        for node, edges in dep_graph:
            if node not in kwargs:
                result.add_result(node)

    return result
576543
def _get_all_dependencies_of(name, deps=set(), force=False):
    ''''''
    first_deps = _get_api_dependencies_of(name, force=force)
    for dep in first_deps:
        dep = _strip_version_from_dependency(dep)
        if dep in deps:
            continue
        # we do the following not to resolve the dependencies of already installed daps
        if dap in get_installed_daps():
            continue
        deps |= _get_all_dependencies_of(dep, deps)
    return deps | set([name])
701586
function detectDependencies(config) {
  var allDependencies = {};

  if (config.get('dependencies')) {
    $._.assign(allDependencies, config.get('bower.json').dependencies);
  }

  if (config.get('dev-dependencies')) {
    $._.assign(allDependencies, config.get('bower.json').devDependencies);
  }

  if (config.get('include-self')) {
    allDependencies[config.get('bower.json').name] = config.get('bower.json').version;
  }

  $._.each(allDependencies, gatherInfo(config));

  config.set('global-dependencies-sorted', filterExcludedDependencies(
    config.get('detectable-file-types').
      reduce(function (acc, fileType) {
        if (!acc[fileType]) {
          acc[fileType] = prioritizeDependencies(config, '.' + fileType);
        }
        return acc;
      }, {}),
    config.get('exclude')
  ));

  return config;
}
924104
def order_module_dependencies(modules, parser):
    """"""
    result = []        
    for modk in modules:
        if modk not in result:
            result.append(modk)

    #We also need to look up the dependencies of each of these modules
    recursed = list(result)
    for i in range(len(result)):
        module = result[i]
        _process_module_order(parser, module, i, recursed)

    return recursed
719356
function orderByDependencies(packages) {
  const packageDependencyGraph = pkg =>
    R.pipe(
      allDeps,
      R.map(dependencyName => [dependencyName, pkg.name]),
    )(pkg)

  // :: Array<Package> -> Array<Array<string, string>>
  const dependencyGraph = R.chain(packageDependencyGraph)

  // :: Package -> bool
  const hasNoDependencies = ({ dependencies }) => dependencies.length === 0

  // :: Array<Package>
  const packagesWithNoDependencies = R.pipe(
    R.filter(hasNoDependencies),
    R.map(R.prop('name')),
  )(packages)

  // :: string -> Package
  const findPackageByName = R.map(name =>
    R.find(R.propEq('name', name), packages),
  )

  return R.pipe(
    dependencyGraph,
    toposort,
    R.without(packagesWithNoDependencies),
    R.concat(packagesWithNoDependencies),
    findPackageByName,
  )(packages)
}
280426
public void setDependencies(java.util.Collection<ApplicationDependencySummary> dependencies) {
        if (dependencies == null) {
            this.dependencies = null;
            return;
        }

        this.dependencies = new java.util.ArrayList<ApplicationDependencySummary>(dependencies);
    }
1041495
def missing_dependencies():
    """"""
    missing_deps = []
    for dependency in DEPENDENCIES:
        if not dependency.check() and not dependency.optional:
            missing_deps.append(dependency)
    if missing_deps:
        return status(deps=missing_deps, linesep='<br>')
    else:
        return ""
131700
def dependency_lines(self):
    
    deps = sorted(self._dependencies_by_address.values(), key=lambda d: d.spec)
    def dep_lines():
      yield '  dependencies = ['
      for dep in deps:
        for line in dep.lines():
          yield line
      yield '  ],'
    return list(dep_lines()) if deps else []
637922
def pull_dependencies(collector, image, **kwargs):
    """"""
    for dep in image.commands.dependent_images:
        kwargs["image"] = dep
        pull_arbitrary(collector, **kwargs)
270020
def list_dependencies(self, module, result):
        """"""
        if result is None:
            result = {}
        #We will try at least once to load each module that we don't have
        if module not in self.modules:
            self.load_dependency(module, True, True, False)

        if module in self.modules and module not in result:
            result[module] = self.modules[module].filepath
            for depend in self.modules[module].dependencies:
                name = depend.split(".")[0].lower()
                if name not in result:
                    self.list_dependencies(name, result)

        return result
1080868
def _build_all_dependencies(self):
        '''
        
        '''
        ret = {}
        for model, schema in six.iteritems(self._models()):
            dep_list = self._build_dependent_model_list(schema)
            ret[model] = dep_list
        return ret
1007247
def get_dependencies(self):
        """"""
        # pylint: disable=no-member
        return super().get_dependencies() + [
            Data.collection_set,
            Data.entity_set,
            Data.parents,
        ]
1004069
def _build_dependencies(self):
        
        for module in list(self.values()):
            module.set_all_dependencies(find_dependencies([module.name], self))
645506
function(links) {
  this.dependencies = _buildDependencies(links);
  this.tasks = graph.tsort(this.dependencies).reverse();  
  this.index = 0;
}
313485
def pull_dependencies(self, nodes):
        """"""
        visitor = DependencyFinderVisitor()
        for node in nodes:
            visitor.visit(node)
        for dependency in 'filters', 'tests':
            mapping = getattr(self, dependency)
            for name in getattr(visitor, dependency):
                if name not in mapping:
                    mapping[name] = self.temporary_identifier()
                self.writeline('%s = environment.%s[%r]' %
                               (mapping[name], dependency, name))
147048
private void processDependencies()
            throws MojoExecutionException
    {

        processDependency( getProject().getArtifact() );

        AndArtifactFilter filter = new AndArtifactFilter();
        // filter.add( new ScopeArtifactFilter( dependencySet.getScope() ) );

        if ( dependencies != null && dependencies.getIncludes() != null && !dependencies.getIncludes().isEmpty() )
        {
            filter.add( new IncludesArtifactFilter( dependencies.getIncludes() ) );
        }
        if ( dependencies != null && dependencies.getExcludes() != null && !dependencies.getExcludes().isEmpty() )
        {
            filter.add( new ExcludesArtifactFilter( dependencies.getExcludes() ) );
        }

        Collection<Artifact> artifacts =
                isExcludeTransitive() ? getProject().getDependencyArtifacts() : getProject().getArtifacts();

        for ( Artifact artifact : artifacts )
        {
            if ( filter.include( artifact ) )
            {
                processDependency( artifact );
            }
        }
    }