Return a list of nodes on whom the specific node is control dependent in the control dependence graph
164739
def get_guardians(self, run):
        
        if run in self._graph.nodes():
            return list(self._graph.predecessors(run))
        else:
            return []
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;
    }
825081
public List<TypedDependency> getStanfordTypedDependencies(DependencyForm form) {
        List<TypedDependency> dependencies = new ArrayList<TypedDependency>();
        if (this.nodes == null)
        	nodes = getStanfordTreeGraphNodes(form);

        List<AgigaTypedDependency> agigaDeps = getAgigaDeps(form);
        for (AgigaTypedDependency agigaDep : agigaDeps) {
            // Add one, since the tokens are zero-indexed but the TreeGraphNodes are one-indexed
            TreeGraphNode gov = nodes.get(agigaDep.getGovIdx() + 1);
            TreeGraphNode dep = nodes.get(agigaDep.getDepIdx() + 1);
            // Create the typed dependency
            TypedDependency typedDep = new TypedDependency(GrammaticalRelation.valueOf(agigaDep.getType()), gov, dep);
            dependencies.add(typedDep);
        }
        return dependencies;
    }
583085
def get_child_nodes(docgraph, parent_node_id, data=False):
    """"""
    return select_neighbors_by_edge_attribute(
        docgraph=docgraph,
        source=parent_node_id,
        attribute='edge_type',
        value=[EdgeTypes.dominance_relation],
        data=data)
271213
public static Collection<TypedDependency> getRoots(Collection<TypedDependency> list) {

    Collection<TypedDependency> roots = new ArrayList<TypedDependency>();

    // need to see if more than one governor is not listed somewhere as a dependent
    // first take all the deps
    Collection<TreeGraphNode> deps = new HashSet<TreeGraphNode>();
    for (TypedDependency typedDep : list) {
      deps.add(typedDep.dep());
    }

    // go through the list and add typedDependency for which the gov is not a dep
    Collection<TreeGraphNode> govs = new HashSet<TreeGraphNode>();
    for (TypedDependency typedDep : list) {
      TreeGraphNode gov = typedDep.gov();
      if (!deps.contains(gov) && !govs.contains(gov)) {
        roots.add(typedDep);
      }
      govs.add(gov);
    }
    return roots;
  }
524463
def find_recursive_dependency(self):
    """"""
    nodes_on_path = []

    def helper(nodes):
      for node in nodes:
        cycle = node in nodes_on_path
        nodes_on_path.append(node)
        if cycle or helper(self.deps.get(node, [])):
          return True
        nodes_on_path.pop()
      return False

    helper(self.unordered)
    return nodes_on_path
556663
public void addDependencyGraph(DAGraph<DataT, NodeT> dependencyGraph) {
        this.rootNode.addDependency(dependencyGraph.rootNode.key());
        Map<String, NodeT> sourceNodeTable = dependencyGraph.nodeTable;
        Map<String, NodeT> targetNodeTable = this.nodeTable;
        this.merge(sourceNodeTable, targetNodeTable);
        dependencyGraph.parentDAGs.add(this);
        if (this.hasParents()) {
            this.bubbleUpNodeTable(this, new LinkedList<String>());
        }
    }
569274
private static boolean nodesHaveSameControlFlow(Node node1, Node node2) {
    /*
     * We conservatively approximate this with the following criteria:
     *
     * Define the "deepest control dependent block" for a node to be the
     * closest ancestor whose *parent* is a control structure and where that
     * ancestor may or may be executed depending on the parent.
     *
     * So, for example, in:
     * if (a) {
     *  b;
     * } else {
     *  c;
     * }
     *
     * a has not deepest control dependent block.
     * b's deepest control dependent block is the "then" block of the IF.
     * c's deepest control dependent block is the "else" block of the IF.
     *
     * We'll say two nodes have the same control flow if
     *
     * 1) they have the same deepest control dependent block
     * 2) that block is either a CASE (which can't have early exits) or it
     * doesn't have any early exits (e.g. breaks, continues, returns.)
     *
     */

    Node node1DeepestControlDependentBlock =
        closestControlDependentAncestor(node1);

    Node node2DeepestControlDependentBlock =
      closestControlDependentAncestor(node2);

    if (node1DeepestControlDependentBlock ==
        node2DeepestControlDependentBlock) {

      if (node2DeepestControlDependentBlock != null) {
        // CASE is complicated because we have to deal with fall through and
        // because some BREAKs are early exits and some are not.
        // For now, we don't allow movement within a CASE.
        //
        // TODO(dcc): be less conservative about movement within CASE
        if (node2DeepestControlDependentBlock.isCase()) {
          return false;
        }

        // Don't allow breaks, continues, returns in control dependent
        // block because we don't actually create a control-flow graph
        // and so don't know if early exits site between the source
        // and the destination.
        //
        // This is overly conservative as it doesn't allow, for example,
        // moving in the following case:
        // while (a) {
        //   source();
        //
        //   while(b) {
        //     break;
        //   }
        //
        //   destination();
        // }
        //
        // To fully support this kind of movement, we'll probably have to use
        // a CFG-based analysis rather than just looking at the AST.
        //
        // TODO(dcc): have nodesHaveSameControlFlow() use a CFG
        Predicate<Node> isEarlyExitPredicate =
            new Predicate<Node>() {
              @Override
              public boolean apply(Node input) {
                Token nodeType = input.getToken();

                return nodeType == Token.RETURN
                    || nodeType == Token.BREAK
                    || nodeType == Token.CONTINUE;
              }
            };

        return !NodeUtil.has(node2DeepestControlDependentBlock,
            isEarlyExitPredicate, NOT_FUNCTION_PREDICATE);
      } else {
        return true;
      }
    } else {
      return false;
    }
  }
1349319
public Graph<Node> dependenceGraph() {
        Graph.Builder<Node> builder = new Graph.Builder<>();

        archives().stream()
            .map(analyzer.results::get)
            .filter(deps -> !deps.dependencies().isEmpty())
            .flatMap(deps -> deps.dependencies().stream())
            .forEach(d -> addEdge(builder, d));
        return builder.build();
    }
896326
def get_dependants(self, run):
        
        if run in self._graph.nodes():
            return list(self._graph.successors(run))
        else:
            return []
628940
def getControls(self):
        '''
        
        '''
        t = self.t_cycle[0]
        i = self.MrkvNow[0]
        self.cNrmNow = self.solution[t].cFunc[i](self.mNrmNow)
1061671
def getRequiredNodes(self):
        
        return {nodeShape:len(self.nodeReservations[nodeShape]) for nodeShape in self.nodeShapes}
1265140
function _buildDependencyTreeOf(node) {
		var requireStatements = getRequireStatements(getCode(node.path))
		if (requireStatements.length == 0) {
			return leaves.push(node)
		}
		each(requireStatements, function(requireStatement) {
			var childNode = []
			childNode.path = resolve.requireStatement(requireStatement, node.path)
			childNode.parent = node
			node.push(childNode)
			_buildDependencyTreeOf(childNode)
		})
		node.waitingForNumChildren = node.length
	}
746762
def getnodes(self, name):
        "'"
        for node in self.nodes:
            if striptag(node.tag) == name:
                yield node
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))
1317283
public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) {
        for (Object o : this) {
            if (o instanceof DependencyDeclarer) {
                DependencyDeclarer dd = (DependencyDeclarer) o;
                try {
                    dd.buildDependencyGraph(owner,graph);
                } catch (RuntimeException e) {
                    LOGGER.log(Level.SEVERE, "Failed to build dependency graph for " + owner,e);
                }
            }
        }
    }
1045413
def _get_all_descendants(self):
        
        descendants = set()
        descendants = descendants.union(self.child_nodes)
        for child in self.child_nodes:
            descendants = descendants.union(child._get_all_descendants())

        if self in descendants:
            log.error('circular dependancy found in %s. Descendants: %s ', self, descendants)
            raise CircularDependency('Node %s contains itself in it\'s list of dependencies.' % (self.job.name,))
        return descendants