def sets(G):
 c = color(G)
 X = set((n for n in c if c[n]))
 Y = set((n for n in c if (not c[n])))
 return (X, Y)

def sets ( G ) : c = color ( G ) X = set ( ( n for n in c if c [ n ] ) ) Y = set ( ( n for n in c if ( not c [ n ] ) ) ) return ( X , Y )
returns bipartite node sets of graph g .