From a dependency graph, collects a list of transitive dependencies by recursing through a dependency graph.
429519
function collectTransitiveDependencies(
  collected,
  depGraph,
  fromName
) {
  const immediateDeps = depGraph[fromName];
  if (immediateDeps) {
    Object.keys(immediateDeps).forEach(toName => {
      if (!collected[toName]) {
        collected[toName] = true;
        collectTransitiveDependencies(collected, depGraph, toName);
      }
    });
  }
}
645506
function(links) {
  this.dependencies = _buildDependencies(links);
  this.tasks = graph.tsort(this.dependencies).reverse();  
  this.index = 0;
}
530587
function collectDependencies(module) {
    let paths = [];
    function pathsToAcceptingModules(path, root) {
      const requiredMe = parents[root.filename];
      if (module.hot._selfAccepted) {
        paths.push(path.concat(root.filename));
        return;
      }
      if (module.hot._selfDeclined) {
        return;
      }
      for (let next in requiredMe) {
        let parentHotRuntime = requiredMe[next].hot;
        if (parentHotRuntime._acceptedDependencies[root.filename]) {
          paths.push(path.concat(root.filename));
          continue;
        }
        if (parentHotRuntime._declinedDependencies[root.filename]) {
          continue;
        }
        pathsToAcceptingModules(path.concat(root.filename), requiredMe[next]);
      }
    }
    pathsToAcceptingModules([], module);
    return paths;
  }
575669
def resolve_dependency_graph(self, target):
        
        targets = self.deep_dependendants(target)
        # print "deep dependants:", targets
        return sorted(targets,
                      cmp=lambda a, b:
                          1 if b in self.deep_dependendants(a) else
                          -1 if a in self.deep_dependendants(b) else
                          0)
436332
function collectDependencies(dependencies, model, models) {
  if (!model || dependencies.has(model.modelClass)) {
    return;
  }
  dependencies.add(model.modelClass);
  if (model.modelDependencies) {
    model.modelDependencies.forEach((dep) =>
      collectDependencies(dependencies, dep, models)
    );
  }
}
1112657
private List<String> getDependenciesTree(String directory, String directoryName) {
        List<String> lines;
        if (dependencyTrees.get(directoryName) == null) {
            String[] gradleCommandParams = gradleCli.getGradleCommandParams(GradleMvnCommand.DEPENDENCIES);
            lines = gradleCli.runGradleCmd(directory, gradleCommandParams, true);
            dependencyTrees.put(directoryName, lines);
        } else {
            lines = dependencyTrees.get(directoryName);
        }
        return lines;
    }
896326
def get_dependants(self, run):
        
        if run in self._graph.nodes():
            return list(self._graph.successors(run))
        else:
            return []
142284
def collapsed_dependencies(self):
        
        if self._basic_dependencies is None:
            deps = self._element.xpath('dependencies[@type="collapsed-dependencies"]')
            if len(deps) > 0:
                self._basic_dependencies = DependencyGraph(deps[0])
        return self._basic_dependencies
780246
public Map<String,Map> getDependenciesGraph() {
        Map<String,Map> graph = new HashMap<String,Map>();
        
        if ( preorderedNodeList != null ) {

            List<DependencyNode> nodes = preorderedNodeList.getNodes();
            Set<String> notations = new HashSet<String>();
            
            for (Dependency dependency : getDependencies() ) {
                notations.add(Notation.generate(dependency));
            }
            
            for( DependencyNode node: nodes) {
                String notation = Notation.generate( node.getDependency().getArtifact() );
            
                // Show Graph with dependenices as root and transitive as children
                if ( notations.contains( notation ) ) {
                    graph.put( notation, mapDependenciesFromNode( node ) );
                }
            }
        }
        
        return graph;
    }
1369117
def syncDependencies(self, recursive=False):
        
        scene = self.viewItem().scene()
        if not scene:
            return
        
        visible       = self.viewItem().isVisible()
        depViewItems  = self._dependencies.values() 
        depViewItems += self._reverseDependencies.values()
        
        for depViewItem in depViewItems:
            if not depViewItem.scene():
                scene.addItem(depViewItem)
            
            depViewItem.rebuild()
            depViewItem.setVisible(visible)
        
        if recursive:
            for c in range(self.childCount()):
                self.child(c).syncDependencies(recursive = True)
1102433
def dependency_list(self, tkn: str) -> List[str]:
        
        if tkn not in self.dependency_map:
            self.dependency_map[tkn] = [tkn]        # Force a circular reference
            self.dependency_map[tkn] = self.reference(tkn).dependency_list()
        return self.dependency_map[tkn]
1322169
def build_graph(self):
        
        for child, parents in self.dependencies.items():
            if child not in self.nodes:
                raise NodeNotFoundError(
                    "App %s SQL item dependencies reference nonexistent child node %r" % (
                        child[0], child),
                    child
                )
            for parent in parents:
                if parent not in self.nodes:
                    raise NodeNotFoundError(
                        "App %s SQL item dependencies reference nonexistent parent node %r" % (
                            child[0], parent),
                        parent
                    )
                self.node_map[child].add_parent(self.node_map[parent])
                self.node_map[parent].add_child(self.node_map[child])

        for node in self.nodes:
            self.ensure_not_cyclic(node,
                                   lambda x: (parent.key for parent in self.node_map[x].parents))
726300
def _build_function_dependency_graphs(self):
        

        # This is a map between functions and its corresponding dependencies
        self._function_data_dependencies = defaultdict(networkx.DiGraph)

        # Group all dependencies first

        block_addr_to_func = { }
        for _, func in self.kb.functions.items():
            for block in func.blocks:
                block_addr_to_func[block.addr] = func

        for src, dst, data in self.graph.edges(data=True):
            src_target_func = None
            if src.block_addr in block_addr_to_func:
                src_target_func = block_addr_to_func[src.block_addr]
                self._function_data_dependencies[src_target_func].add_edge(src, dst, **data)

            if dst.block_addr in block_addr_to_func:
                dst_target_func = block_addr_to_func[dst.block_addr]
                if not dst_target_func is src_target_func:
                    self._function_data_dependencies[dst_target_func].add_edge(src, dst, **data)
413685
private List<DependencyNode> levelTraverseTreeList(List<DependencyNode>  nodeList, List <DependencyNode> aggDepNodeList )
  {
    aggDepNodeList.addAll(nodeList);
    List<DependencyNode> NodeChildList = new ArrayList<DependencyNode>();
    for (DependencyNode node : nodeList) {
      if ( (node != null) && (node.getChildren() != null) ) {
        NodeChildList.addAll(node.getChildren());
      }
    }

    return NodeChildList;
  }
1171556
def recreate_parent_dependencies(apps, schema_editor):
    """"""
    Data = apps.get_model('flow', 'Data')
    DataDependency = apps.get_model('flow', 'DataDependency')

    def process_dependency(data, parent):
        if not Data.objects.filter(pk=parent).exists():
            DataDependency.objects.create(
                child=data, parent=None, kind='io'
            )

    for data in Data.objects.all():
        for field_schema, fields in iterate_fields(data.input, data.process.input_schema):
            name = field_schema['name']
            value = fields[name]

            if field_schema.get('type', '').startswith('data:'):
                process_dependency(data, value)

            elif field_schema.get('type', '').startswith('list:data:'):
                for parent in value:
                    process_dependency(data, parent)
1359432
def _decref_dependencies_recursive(self, term, refcounts, garbage):
        
        # Edges are tuple of (from, to).
        for parent, _ in self.graph.in_edges([term]):
            refcounts[parent] -= 1
            # No one else depends on this term. Remove it from the
            # workspace to conserve memory.
            if refcounts[parent] == 0:
                garbage.add(parent)
                self._decref_dependencies_recursive(parent, refcounts, garbage)
1330109
function getAllDependencies() {
    var folder = './' + getBowerFolder();
    var bowerDependencies = fs.readdirSync(folder, {encoding: 'utf8'});

    var dependencyInfos = [];
    bowerDependencies.forEach(function(dirname) {
        var filepath = nodePath.resolve(cwd, folder, dirname, '.bower.json');
        if (fs.existsSync(filepath)) {
            var dependencyInfo = getDependency(filepath);
            dependencyInfo.dirName = dirname;
            dependencyInfos.push(dependencyInfo);
        }
    });

    return dependencyInfos;
}