code: def subdata_batch_fn(batches_nid, graph, part, node_buffer):
      """Basic function for creating batch subgraph data, used for PartitionDataset
      and EvalPartitionDataset.
      """
  
      batch_ids, n_ids = zip(*batches_nid)
      batch_ids = np.array(batch_ids)
      n_id = np.concatenate(n_ids, axis=0)
      batch_size = np.size(n_id)
      new_nid, pred_eids = one_hop_neighbor(graph, n_id, node_buffer)
      sub_graph = subgraph(graph, nodes=new_nid, eid=pred_eids)
      offset = part[batch_ids]
      count = part[batch_ids + 1] - part[batch_ids]
      return SubgraphData(sub_graph, batch_size, new_nid, offset, count)
  
imports: import os
  import math
  from functools import partial
  import numpy
  import paddle
  import pgl
  from pgl.utils.logger import log
  from pgl.utils.data import Dataset
  from pgl.sampling.custom import subgraph
  from pgl.utils.data.dataloader import Dataloader
  from pgl.utils.transform import to_undirected, add_self_loops
  from utils import generate_mask
label_desc: Use image node_id 2 for calling a global function with example usage: subdata_batch_fn(batches_nid, graph, part, node_buffer) and returns: SubgraphData