code: def graph_reader(
      num_layers,
      graph_wrappers,
      data,
      batch_size,
      samples,
      num_workers,
      feed_name_list,
      use_pyreader=False,
      graph=None,
      predict=False,
  ):
      """graph_reader"""
      assert num_layers == len(
          samples
      ), "Must be unified number of layers!"
      if num_workers > 1:
          return multiprocess_graph_reader(
              num_layers,
              graph_wrappers,
              data,
              batch_size,
              samples,
              num_workers,
              feed_name_list,
              use_pyreader,
              graph=graph,
              predict=predict,
          )
  
      batch_info = list(batch_iter(data, batch_size=batch_size))
      work = worker(
          num_layers,
          batch_info,
          graph_wrappers,
          samples,
          feed_name_list,
          use_pyreader,
          graph=graph,
          predict=predict,
      )
  
      def reader():
          """reader"""
          for batch in work():
              yield batch
  
      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 4 for calling a global function with example usage: graph_reader(num_layers, graph_wrappers, data, batch_size, samples, num_workers, feed_name_list, use_pyreader, graph, predict) and returns: reader, multiprocess_graph_reader