0a51dc5435bc49075605bffbaa20ca2eaec7782c,python/dgl/heterograph.py,DGLHeteroGraph,get_ntype_id_from_dst,#DGLHeteroGraph#Any#,577

Before 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 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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: dmlc/dgl
Commit Name: 0a51dc5435bc49075605bffbaa20ca2eaec7782c
Time: 2020-03-18
Author: coin2028@hotmail.com
File Name: python/dgl/heterograph.py
Class Name: DGLHeteroGraph
Method Name: get_ntype_id_from_dst


Project Name: reinforceio/tensorforce
Commit Name: 4ae93820517945aa7c33fecccc1d32f9c58da722
Time: 2017-12-23
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/environments/minimal_test.py
Class Name: MinimalTest
Method Name: reset


Project Name: dmlc/dgl
Commit Name: 0a51dc5435bc49075605bffbaa20ca2eaec7782c
Time: 2020-03-18
Author: coin2028@hotmail.com
File Name: python/dgl/heterograph.py
Class Name: DGLHeteroGraph
Method Name: get_ntype_id_from_src