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

Before Change


        if edge_attrs is not None:
            attr_dict = {attr : [] for attr in edge_attrs}
            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:

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):
                    for key in edge_attrs:
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: facebookresearch/visdom
Commit Name: fdcf52062d7c5884e37646685560c7cf42ccade3
Time: 2017-10-31
Author: jju@fb.com
File Name: py/__init__.py
Class Name: Visdom
Method Name: scatter


Project Name: senarvi/theanolm
Commit Name: bcf723a2f67a372e6b03a453149a82ecf2766fff
Time: 2015-12-24
Author: seppo.git@marjaniemi.com
File Name: theanolm/iterators.py
Class Name: ShufflingBatchIterator
Method Name: set_state