

def nodes(self, data=False):
    "Return an iterator over the nodes.\n\n        Parameters\n        ----------\n        data : boolean, optional (default=False)\n               If False the iterator returns nodes.  If True\n               return a two-tuple of node and node data dictionary\n\n        Returns\n        -------\n        niter : iterator\n            An iterator over nodes.  If data=True the iterator gives\n            two-tuples containing (node, node data, dictionary)\n\n        Notes\n        -----\n        If the node data is not required it is simpler and equivalent\n        to use the expression 'for n in G'.\n\n        >>> G = nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc\n        >>> G.add_path([0,1,2])\n\n        Examples\n        --------\n        >>> G = nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc\n        >>> G.add_path([0,1,2])\n\n        >>> [d for n,d in G.nodes(data=True)]\n        [{}, {}, {}]\n        "
    if data:
        return iter(self.node.items())
    return iter(self.node)

dataset/ETHPy150Open networkx/networkx/networkx/classes/tests/timingclasses.py TimingGraph.nodes/original