Get all the nodes that are common to both networks.
12169
def get_shared_nodes(G1: nx.DiGraph, G2: nx.DiGraph) -> List[str]:
    """"""
    return list(set(G1.nodes()).intersection(set(G2.nodes())))
267838
def get_networks_by_ids(self, network_ids: Iterable[int]) -> List[Network]:
        
        log.debug('getting networks by identifiers: %s', network_ids)
        return self.session.query(Network).filter(Network.id_in(network_ids)).all()
499493
def get_many(self, uris):
        
        nodes = {}

        for uri in uris:
            try:
                node = self.get(uri)
            except NodeDoesNotExist:
                continue
            else:
                nodes[uri] = node

        return nodes
526892
def all_nodes
      collection = connection[nodes_collection]
      collection.find.batch_size(999).projection(_id: 1).map { |k| k[:_id] }
    end
332213
def _edge_both_nodes(nodes: List[Node]):
        """"""
        node_ids = [node.id for node in nodes]

        return and_(
            Edge.source_id.in_(node_ids),
            Edge.target_id.in_(node_ids),
        )
658439
def get_all_edge_nodes(self):
        """"""
        edge_nodes = set(e for es in self.edges for e in es)
        for edges in self.edges_rel.values():
            rel_nodes = set(e for es in edges for e in es)
            edge_nodes.update(rel_nodes)
        return edge_nodes
292503
def _find_common_roots(paths):
    """"""
    paths = [x.split(os.path.sep) for x in paths]
    root = {}
    for chunks in sorted(paths, key=len, reverse=True):
        node = root
        for chunk in chunks:
            node = node.setdefault(chunk, {})
        node.clear()

    rv = set()

    def _walk(node, path):
        for prefix, child in iteritems(node):
            _walk(child, path + (prefix,))
        if not node:
            rv.add("/".join(path))

    _walk(root, ())
    return rv
1314783
def get_nodes(graph: BELGraph, node_predicates: NodePredicates) -> Set[BaseEntity]:
    """"""
    return set(filter_nodes(graph, node_predicates=node_predicates))
123968
def all_network_files():
    """"""
    # TODO: list explicitly since some are missing?
    network_types = [
        'AND-circle',
        'MAJ-specialized',
        'MAJ-complete',
        'iit-3.0-modular'
    ]
    network_sizes = range(5, 8)
    network_files = []
    for n in network_sizes:
        for t in network_types:
            network_files.append('{}-{}'.format(n, t))
    return network_files
868499
protected void findCorrelatedNodes(CorrelationIdentifier cid, Set<Node> nodes) {
        if (isCorrelated(cid)) {
            nodes.add(this);
        }
    }
1326563
def resolve_nodes(self, nodes):
        
        if not nodes:
            return []
        resolved = []
        for node in nodes:
            if node in resolved:
                continue
            self.resolve_node(node, resolved)
        return resolved
193075
def get_all():
    
    result = {}
    for k,v in nago.extensions.info.node_data.items():
        result[k] = v.get('facts', {})
    return result
346680
def find_all(self, prefix):
        '''
        
        '''
        prefix = ip_network(prefix)

        # Check that we are authoritative for the given prefix
        if not self.prefix.overlaps(prefix) \
        or self.prefix[0] > prefix[0] \
        or self.prefix[-1] < prefix[-1]:
            raise NotAuthoritativeError('This node is not authoritative for %r'
                                        % prefix)

        # Find all matching existing prefixes and return them in a set
        matches = set()
        for child in self.children:
            if prefix.overlaps(child.prefix):
                matches.add(child)

        return matches
733384
public static Map<String, String> commonTags() {
    final Map<String, String> commonTags = new HashMap<>();
    put(commonTags, "nf.app", Env.app());
    put(commonTags, "nf.cluster", Env.cluster());
    put(commonTags, "nf.asg", Env.asg());
    put(commonTags, "nf.stack", Env.stack());
    put(commonTags, "nf.zone", Env.zone());
    put(commonTags, "nf.vmtype", Env.vmtype());
    put(commonTags, "nf.node", Env.instanceId());
    put(commonTags, "nf.region", Env.region());
    put(commonTags, "nf.account", Env.accountId());
    put(commonTags, "nf.task", Env.task());
    put(commonTags, "nf.job", Env.job());
    return commonTags;
  }
34228
def get_nodes_by_hashes(self, node_hashes: List[str]) -> List[Node]:
        """"""
        return self.session.query(Node).filter(Node.sha512.in_(node_hashes)).all()
463160
def get_networks(self, contents):
        
        schema = NetworksSchema()
        resp = self.service.post(self.base,
                                 params={'process': 'networks'}, json={'contents': contents})
        return self.service.decode(schema, resp)
272206
def get_networks(network_id=None):
    """"""
    session = db.get_reader_session()
    with session.begin():
        model = models_v2.Network
        networks = session.query(model).filter(model.project_id != '')
        if network_id:
            networks = networks.filter(model.id == network_id)
    return networks.all()