The number of distinct networks defined by the|Node| and
        |Element| objects currently handled by the |HydPy| object.
17403
def numberofnetworks(self):
        """"""
        sels1 = selectiontools.Selections()
        sels2 = selectiontools.Selections()
        complete = selectiontools.Selection('complete',
                                            self.nodes, self.elements)
        for node in self.endnodes:
            sel = complete.copy(node.name).select_upstream(node)
            sels1 += sel
            sels2 += sel.copy(node.name)
        for sel1 in sels1:
            for sel2 in sels2:
                if sel1.name != sel2.name:
                    sel1 -= sel2
        for name in list(sels1.names):
            if not sels1[name].elements:
                del sels1[name]
        return sels1
861355
def n(type, children, source_map)
      Node.new(type, children, location: source_map)
    end
290122
def _list_nodes(full=False, for_output=False):
    '''
    
    '''
    fetch = True
    page = 1
    ret = {}

    while fetch:
        items = query(method='droplets',
                      command='?page=' + six.text_type(page) + '&per_page=200')
        for node in items['droplets']:
            name = node['name']
            ret[name] = {}
            if full:
                ret[name] = _get_full_output(node, for_output=for_output)
            else:
                public_ips, private_ips = _get_ips(node['networks'])
                ret[name] = {
                    'id': node['id'],
                    'image': node['image']['name'],
                    'name': name,
                    'private_ips': private_ips,
                    'public_ips': public_ips,
                    'size': node['size_slug'],
                    'state': six.text_type(node['status']),
                }

        page += 1
        try:
            fetch = 'next' in items['links']['pages']
        except KeyError:
            fetch = False

    return ret
148270
def n_elements(self):
        
        if self.is_array:
            return functools.reduce(operator.mul, self.array_dimensions)
        else:
            return 1
1150367
function nodes(){
    var nodeSet = {};
    Object.keys(edges).forEach(function (u){
      nodeSet[u] = true;
      edges[u].forEach(function (v){
        nodeSet[v] = true;
      });
    });
    return Object.keys(nodeSet);
  }
970726
def _get_distinct_objs(objs):
    
    ids = set()
    res = []
    for obj in objs:
        if not id(obj) in ids:
            ids.add(id(obj))
            res.append(obj)
    return res
113820
function NodeInfo() {

    /**
     * the CPU model
     * 
     * @type {String}
     */
    this.model = null;

    /**
     * memory size in kilobytes
     * @type {Number}
     */
    this.memory = 0;

    /**
     * the number of active CPUs
     * @type {Number}
     */
    this.cpus = 0;

    /**
     * expected CPU frequency
     * @type {Number}
     */
    this.mhz = 0;

    /**
     * the number of NUMA cell, 1 for unusual NUMA topologies or uniform memory
     * access; check capabilities XML for the actual NUMA topology
     * @type {Number}
     */
    this.nodes = 0;

    /**
     * number of CPU sockets per node if nodes > 1, 1 in case of unusual NUMA
     * topology
     * @type {Number}
     */
    this.sockets = 0;

    /**
     * number of cores per socket, total number of processors in case of
     * unusual NUMA topolog
     * @type {Number}
     */
    this.cores = 0;

    /**
     * number of threads per core, 1 in case of unusual numa topology
     * @type {Number}
     */
    this.threads = 0;

}
546894
private int getNumRnaNodes(Collection<KamNode> nodes) {
        int count = 0;
        for (KamNode node : nodes) {
            if (node.getFunctionType() == FunctionEnum.RNA_ABUNDANCE) {
                count++;
            }
        }
        return count;
    }
1107937
def node(o)
      @nodes.fetch(o.object_id) do
        new_node = @g.add_nodes new_node_name, node_options(o)
        @nodes[o.object_id] = new_node
        each_child_node_of(o) {|_| new_node << node(_) }
        new_node
      end
    end
930848
def nodes(self):
        
        nodes = np.array(list(self.transforms.nodes()))
        return nodes
1256123
def function_nodes(self):
        

        return {k: v for k, v in self.nodes.items() if v['type'] == 'function'}
928549
def computeNodeValues(cls, graph):
        
        for node in graph['nodes']:
            source_val = np.sum([l['value'] for l in node['sourceLinks']])
            target_val = np.sum([l['value'] for l in node['targetLinks']])
            node['value'] = max([source_val, target_val])
660016
def inspect
      edge_count = @nodes.values.each_with_object(Set.new) do |node, edges|
        edges.merge(node.edges(:out))
      end.length

      "#<#{self.class} (#{ @nodes.length } nodes, #{ edge_count } edges)>"
    end
498240
def _resolve_duplicates(self):
        '''
        
        '''
        self._initialize_graph_status_for_traversing()

        # Traverse the graph from roots to leaves
        for operator in self.topological_operator_iterator():
            if operator.type != 'identity':
                continue

            if any(variable.is_root for variable in operator.inputs) and \
                    any(variable.is_leaf for variable in operator.outputs):
                continue

            # Replace the output variable with the input variable everywhere
            original = operator.inputs[0]
            duplicate = operator.outputs[0]
            for another_scope in self.scopes:
                for another_operator in another_scope.operators.values():
                    for i in range(len(another_operator.inputs)):
                        if another_operator.inputs[i].onnx_name != duplicate.onnx_name:
                            continue
                        another_operator.inputs[i] = original

            # When original variable's documentation string or denotation is empty but duplicate's is not, we
            # copy that field to the original variable to avoid information loss.
            if not original.type.doc_string and duplicate.type.doc_string:
                original.type.doc_string = duplicate.type.doc_string

            if isinstance(original.type, TensorType) and isinstance(duplicate.type, TensorType):
                if not original.type.denotation and duplicate.type.denotation:
                    original.type.denotation = duplicate.type.denotation
                if not original.type.channel_denotations:
                    original.type.channel_denotations = duplicate.type.channel_denotations
                elif duplicate.type.channel_denotations:
                    # Merge the channel denotations if available in both the original and the duplicate
                    for i in range(len(original.type.channel_denotations)):
                        if original.type.channel_denotations[i]:
                            continue
                        original.type.channel_denotations[i] = duplicate.type.channel_denotations[i]
                # Sometime, shapes of duplicates are different. We try to replace the original variable's unknown dimensions
                # as many as possible because we will get rid of the duplicate.
                if len(original.type.shape) == len(duplicate.type.shape):
                    for i in range(len(original.type.shape)):
                        if original.type.shape[i] != 'None':
                            continue
                        original.type.shape[i] = duplicate.type.shape[i]

            # Because we're iterating through the topology, we cannot delete any operator or variable. Otherwise,
            # the traversing function may be broken. We will delete those abandoned ones later.
            duplicate.is_abandoned = True
            operator.is_abandoned = True

        for scope in self.scopes:
            # Find out who is going to be abandoned
            abandoned_operator_names = set(onnx_name for onnx_name, operator in scope.operators.items()
                                           if operator.is_abandoned)
            abandoned_variable_names = set(onnx_name for onnx_name, variable in scope.variables.items()
                                           if variable.is_abandoned)

            # Remove abandoned operators
            for name in abandoned_operator_names:
                scope.delete_local_operator(name)

            # Remove abandoned variables
            for name in abandoned_variable_names:
                scope.delete_local_variable(name)
403050
int numNodes(Block b) {
    BlockInfo info = blocks.get(b);
    return info == null ? 0 : info.numNodes();
  }
2674
def n_atom(self, node):
        
        length = len(node)
        if length == 1:
            self.preorder(node[0])
            node.value = node[0].value
            self.prune()
        elif length == 3:
            self.preorder(node[1])
            node.value = node[1].value
            self.prune()
        else:
            assert False, "Expecting atom to have length 1 or 3"
1272151
def get_coordination_of_site(self, n):
        
        number_of_self_loops = sum([1 for n, v in self.graph.edges(n) if n == v])
        return self.graph.degree(n) - number_of_self_loops