code: def load(dataset):
      basedir = os.path.dirname(os.path.abspath(__file__))
      datadir = os.path.join(basedir, "data", dataset)
  
      if not os.path.exists(datadir):
          download(dataset, datadir)
          graphs, diff = process(dataset)
          feat, adj, labels = [], [], []
  
          for idx, graph in enumerate(graphs):
              adj.append(nx.to_numpy_array(graph))
              labels.append(graph.graph["label"])
              feat.append(
                  np.array(
                      list(
                          nx.get_node_attributes(graph, "feat").values()
                      )
                  )
              )
  
          adj, diff, feat, labels = (
              np.array(adj),
              np.array(diff),
              np.array(feat),
              np.array(labels),
          )
  
          np.save(f"{datadir}/adj.npy", adj)
          np.save(f"{datadir}/diff.npy", diff)
          np.save(f"{datadir}/feat.npy", feat)
          np.save(f"{datadir}/labels.npy", labels)
      else:
          adj = np.load(f"{datadir}/adj.npy", allow_pickle=True)
          diff = np.load(f"{datadir}/diff.npy", allow_pickle=True)
          feat = np.load(f"{datadir}/feat.npy", allow_pickle=True)
          labels = np.load(f"{datadir}/labels.npy", allow_pickle=True)
  
      n_graphs = adj.shape[0]
  
      graphs = []
      diff_graphs = []
      lbls = []
  
      for i in range(n_graphs):
          a = adj[i]
          edge_indexes = a.nonzero()
  
          graph = dgl.graph(edge_indexes)
          graph = graph.add_self_loop()
          graph.ndata["feat"] = th.tensor(feat[i]).float()
  
          diff_adj = diff[i]
          diff_indexes = diff_adj.nonzero()
          diff_weight = th.tensor(diff_adj[diff_indexes]).float()
  
          diff_graph = dgl.graph(diff_indexes)
          diff_graph.edata["edge_weight"] = diff_weight
          label = labels[i]
          graphs.append(graph)
          diff_graphs.append(diff_graph)
          lbls.append(label)
  
      labels = th.tensor(lbls)
  
      dataset = TUDataset(graphs, diff_graphs, labels)
      return dataset
  
file_path: dgl/examples/pytorch/mvgrl/graph/dataset.py
imports: import os
  import re
  from collections import Counter
  import dgl
  import networkx
  import numpy
  import torch
  from dgl.data import DGLDataset
  from scipy.linalg import fractional_matrix_power, inv
label_desc: Use image node_id 4 for calling a global function with example usage: load(dataset) and returns: dataset