if len(self._dsttypes_invmap) != 1:
raise DGLError("DST node type name must be specified if there are more than one "
"DST node types.")
return 0
ntid = self._dsttypes_invmap.get(ntype, None)
if ntid is None:
raise DGLError("DST node type "{}" does not exist.".format(ntype))
return ntid
After Change
if len(self._dsttypes_invmap) != 1:
raise DGLError("DST node type name must be specified if there are more than one "
"DST node types.")
return next(iter(self._dsttypes_invmap.values()))
ntid = self._dsttypes_invmap.get(ntype, None)
if ntid is None:
raise DGLError("DST node type "{}" does not exist.".format(ntype))
return ntid