code: def multiprocess_graph_reader(
      graph_wrapper,
      samples,
      node_index,
      batch_size,
      node_label,
      num_workers=4,
  ):
      """multiprocess_graph_reader"""
  
      def parse_to_subgraph(rd):
          """parse_to_subgraph"""
  
          def work():
              """work"""
              last = time.time()
              for data in rd():
                  this = time.time()
                  feed_dict = data
                  now = time.time()
                  last = now
                  yield feed_dict
  
          return work
  
      def reader():
          """reader"""
          batch_info = list(
              node_batch_iter(
                  node_index, node_label, batch_size=batch_size
              )
          )
          block_size = int(len(batch_info) / num_workers + 1)
          reader_pool = []
          for i in range(num_workers):
              reader_pool.append(
                  worker(
                      batch_info[block_size * i : block_size * (i + 1)],
                      graph_wrapper,
                      samples,
                  )
              )
          multi_process_sample = mp_reader.multiprocess_reader(
              reader_pool, use_pipe=True, queue_size=1000
          )
          r = parse_to_subgraph(multi_process_sample)
          return paddle.reader.buffered(r, 1000)
  
      return reader()
  
file_path: PGL/legacy/examples/distribute_graphsage/reader.py
imports: import os
  import sys
  import numpy
  import pickle
  import paddle
  import paddle.fluid
  import socket
  import pgl
  import time
  from pgl.utils import mp_reader
  from pgl.utils.logger import log
  from pgl import redis_graph
label_desc: Use image node_id 5 for calling a global function with example usage: multiprocess_graph_reader(graph_wrapper, samples, node_index, batch_size, node_label, num_workers) and returns: reader, work, paddle