code: def test_batch_unbatch2(idtype):
      # test setting/getting features after batch
      a = dgl.graph(([], [])).astype(idtype).to(F.ctx())
      a.add_nodes(4)
      a.add_edges(0, [1, 2, 3])
      b = dgl.graph(([], [])).astype(idtype).to(F.ctx())
      b.add_nodes(3)
      b.add_edges(0, [1, 2])
      c = dgl.batch([a, b])
      c.ndata["h"] = F.ones((7, 1))
      c.edata["w"] = F.ones((5, 1))
      assert F.allclose(c.ndata["h"], F.ones((7, 1)))
      assert F.allclose(c.edata["w"], F.ones((5, 1)))
  
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 6 for calling a global function with example usage: test_batch_unbatch2(idtype) without return types