'Return True if the graph has an edge between nodes u and v.
Parameters
u, v : nodes
Nodes can be, for example, strings or numbers.
key : hashable identifier, optional (default=None)
If specified return True only if the edge with
key is found.
Returns
edge_ind : bool
True if edge is in the graph, False otherwise.
Examples
Can be called either using two nodes u, v, an edge tuple (u, v),
or an edge tuple (u, v, key).
>>> G = nx.MultiGraph()   # or MultiDiGraph
>>> nx.add_path(G, [0, 1, 2, 3])
>>> G.has_edge(0, 1)  # using two nodes
True
>>> e = (0, 1)
>>> G.has_edge(*e)  #  e is a 2-tuple (u, v)
True
>>> G.add_edge(0, 1, key=\'a\')
\'a\'
>>> G.has_edge(0, 1, key=\'a\')  # specify key
True
>>> e=(0, 1, \'a\')
>>> G.has_edge(*e) # e is a 3-tuple (u, v, \'a\')
True
The following syntax are equivalent:
>>> G.has_edge(0, 1)
True
>>> 1 in G[0]  # though this gives :exc:`KeyError` if 0 not in G
True'

def has_edge(self, u, v, key=None):

    try:
        if (key is None):
            return (v in self._adj[u])
        else:
            return (key in self._adj[u][v])
    except KeyError:
        return False
