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
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):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
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: home-assistant/home-assistant
Commit Name: 29b62f814faed976744121531e0dca214331020e
Time: 2017-09-12
Author: jlmcgehee21@gmail.com
File Name: homeassistant/components/binary_sensor/bayesian.py
Class Name: BayesianBinarySensor
Method Name: __init__
Project Name: HazyResearch/fonduer
Commit Name: a3400845afb88d0d9b19f7f810abbd718117f24e
Time: 2018-10-17
Author: lukehsiao@users.noreply.github.com
File Name: src/fonduer/utils/utils_udf.py
Class Name:
Method Name: get_sparse_matrix