code: def test_issue1287(idtype):
      # reproduce https://github.com/dmlc/dgl/issues/1287.
      # setting features after remove nodes
      g = create_graph(idtype, 5)
      g.add_edges([0, 2, 3, 1, 1], [1, 0, 3, 1, 0])
      g.remove_nodes([0, 1])
      g.ndata["h"] = F.randn((g.num_nodes(), 3))
      g.edata["h"] = F.randn((g.num_edges(), 2))
  
      # remove edges
      g = create_graph(idtype, 5)
      g.add_edges([0, 2, 3, 1, 1], [1, 0, 3, 1, 0])
      g.remove_edges([0, 1])
      g = g.to(F.ctx())
      g.ndata["h"] = F.randn((g.num_nodes(), 3))
      g.edata["h"] = F.randn((g.num_edges(), 2))
  
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 9 for calling a global function with example usage: test_issue1287(idtype) without return types