code: def __call__(self, batch_data):
      # Pair of EgoGraphs
      feed_dict = OrderedDict()
      for slot in self.config.slots:
          feed_dict[slot] = []
          feed_dict["%s_info" % slot] = []
  
      center_id = []
      graphs = []
  
      offset = 0
      total_num_nodes = 0
      for src, pos in batch_data:
          center_id.append(total_num_nodes)
          graphs.append(src.graph)
          total_num_nodes += src.graph.num_nodes
  
          center_id.append(total_num_nodes)
          graphs.append(pos.graph)
          total_num_nodes += pos.graph.num_nodes
  
          for slot in self.config.slots:
              feed_dict[slot].extend(src.feature[slot][0])
              segments = (
                  np.array(src.feature[slot][1], dtype="int64") + offset
              )
              feed_dict["%s_info" % slot].append(segments)
  
              feed_dict[slot].extend(pos.feature[slot][0])
              segments = np.array(pos.feature[slot][1], dtype="int64")
              segments = (
                  segments + offset + len(src.node_id)
              )  # for pos offset
              feed_dict["%s_info" % slot].append(segments)
  
          # add src and pos ego graphs' length after all slot finished adding
          offset = offset + len(src.node_id) + len(pos.node_id)
  
      for slot in self.config.slots:
          if self.mode == "gpu":
              feed_dict[slot] = np.array(
                  feed_dict[slot], dtype="int64"
              ).reshape(
                  -1,
              )
          elif self.mode == "distcpu":
              feed_dict[slot] = np.array(
                  feed_dict[slot], dtype="int64"
              ).reshape(-1, 1)
  
          feed_dict["%s_info" % slot] = np.concatenate(
              feed_dict["%s_info" % slot]
          ).reshape(
              -1,
          )
  
      graphs = pgl.Graph.batch(graphs)
  
      feed_dict["num_nodes"] = np.array(
          [graphs.num_nodes], dtype="int64"
      )
  
      for etype_id, etype in enumerate(self.edge_type_list):
          edges = graphs.edges[
              graphs.edge_feat["edge_type"] == etype_id
          ]
          feed_dict["num_edges_%s" % etype] = np.array(
              [len(edges)], dtype="int64"
          )
          feed_dict["edges_%s" % etype] = edges
  
      # the total node index of the subgraph
      if self.mode == "gpu":
          feed_dict["origin_node_id"] = graphs.node_feat[
              "node_id"
          ].reshape(
              -1,
          )
      elif self.mode == "distcpu":
          feed_dict["origin_node_id"] = graphs.node_feat[
              "node_id"
          ].reshape(-1, 1)
      else:
          raise ValueError(
              "[%s] mode is not recognized, it should be [gpu] or [distcpu]"
          )
  
      # the center node index of the subgraph
      feed_dict["center_node_id"] = np.array(center_id, dtype="int64")
  
      bs = len(batch_data)
      neg_idx = np.random.randint(
          low=0,
          high=bs * 2,
          size=[bs * self.config.neg_num],
          dtype="int64",
      )
      feed_dict["neg_idx"] = neg_idx
  
      if self.mode == "gpu":
          return feed_dict
      elif self.mode == "distcpu":
          return tuple(list(feed_dict.values()))
  
imports: import os
  import sys
  import time
  import warnings
  import functools
  import numpy
  from collections import defaultdict, OrderedDict
  import paddle.distributed.fleet
  import pgl
  from pgl.graph_kernel import skip_gram_gen_pair
  from pgl.utils.logger import log
  from pgl.distributed import DistGraphClient, DistGraphServer
  from pgl.utils.data import Dataloader, StreamDataset
  from pgl.distributed import helper
  from pgl.utils.logger import log
  from utils.config import prepare_config
  from datasets.node import NodeGenerator
  from datasets.walk import WalkGenerator
  from datasets.ego_graph import ego_graph_sample, EgoGraphGenerator
  from datasets.pair import PairGenerator
label_desc: Use image node_id 2 for calling the SageCollateFn obj's underlying member method code with example usage: obj.__call__(batch_data) and returns: feed_dict, tuple