code: def test_node_and_edge_removal(idtype):
      g = create_graph(idtype, 10)
      for i in range(10):
          for j in range(10):
              g.add_edges(i, j)
      g.edata["id"] = F.arange(0, 100)
      assert g.num_nodes() == 10
      assert g.num_edges() == 100
  
      # remove nodes
      g.remove_nodes([2, 4])
      assert g.num_nodes() == 8
      assert g.num_edges() == 64
  
      # remove edges
      g.remove_edges(range(10, 20))
      assert g.num_nodes() == 8
      assert g.num_edges() == 54
  
      # add nodes
      g.add_nodes(2)
      assert g.num_nodes() == 10
      assert g.num_edges() == 54
  
      # add edges
      for i in range(8, 10):
          for j in range(8, 10):
              g.add_edges(i, j)
      assert g.num_nodes() == 10
      assert g.num_edges() == 58
  
      # remove edges
      g.remove_edges(range(10, 20))
      assert g.num_nodes() == 10
      assert g.num_edges() == 48
  
file_path: dgl/tests/python/common/test_heterograph-remove.py
imports: 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_node_and_edge_removal(idtype) without return types