code: def multiprocess_graph_reader(
      num_layers,
      graph_wrappers,
      data,
      batch_size,
      samples,
      num_workers,
      feed_name_list,
      use_pyreader,
      graph,
      predict,
  ):
      """multiprocess_graph_reader"""
  
      def parse_to_subgraph(rd):
          """parse_to_subgraph"""
  
          def work():
              """work"""
              for data in rd():
                  yield data
  
          return work
  
      def reader():
          """reader"""
          batch_info = list(batch_iter(data, batch_size=batch_size))
          log.info("The size of batch:%d" % (len(batch_info)))
          block_size = int(len(batch_info) / num_workers + 1)
          reader_pool = []
          for i in range(num_workers):
              reader_pool.append(
                  worker(
                      num_layers,
                      batch_info[block_size * i : block_size * (i + 1)],
                      graph_wrappers,
                      samples,
                      feed_name_list,
                      use_pyreader,
                      graph,
                      predict,
                  )
              )
          use_pipe = True
          multi_process_sample = mp_reader.multiprocess_reader(
              reader_pool, use_pipe=use_pipe
          )
          r = parse_to_subgraph(multi_process_sample)
          if use_pipe:
              return paddle.reader.buffered(r, 5 * num_workers)
          else:
              return r
  
      return reader()
  
file_path: PGL/legacy/examples/unsup_graphsage/reader.py
imports: import os
  import numpy
  import pickle
  import paddle
  import paddle.fluid
  import pgl
  import time
  from pgl.utils.logger import log
  from pgl.utils import mp_reader
label_desc: Use image node_id 6 for calling a global function with example usage: multiprocess_graph_reader(num_layers, graph_wrappers, data, batch_size, samples, num_workers, feed_name_list, use_pyreader, graph, predict) and returns: reader, work, paddle, r