code: def __init__(self, graph_work_path):
      trainer_id = int(os.getenv("PADDLE_TRAINER_ID", "0"))
      trainer_count = int(os.getenv("PADDLE_TRAINERS_NUM", "1"))
      log.info(
          "trainer_id: %s, trainer_count: %s."
          % (trainer_id, trainer_count)
      )
  
      edges = np.load(
          os.path.join(graph_work_path, "train_data.npy"),
          allow_pickle=True,
      )
      # edges is bidirectional.
      train_usr = edges[trainer_id::trainer_count, 0]
      train_ad = edges[trainer_id::trainer_count, 1]
      returns = {"train_data": [train_usr, train_ad]}
  
      if os.path.exists(
          os.path.join(graph_work_path, "neg_samples.npy")
      ):
          neg_samples = np.load(
              os.path.join(graph_work_path, "neg_samples.npy"),
              allow_pickle=True,
          )
          if neg_samples.size != 0:
              train_negs = neg_samples[trainer_id::trainer_count]
              returns["train_data"].append(train_negs)
      log.info("Load train_data done.")
      self.data = returns
  
imports: import os
  import argparse
  import traceback
  import re
  import io
  import yaml
  import numpy
  from easydict import EasyDict
  from pgl.utils import paddle_helper
  from pgl.graph_wrapper import BatchGraphWrapper
  import propeller.paddle
  from propeller.paddle.data import Dataset
  import paddle.fluid
  import paddle.fluid.layers
  import logging
  from propeller import log
  from ernie.tokenizing_ernie import ErnieTokenizer
  from ernie.tokenizing_ernie import ErnieTinyTokenizer
  from dataset.graph_reader import BatchGraphGenerator
  from models.encoder import Encoder
  from models.pretrain_model_loader import PretrainedModelLoader
  from models.loss import Loss
  from optimization import optimization
label_desc: Use image node_id 1 to create a new TrainData object from inherited base classes: object with example: obj = TrainData(graph_work_path)