a dictionary from type name to type id. Return None if the graph is
not uni-bipartite.
src, dst, _ = metagraph.edges()
if set(src.tonumpy()).isdisjoint(set(dst.tonumpy())):
srctypes = {ntypes[tid] : tid for tid in src}
dsttypes = {ntypes[tid] : tid for tid in dst}
// handle isolated node types
After Change
if ret is None:
return None
else:
src, dst = ret
srctypes = {ntypes[tid.data] : tid.data for tid in src}
dsttypes = {ntypes[tid.data] : tid.data for tid in dst}
return srctypes, dsttypes