human
Complete this python program:
def _edge_func(G):
assistant
#Here is the Python code you requested.

    """Returns the edges from G, handling keys for multigraphs as necessary.
    """
    if G.is_multigraph():
        def get_edges(nbunch=None):
            return G.edges(nbunch, keys=True)
    else:
        def get_edges(nbunch=None):
            return G.edges(nbunch)
    return get_edges