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

Before Change


            else:
                return F.tensor(lst)
        if node_attrs is not None:
            attr_dict = {attr : [] for attr in node_attrs}
            for nid in range(self.number_of_nodes()):
                for attr in node_attrs:
                    attr_dict[attr].append(nx_graph.nodes[nid][attr])
            for attr in node_attrs:

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: 5

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: 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: execute


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