code: def multiprocess_generate_walks_to_files(
      graph,
      n_type,
      meta_path,
      num_walks,
      walk_length,
      batch_size,
      num_sample_workers,
      saved_path,
  ):
      """Use multiprocess to generate metapath random walk to files."""
  
      num_nodes_by_type = graph.num_nodes_by_type(n_type)
      logging.info("num_nodes_by_type: %s" % num_nodes_by_type)
      max_num = (
          num_walks * num_nodes_by_type // num_sample_workers
      ) + 1
      logging.info("max sample number of every worker: %s" % max_num)
  
      args = []
      for i in range(num_sample_workers):
          filename = os.path.join(saved_path, "part-%05d" % (i))
          args.append(
              (
                  graph,
                  batch_size,
                  meta_path,
                  n_type,
                  walk_length,
                  max_num,
                  filename,
              )
          )
  
      ps = []
      for i in range(num_sample_workers):
          p = Process(target=walk_to_files, args=args[i])
          p.start()
          ps.append(p)
      for i in range(num_sample_workers):
          ps[i].join()
  
imports: import multiprocessing
  from multiprocessing import Pool
  from multiprocessing import Process
  import argparse
  import sys
  import os
  import numpy
  import pickle
  import tqdm
  import time
  import logging
  import random
  from pgl import heter_graph
  from pgl.sample import metapath_randomwalk
  from utils import *
label_desc: Use image node_id 3 for calling a global function with example usage: multiprocess_generate_walks_to_files(graph, n_type, meta_path, num_walks, walk_length, batch_size, num_sample_workers, saved_path) without return types