Interfaces the GraphNode `depends` method
485280
def depends(self, *tasks):
        
        nodes = [x.node for x in tasks]
        self.node.depends(*nodes)
        return self
1345711
def traverse_dependencies_up(docgraph, node_id, node_attr=None):
    
    # there's only one, but we're in a multidigraph
    source, target = docgraph.in_edges(node_id)[0]
    traverse_attr = node_attr if node_attr else docgraph.lemma_attr

    attrib_value = docgraph.node[source].get(traverse_attr)
    if attrib_value:
        yield attrib_value

    if istoken(docgraph, source) is True:
        for attrib_value in traverse_dependencies_up(docgraph, source,
                                                     traverse_attr):
            yield attrib_value
645506
function(links) {
  this.dependencies = _buildDependencies(links);
  this.tasks = graph.tsort(this.dependencies).reverse();  
  this.index = 0;
}
319195
static MavenArtifactInfo fromDependencyNode(final DependencyNode dependencyNode) {
        final Artifact artifact = dependencyNode.getDependency().getArtifact();
        final List<DependencyNode> children = dependencyNode.getChildren();

        // SHRINKRES-143 lets ignore invalid scope
        ScopeType scopeType = ScopeType.RUNTIME;
        try {
            scopeType = ScopeType.fromScopeType(dependencyNode.getDependency().getScope());
        } catch (IllegalArgumentException e) {
            // let scope be RUNTIME
            log.log(Level.WARNING, "Invalid scope {0} of retrieved dependency {1} will be replaced by <scope>runtime</scope>",
                    new Object[] { dependencyNode.getDependency().getScope(), dependencyNode.getDependency().getArtifact() });
        }
        final boolean optional = dependencyNode.getDependency().isOptional();
        return new MavenArtifactInfoImpl(artifact, scopeType, children, optional);
    }
765483
function resolveDependencies(map) {
			var dependencyGraph = dependencies || {};
			var resolved = [];
			var unresolved = [];

			// Build dependency graph
			if (map.dependencies) {
				dependencyTools.buildDependencyGraph(
					undefined,  // First recursion without a start value
					map.dependencies,
					dependencyGraph
				);

				// Flatten/resolve the dependency tree
				dependencyTools.resolveDependencyGraph(
					undefined,  // First recursion without a start value
					resolved,
					unresolved,
					dependencyGraph
				);
			}

			return resolved;
		}
320977
def _InitializeGraph(self, os_name, artifact_list):
    
    dependencies = artifact_registry.REGISTRY.SearchDependencies(
        os_name, artifact_list)
    artifact_names, attribute_names = dependencies

    self._AddAttributeNodes(attribute_names)
    self._AddArtifactNodesAndEdges(artifact_names)
884499
public static <T> void verify(List<Vertex<T>> vertices) throws CyclicDependencyException
    {
        // Reset the orders of all the vertices.
        resetVertices(vertices);

        // Assert that all vertices are in the vertices list and resolve each of their orders.
        Iterator<Vertex<T>> it = vertices.iterator();
        while (it.hasNext())
        {
            Vertex<T> v = it.next();

            // Make sure that any dependencies are also in the vertices list.  This adds
            //  a little bit to the load, but we don't test this and the test would have
            //  failed, this would lead to some very hard to track down problems elsewhere.
            Iterator<Vertex<T>> dit = v.getDependencies().iterator();
            while (dit.hasNext())
            {
                Vertex<T> dv =  dit.next();
                if (!vertices.contains(dv))
                {
                    throw new IllegalStateException("A dependent vertex ("
                            + dv.getName() + ") of " + "vertex (" + v.getName()
                            + ") was not included in the vertices list.");
                }
            }

            v.resolveOrder();
        }
    }
13639
def package_depends_on(self, name_a, name_b):
        
        assert self._context
        if self._dependency_lookup is None:
            self._dependency_graph = self._context.get_dependency_graph()
            self._dependency_lookup = accessibility(self._dependency_graph)

        downstream = self._dependency_lookup.get(name_a, [])
        accessible = (name_b in downstream)
        if accessible:
            neighbours = self._dependency_graph.neighbors(name_a)
            return 2 if name_b in neighbours else 1
        else:
            return 0
482257
protected void addDependent(Node nodeToAdd) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "addDependent entry: node to add: " + nodeToAdd);
        }
        dependents.add(nodeToAdd);
    }
363160
def _add_to_graph(self, term, parents):
        
        if self._frozen:
            raise ValueError(
                "Can't mutate %s after construction." % type(self).__name__
            )

        # If we've seen this node already as a parent of the current traversal,
        # it means we have an unsatisifiable dependency.  This should only be
        # possible if the term's inputs are mutated after construction.
        if term in parents:
            raise CyclicDependency(term)

        parents.add(term)

        self.graph.add_node(term)

        for dependency in term.dependencies:
            self._add_to_graph(dependency, parents)
            self.graph.add_edge(dependency, term)

        parents.remove(term)
1277520
def make_dep_graph(depender):
	
	shutit_global.shutit_global_object.yield_to_draw()
	digraph = ''
	for dependee_id in depender.depends_on:
		digraph = (digraph + '"' + depender.module_id + '"->"' + dependee_id + '";\n')
	return digraph
1058936
def _maintain_dep_graph(self, p_todo):
        
        dep_id = p_todo.tag_value('id')
        # maintain dependency graph
        if dep_id:
            self._parentdict[dep_id] = p_todo
            self._depgraph.add_node(hash(p_todo))

            # connect all tasks we have in memory so far that refer to this
            # task
            for dep in \
                    [dep for dep in self._todos if dep.has_tag('p', dep_id)]:

                self._add_edge(p_todo, dep, dep_id)

        for dep_id in p_todo.tag_values('p'):
            try:
                parent = self._parentdict[dep_id]
                self._add_edge(parent, p_todo, dep_id)
            except KeyError:
                pass
21094
def ind_nodes(self, graph=None):
        
        if graph is None:
            graph = self.graph

        dependent_nodes = set(
            node for dependents in six.itervalues(graph) for node in dependents
        )
        return [node for node in graph.keys() if node not in dependent_nodes]
724664
private void loadGraph() throws ServiceException {
    dependencies.clear();

    logger.info("Loading dependency graph");

    // Parse the deps.js file.
    ErrorManager errorManager = new LoggerErrorManager(logger);
    DepsFileParser parser =
        new DepsFileParser(errorManager);
    List<DependencyInfo> depInfos =
        parser.parseFile(getName(), getContent());

    // Ensure the parse succeeded.
    if (!parser.didParseSucceed()) {
      throw new ServiceException("Problem parsing " + getName()
          + ". See logs for details.");
    }
    // Incorporate the dependencies into our maps.
    for (DependencyInfo depInfo : depInfos) {
      for (String provide : depInfo.getProvides()) {
        DependencyInfo existing = dependencies.get(provide);
        if (existing != null && !existing.equals(depInfo)) {
          throw new ServiceException("Duplicate provide of " + provide
              + ". Was provided by " + existing.getPathRelativeToClosureBase()
              + " and " + depInfo.getPathRelativeToClosureBase());
        }
        dependencies.put(provide, depInfo);
      }
    }

    List<String> provides = new ArrayList<>();
    provides.add(CLOSURE_BASE_PROVIDE);

    // Add implicit base.js entry.
    dependencies.put(
        CLOSURE_BASE_PROVIDE,
        SimpleDependencyInfo.builder(CLOSURE_BASE, CLOSURE_BASE).setProvides(provides).build());
    errorManager.generateReport();

    logger.info("Dependencies loaded");
  }
176724
function depends (targets) {
    debug('Depends: start parse dependencies');
    targets = prepare.targets(targets).filter(directories);
    debug('Depends: target : ' + targets);
    targets.forEach(parse_node_module);
}
1116879
private static Set<Artifact> getTransitiveDependencies(AbstractWisdomMojo mojo, DependencyGraphBuilder graph,
                                                           ArtifactFilter filter) {
        Set<Artifact> artifacts;
        artifacts = new LinkedHashSet<>();
        try {
            Set<Artifact> transitives = new LinkedHashSet<>();
            DependencyNode node = graph.buildDependencyGraph(mojo.project, filter);
            node.accept(new ArtifactVisitor(mojo, transitives));
            mojo.getLog().debug(transitives.size() + " transitive dependencies have been collected : " +
                    transitives);

            // Unfortunately, the retrieved artifacts are not resolved, we need to find their 'surrogates' in the
            // resolved list.
            Set<Artifact> resolved = mojo.project.getArtifacts();
            for (Artifact a : transitives) {
                Artifact r = getArtifact(a, resolved);
                if (r == null) {
                    mojo.getLog().warn("Cannot find resolved artifact for " + a);
                } else {
                    artifacts.add(r);
                }
            }
        } catch (DependencyGraphBuilderException e) {
            mojo.getLog().error("Cannot traverse the project's dependencies to collect transitive dependencies, " +
                    "ignoring transitive");
            mojo.getLog().debug("Here is the thrown exception having disabled the transitive dependency collection", e);
            artifacts = mojo.project.getDependencyArtifacts();
        }
        return artifacts;
    }
828028
public Graph<String> requiresTransitiveGraph(Configuration cf,
                                                 Set<String> roots)
    {
        Deque<String> deque = new ArrayDeque<>(roots);
        Set<String> visited = new HashSet<>();
        Graph.Builder<String> builder = new Graph.Builder<>();

        while (deque.peek() != null) {
            String mn = deque.pop();
            if (visited.contains(mn))
                continue;

            visited.add(mn);
            builder.addNode(mn);
            cf.findModule(mn).get()
              .reference().descriptor().requires().stream()
              .filter(d -> d.modifiers().contains(TRANSITIVE)
                                || d.name().equals("java.base"))
              .map(Requires::name)
              .forEach(d -> {
                  deque.add(d);
                  builder.addEdge(mn, d);
              });
        }

        return builder.build().reduce();
    }