def bipartite_sets(bg):
    """Return two nodes sets of a bipartite graph.

    Parameters:
    -----------
    bg: nx.Graph
        Bipartite graph to operate on.

    """
    top = set(n for n, d in bg.nodes(data=True) if d['bipartite']==0)
    bottom = set(bg) - top
    return (top, bottom)