code: def __init__(self, config, graph, mode, **kwargs):
      self.config = config
      self.graph = graph
      self.mode = mode
      self.kwargs = kwargs
  
      self.meta_path = self.config.meta_path
      self.first_node_type = self.config.first_node_type
  
      first_ntypes = self.first_node_type.split(";")
      meta_paths = self.meta_path.split(";")
      for fnt, mp in zip(first_ntypes, meta_paths):
          f = mp.split("-")[0].split("2")[0]
          assert f == fnt, (
              "the first ntype in metapath [%s] "
              "is not equal to first ntype [%s]" % (f, fnt)
          )
  
      self.rank = kwargs.get("rank", 0)
      self.nrank = kwargs.get("nrank", 1)
  
      self.node_generator = NodeGenerator(
          self.config,
          self.graph,
          self.mode,
          rank=self.rank,
          nrank=self.nrank,
      )
  
      self.walk_batch_size = 400
      self.walk_stream_shuffle_size = 100000
  
file_path: PGL/examples/metapath2vec/datasets/walk.py
imports: import os
  import sys
  import time
  import warnings
  import numpy
  from collections import defaultdict
  from pgl.utils.logger import log
  from pgl.distributed import DistGraphClient, DistGraphServer
  from utils.config import prepare_config
  from datasets.helper import stream_shuffle_generator, AsynchronousGenerator
  from datasets.node import NodeGenerator
  import datasets.sampling
label_desc: Use image node_id 1 to create a new WalkGenerator object from inherited base classes: object with example: obj = WalkGenerator(config, graph, mode)