

def number_of_edges(self, u=None, v=None):
    'Return the number of edges between two nodes.\n\n        Parameters\n        ----------\n        u,v : nodes, optional (default=all edges)\n            If u and v are specified, return the number of edges between\n            u and v. Otherwise return the total number of all edges.\n\n        Returns\n        -------\n        nedges : int\n            The number of edges in the graph.  If nodes u and v are specified\n            return the number of edges between those nodes.\n\n        See Also\n        --------\n        size\n\n        Examples\n        --------\n        >>> G = nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc\n        >>> G.add_path([0,1,2,3])\n        >>> G.number_of_edges()\n        3\n        >>> G.number_of_edges(0,1)\n        1\n        >>> e = (0,1)\n        >>> G.number_of_edges(*e)\n        1\n        '
    if (u is None):
        return int(self.size())
    if (v in v.adj[u]):
        return 1
    else:
        return 0

dataset/ETHPy150Open networkx/networkx/networkx/classes/tests/timingclasses.py TimingGraph.number_of_edges/VarMisuse@44/360 `self`->`v`