code: def generate_graph_old(grad=False):
      g = dgl.graph([])
      g.add_nodes(10)  # 10 nodes
      # create a graph where 0 is the source and 9 is the sink
      # 17 edges
      for i in range(1, 9):
          g.add_edges(0, i)
          g.add_edges(i, 9)
      # add a back flow from 9 to 0
      g.add_edges(9, 0)
      g = g.to(F.ctx())
      ncol = F.randn((10, D))
      ecol = F.randn((17, D))
      if grad:
          ncol = F.attach_grad(ncol)
          ecol = F.attach_grad(ecol)
  
      g.ndata["h"] = ncol
      g.edata["w"] = ecol
      g.set_n_initializer(dgl.init.zero_initializer)
      g.set_e_initializer(dgl.init.zero_initializer)
      return g
  
imports: import warnings
  from collections import defaultdict
  import backend
  import dgl
  import networkx
  import numpy
  from utils import parametrize_idtype
label_desc: Use image node_id 4 for calling a global function with example usage: generate_graph_old(grad) and returns: g