code: def generate_graph(idtype):
      g = dgl.graph([])
      g = g.astype(idtype).to(F.ctx())
      g.add_nodes(10)
      # create a graph where 0 is the source and 9 is the sink
      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.ndata.update({"f1": F.randn((10,)), "f2": F.randn((10, D))})
      weights = F.randn((17,))
      g.edata.update({"e1": weights, "e2": F.unsqueeze(weights, 1)})
      return g
  
file_path: dgl/tests/python/common/test_heterograph-specialization.py
imports: import backend
  import dgl
  import dgl.function
  import numpy
  import scipy.sparse
  from utils import parametrize_idtype
label_desc: Use image node_id 1 for calling a global function with example usage: generate_graph(idtype) and returns: g