def _formDirected(g, match):
    """Form directed graph D from G and matching M.

    Parameters
    ----------
    g :
        Undirected bipartite graph. Nodes are separated by their
        'bipartite' attribute.
    match :
        List of edges forming a matching of `g`.

    Returns
    -------
    networkx.DiGraph
	    Directed graph, with edges in `match` pointing from set-0
	    (bipartite attribute==0) to set-1 (bipartite attrbiute==1), and
	    the other edges in `g` but not in `match` pointing from set-1 to
	    set-0.

    """
    import networkx as nx
    d = nx.DiGraph()
    for ee in g.edges():
        if ee in match or (ee[1], ee[0]) in match:
            if g.nodes[ee[0]]['bipartite'] == 0:
                d.add_edge(ee[0], ee[1])
            else:
                d.add_edge(ee[1], ee[0])
        elif g.nodes[ee[0]]['bipartite'] == 0:
            d.add_edge(ee[1], ee[0])
        else:
            d.add_edge(ee[0], ee[1])
    return d
