code: def test_dynamic_addition():
      N = 3
      D = 1
  
      g = dgl.graph([]).to(F.ctx())
  
      # Test node addition
      g.add_nodes(N)
      g.ndata.update({"h1": F.randn((N, D)), "h2": F.randn((N, D))})
      g.add_nodes(3)
      assert g.ndata["h1"].shape[0] == g.ndata["h2"].shape[0] == N + 3
  
      # Test edge addition
      g.add_edges(0, 1)
      g.add_edges(1, 0)
      g.edata.update({"h1": F.randn((2, D)), "h2": F.randn((2, D))})
      assert g.edata["h1"].shape[0] == g.edata["h2"].shape[0] == 2
  
      g.add_edges([0, 2], [2, 0])
      g.edata["h1"] = F.randn((4, D))
      assert g.edata["h1"].shape[0] == g.edata["h2"].shape[0] == 4
  
      g.add_edges(1, 2)
      g.edges[4].data["h1"] = F.randn((1, D))
      assert g.edata["h1"].shape[0] == g.edata["h2"].shape[0] == 5
  
      # test add edge with part of the features
      g.add_edges(2, 1, {"h1": F.randn((1, D))})
      assert len(g.edata["h1"]) == len(g.edata["h2"])
  
imports: import warnings
  from collections import defaultdict
  import backend
  import dgl
  import networkx
  import numpy
  from utils import parametrize_idtype
label_desc: Use image node_id 15 for calling a global function with example usage: test_dynamic_addition() without return types