code: def test_num_nodes_by_type(self):
      print()
      n_types = {"c": 4, "p": 6, "a": 5}
      for nt in n_types:
          num_nodes = self.graph.num_nodes_by_type(nt)
          self.assertEqual(num_nodes, n_types[nt])
  
file_path: PGL/legacy/pgl/tests/test_MmapHeterGraph.py
imports: import time
  import unittest
  import json
  import os
  import numpy
  from pgl.sample import metapath_randomwalk
  from pgl.graph import Graph
  from pgl import heter_graph
  from pgl.heter_graph import MemmapHeterGraph
label_desc: Use image node_id 2 for calling the MmapHeterGraphTest obj's underlying member method code with example usage: obj.test_num_nodes_by_type() without return types