code: def generate_graph(grad=False, add_data=True):
      g = dgl.graph([]).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)
      if add_data:
          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["l"] = ecol
      return g
  
imports: import unittest
  import backend
  import dgl
  import networkx
  import numpy
  import pytest
  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(grad, add_data) and returns: g