code: def process(dataset):
      src = os.path.join(os.path.dirname(__file__), "data")
      prefix = os.path.join(src, dataset, dataset)
  
      # assign each node to the corresponding graph
      graph_node_dict = {}
      with open("{0}_graph_indicator.txt".format(prefix), "r") as f:
          for idx, line in enumerate(f):
              graph_node_dict[idx + 1] = int(line.strip("\n"))
  
      node_labels = []
      if os.path.exists("{0}_node_labels.txt".format(prefix)):
          with open("{0}_node_labels.txt".format(prefix), "r") as f:
              for line in f:
                  node_labels += [int(line.strip("\n")) - 1]
              num_unique_node_labels = max(node_labels) + 1
      else:
          print("No node labels")
  
      node_attrs = []
      if os.path.exists("{0}_node_attributes.txt".format(prefix)):
          with open("{0}_node_attributes.txt".format(prefix), "r") as f:
              for line in f:
                  node_attrs.append(
                      np.array(
                          [
                              float(attr)
                              for attr in re.split(
                                  "[,\s]+", line.strip("\s\n")
                              )
                              if attr
                          ],
                          dtype=np.float,
                      )
                  )
      else:
          print("No node attributes")
  
      graph_labels = []
      unique_labels = set()
      with open("{0}_graph_labels.txt".format(prefix), "r") as f:
          for line in f:
              val = int(line.strip("\n"))
              if val not in unique_labels:
                  unique_labels.add(val)
              graph_labels.append(val)
      label_idx_dict = {
          val: idx for idx, val in enumerate(unique_labels)
      }
      graph_labels = np.array([label_idx_dict[l] for l in graph_labels])
  
      adj_list = {idx: [] for idx in range(1, len(graph_labels) + 1)}
      index_graph = {idx: [] for idx in range(1, len(graph_labels) + 1)}
      with open("{0}_A.txt".format(prefix), "r") as f:
          for line in f:
              u, v = tuple(map(int, line.strip("\n").split(",")))
              adj_list[graph_node_dict[u]].append((u, v))
              index_graph[graph_node_dict[u]] += [u, v]
  
      for k in index_graph.keys():
          index_graph[k] = [u - 1 for u in set(index_graph[k])]
  
      graphs, pprs = [], []
      for idx in range(1, 1 + len(adj_list)):
          graph = nx.from_edgelist(adj_list[idx])
  
          graph.graph["label"] = graph_labels[idx - 1]
          for u in graph.nodes():
              if len(node_labels) > 0:
                  node_label_one_hot = [0] * num_unique_node_labels
                  node_label = node_labels[u - 1]
                  node_label_one_hot[node_label] = 1
                  graph.nodes[u]["label"] = node_label_one_hot
              if len(node_attrs) > 0:
                  graph.nodes[u]["feat"] = node_attrs[u - 1]
          if len(node_attrs) > 0:
              graph.graph["feat_dim"] = node_attrs[0].shape[0]
  
          # relabeling
          mapping = {}
          for node_idx, node in enumerate(graph.nodes()):
              mapping[node] = node_idx
  
          graphs.append(nx.relabel_nodes(graph, mapping))
          pprs.append(compute_ppr(graph, alpha=0.2))
  
      if "feat_dim" in graphs[0].graph:
          pass
      else:
          max_deg = max(
              [max(dict(graph.degree).values()) for graph in graphs]
          )
          for graph in graphs:
              for u in graph.nodes(data=True):
                  f = np.zeros(max_deg + 1)
                  f[graph.degree[u[0]]] = 1.0
                  if "label" in u[1]:
                      f = np.concatenate(
                          (np.array(u[1]["label"], dtype=np.float), f)
                      )
                  graph.nodes[u[0]]["feat"] = f
      return graphs, pprs
  
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 3 for calling a global function with example usage: process(dataset) and returns: graphs,  pprs