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

Before Change


            for attr in node_attrs:
                self._node_frame[attr] = _batcher(attr_dict[attr])
        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:

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:
                        attr_dict[key][attrs["id"]] = attrs[key]
            else:
                // XXX: assuming networkx iteration order is deterministic
                for eid, (_, _, attr) in enumerate(nx_graph.edges(data=True)):
                    for key in edge_attrs:
                        attr_dict[key][eid] = attrs[key]
            for attr in edge_attrs:
                self._edge_frame[attr] = _batcher(attr_dict[attr])

    def from_scipy_sparse_matrix(self, a):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

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: pgmpy/pgmpy
Commit Name: eea41a4578b5021bbc16eb171bceb453cbde2419
Time: 2014-11-30
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/models/BayesianModel.py
Class Name: BayesianModel
Method Name: add_edge


Project Name: gboeing/osmnx
Commit Name: 1633b83ed6fcd1021889ecd867581a5400aa6a2d
Time: 2020-06-16
Author: boeing@usc.edu
File Name: osmnx/simplification.py
Class Name:
Method Name: _consolidate_intersections_rebuild_graph


Project Name: RaRe-Technologies/gensim
Commit Name: b55e6d730fd6be0944f0f7808a54a00e0b7c25eb
Time: 2015-05-07
Author: fbarrios@fi.uba.ar
File Name: gensim/summarization/summarizer.py
Class Name:
Method Name: _set_graph_edge_weights