455ea48570f1af63b1270c8ccda49fbe3deb9bcc,python/dgl/graph.py,DGLGraph,from_networkx,#DGLGraph#Any#Any#Any#,1022

Before Change


            src, dst, _ = self._graph.edges()
            for u, v in zip(src.tolist(), dst.tolist()):
                for attr in edge_attrs:
                    attr_dict[attr].append(nx_graph.edges[u, v][attr])
            for attr in edge_attrs:
                self._edge_frame[attr] = _batcher(attr_dict[attr])

After Change


            for attr in node_attrs:
                self._node_frame[attr] = _batcher(attr_dict[attr])
        if edge_attrs is not None:
            has_edge_id = "id" in next(iter(nx_graph.edges(data=True)))[-1]
            attr_dict = defaultdict(lambda: [None] * self.number_of_edges())
            if has_edge_id:
                for u, v, attrs in nx_graph.edges(data=True):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: dmlc/dgl
Commit Name: 455ea48570f1af63b1270c8ccda49fbe3deb9bcc
Time: 2018-12-04
Author: ly979@nyu.edu
File Name: python/dgl/graph.py
Class Name: DGLGraph
Method Name: from_networkx


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: stellargraph/stellargraph
Commit Name: 956f06cd7860dd5387411c28890d87c70dcd8f42
Time: 2020-01-14
Author: Huon.Wilson@data61.csiro.au
File Name: tests/layer/test_rgcn.py
Class Name:
Method Name: get_As