code: def scan_batch_iter(data, batch_size):
      """scan_batch_iter"""
      batch = []
      for example in data.scan():
          batch.append(example)
      if len(batch) == batch_size:
          yield batch
          batch = []
  
      if len(batch) > 0:
          yield batch
  
file_path: PGL/legacy/examples/SAGPool/dataloader.py
imports: import numpy
  import collections
  import paddle
  import pgl
  from pgl.utils.logger import log
  from pgl.graph import Graph, MultiGraph
label_desc: Use image node_id 2 for calling a global function with example usage: scan_batch_iter(data, batch_size) without return types