code: def test_sample_nodes(self):
      print()
      p_ground = [4, 5, 6, 7, 8, 9]
      sample_num = 10
      nodes = self.graph.sample_nodes(sample_num=sample_num, n_type="p")
  
      self.assertEqual(len(nodes), sample_num)
      for n in nodes:
          self.assertIn(n, p_ground)
  
      # test n_type == None
      ground = [i for i in range(15)]
      nodes = self.graph.sample_nodes(
          sample_num=sample_num, n_type=None
      )
      self.assertEqual(len(nodes), sample_num)
      for n in nodes:
          self.assertIn(n, ground)
  
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 7 for calling the MmapHeterGraphTest obj's underlying member method code with example usage: obj.test_sample_nodes() without return types