code: def node_classify_generator(
      graph, all_nodes=None, batch_size=512, epoch=1, shuffle=True
  ):
      if all_nodes is None:
          all_nodes = np.arange(graph.num_nodes)
  
      def batch_nodes_generator(shuffle=shuffle):
          perm = np.arange(len(all_nodes), dtype=np.int64)
          if shuffle:
              np.random.shuffle(perm)
          start = 0
          while start < len(all_nodes):
              yield all_nodes[perm[start : start + batch_size]]
              start += batch_size
  
      def wrapper():
          for _ in range(epoch):
              for batch_nodes in batch_nodes_generator():
                  # batch_nodes_expanded = np.expand_dims(batch_nodes,
                  # -1).astype(np.int64)
                  batch_labels = graph.node_feat["group_id"][
                      batch_nodes
                  ].astype(np.float32)
                  yield [batch_nodes, batch_labels]
  
      return wrapper
  
imports: import argparse
  import time
  import os
  import math
  import glob
  import numpy
  import paddle
  from easydict import EasyDict
  import pgl
  import yaml
  from paddle.optimizer import Adam
  import tqdm
  from pgl.utils.logger import log
  from sklearn.metrics import f1_score
  from dataset import ShardedDataset
label_desc: Use image node_id 2 for calling a global function with example usage: node_classify_generator(graph, all_nodes, batch_size, epoch, shuffle) and returns: wrapper