code: def get_graph(network_data, vocab):
      """Build graph, treat all nodes as the same type
  
      Parameters
      ----------
      network_data: a dict
          keys describing the edge types, values representing edges
      vocab: a dict
          mapping node IDs to node indices
      Output
      ------
      DGLGraph
          a heterogenous graph, with one node type and different edge types
      """
      graphs = []
  
      node_type = "_N"  # '_N' can be replaced by an arbitrary name
      data_dict = dict()
      num_nodes_dict = {node_type: len(vocab)}
  
      for edge_type in network_data:
          tmp_data = network_data[edge_type]
          src = []
          dst = []
          for edge in tmp_data:
              src.extend([vocab[edge[0]], vocab[edge[1]]])
              dst.extend([vocab[edge[1]], vocab[edge[0]]])
          data_dict[(node_type, edge_type, node_type)] = (src, dst)
      graph = dgl.heterograph(data_dict, num_nodes_dict)
  
      return graph
  
imports: import math
  import os
  import sys
  import time
  from collections import defaultdict
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from numpy import random
  from torch.nn.parameter import Parameter
  from tqdm.auto import tqdm
  from utils import *
  import dgl
  import dgl.function
label_desc: Use image node_id 1 for calling a global function with example usage: get_graph(network_data, vocab) and returns: graph