code: def tree1(idtype):
      """Generate a tree
           0
          / \
         1   2
        / \
       3   4
      Edges are from leaves to root.
      """
      g = dgl.graph(([], [])).astype(idtype).to(F.ctx())
      g.add_nodes(5)
      g.add_edges(3, 1)
      g.add_edges(4, 1)
      g.add_edges(1, 0)
      g.add_edges(2, 0)
      g.ndata["h"] = F.tensor([0, 1, 2, 3, 4])
      g.edata["h"] = F.randn((4, 10))
      return g
  
file_path: dgl/tests/python/common/test_batch-graph.py
imports: import unittest
  import backend
  import dgl
  import numpy
  from utils import parametrize_idtype
label_desc: Use image node_id 1 for calling a global function with example usage: tree1(idtype) and returns: g