70d475813cbcd73a83014af06f610b51788a2b9e,python/dgl/graph_index.py,GraphIndex,from_networkx,#GraphIndex#Any#,530

Before Change



        num_nodes = nx_graph.number_of_nodes()
        self.add_nodes(num_nodes)
        has_edge_id = "id" in next(iter(nx_graph.edges))
        if has_edge_id:
            num_edges = nx_graph.number_of_edges()
            src = np.zeros((num_edges,), dtype=np.int64)

After Change


            return

        // nx_graph.edges(data=True) returns src, dst, attr_dict
        has_edge_id = "id" in next(iter(nx_graph.edges(data=True)))[-1]
        if has_edge_id:
            num_edges = nx_graph.number_of_edges()
            src = np.zeros((num_edges,), dtype=np.int64)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dmlc/dgl
Commit Name: 70d475813cbcd73a83014af06f610b51788a2b9e
Time: 2018-10-21
Author: coin2028@hotmail.com
File Name: python/dgl/graph_index.py
Class Name: GraphIndex
Method Name: from_networkx


Project Name: facebookresearch/pytext
Commit Name: ad74fb2abd29fd14917cc80748e4eb876d663352
Time: 2019-06-09
Author: geoffreygoh@fb.com
File Name: pytext/data/test/data_test.py
Class Name: DataTest
Method Name: test_sort


Project Name: azavea/raster-vision
Commit Name: d3c5ba6fa3edaddd4814d3d5b66a18022a35afe4
Time: 2018-10-03
Author: jmcclain@azavea.com
File Name: src/rastervision/rv_config.py
Class Name: RVConfig
Method Name: set_tempdir