code: def test_isolated_nodes(idtype):
      g = dgl.graph(
          ([0, 1], [1, 2]), num_nodes=5, idtype=idtype, device=F.ctx()
      )
      assert g.num_nodes() == 5
  
      g = dgl.heterograph(
          {("user", "plays", "game"): ([0, 0, 1], [2, 3, 2])},
          {"user": 5, "game": 7},
          idtype=idtype,
          device=F.ctx(),
      )
      assert g.idtype == idtype
      assert g.num_nodes("user") == 5
      assert g.num_nodes("game") == 7
  
      # Test backward compatibility
      g = dgl.heterograph(
          {("user", "plays", "game"): ([0, 0, 1], [2, 3, 2])},
          {"user": 5, "game": 7},
          idtype=idtype,
          device=F.ctx(),
      )
      assert g.idtype == idtype
      assert g.num_nodes("user") == 5
      assert g.num_nodes("game") == 7
  
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 19 for calling a global function with example usage: test_isolated_nodes(idtype) without return types