9b4d60799a25409506a73ef4fbaa640a9c4e9ee2,tests/compute/test_heterograph.py,,create_test_heterograph,#,11

Before Change



def create_test_heterograph():
    // test heterograph from the docstring, plus a user -- wishes -- game relation
    mg = nx.MultiDiGraph([
        ("user", "user", "follows"),
        ("user", "game", "plays"),
        ("user", "game", "wishes"),
        ("developer", "game", "develops")])

    plays_spmat = ssp.coo_matrix(([1, 1, 1, 1], ([0, 1, 2, 1], [0, 0, 1, 1])))
    g = dgl.DGLHeteroGraph((mg, {

After Change


    wishes_nx.add_edge("u0", "g1", id=0)
    wishes_nx.add_edge("u2", "g0", id=1)

    follows_g = dgl.graph([(0, 1), (1, 2)], "user", "follows")
    plays_g = dgl.bipartite(plays_spmat, "user", "plays", "game")
    wishes_g = dgl.bipartite(wishes_nx, "user", "wishes", "game")
    develops_g = dgl.bipartite([(0, 0), (1, 1)], "developer", "develops", "game")
    g = dgl.hetero_from_relations([follows_g, plays_g, wishes_g, develops_g])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dmlc/dgl
Commit Name: 9b4d60799a25409506a73ef4fbaa640a9c4e9ee2
Time: 2019-09-17
Author: wmjlyjemaine@gmail.com
File Name: tests/compute/test_heterograph.py
Class Name:
Method Name: create_test_heterograph


Project Name: ysig/GraKeL
Commit Name: 2b8a7f6cdf259893a99f6923a42388c5495fb18d
Time: 2017-11-16
Author: y.siglidis@gmail.com
File Name: grakel/graph_kernels.py
Class Name: GraphKernel
Method Name: transform


Project Name: lanpa/tensorboardX
Commit Name: 78ba1c8cfcd2c31f1e1b007d2e20e771049e869b
Time: 2018-01-04
Author: huang.dexter@gmail.com
File Name: tensorboardX/graph.py
Class Name:
Method Name: graph