code: def train(args, exe, model_dict, dataset):
      """training"""
      train_msg = ""
  
      train_begin_time = time.time()
      dataset.dist_graph.load_train_node_from_file(
          args.train_start_nodes
      )
      for epoch in range(1, args.epochs + 1):
          if (
              args.max_steps > 0
              and model_util.print_count >= args.max_steps
          ):
              log.info(
                  "training reach max_steps: %d, training end"
                  % args.max_steps
              )
              break
  
          epoch_begin = time.time()
          epoch_loss = 0
          train_pass_num = 0
          for pass_dataset in dataset.pass_generator(epoch):
              exe.train_from_dataset(
                  model_dict.train_program, pass_dataset, debug=False
              )
  
              t_loss = util.get_global_value(
                  model_dict.visualize_loss, model_dict.batch_count
              )
              epoch_loss += t_loss
              train_pass_num += 1
  
          epoch_end = time.time()
          log.info(
              "epoch[%d] finished, time cost: %f sec"
              % (epoch, epoch_end - epoch_begin)
          )
  
          if train_pass_num > 0:
              epoch_loss = epoch_loss / train_pass_num
          fleet.barrier_worker()
          time_msg = "%s\n" % datetime.now().strftime(
              "%d/%m/%Y %H:%M:%S"
          )
          train_msg += time_msg
          msg = "Train: Epoch %s | batch_loss %.6f\n" % (
              epoch,
              epoch_loss,
          )
          train_msg += msg
          log.info(msg)
  
          if fleet.worker_index() == 0:
              with open(os.path.join("./train_result.log"), "a") as f:
                  f.write(time_msg)
                  f.write(msg)
  
          fleet.barrier_worker()
  
          is_save = (
              epoch % args.save_model_interval == 0
              or epoch == args.epochs
          )
          if args.model_save_path and is_save:
              savemodel_begin = time.time()
              log.info("saving model for epoch {}".format(epoch))
              dataset.embedding.dump_to_mem()
              ret = util.save_model(
                  exe,
                  model_dict,
                  args,
                  args.local_model_path,
                  args.model_save_path,
              )
              fleet.barrier_worker()
              if ret != 0:
                  log.warning("Fail to save model")
                  return -1
              savemodel_end = time.time()
              log.info(
                  "STAGE [SAVE MODEL] for epoch [%d] finished, time cost: %f sec"
                  % (epoch, savemodel_end - savemodel_begin)
              )
  
      train_end_time = time.time()
      log.info(
          "STAGE [TRAIN MODEL] finished, time cost: % sec"
          % (train_end_time - train_begin_time)
      )
  
      return 0
  
imports: import paddle
  import os
  import sys
  import time
  import glob
  import yaml
  import shutil
  import argparse
  import traceback
  import pickle
  import numpy
  import helper
  from datetime import datetime
  import paddle
  import paddle.fluid
  import paddle.static
  from place import get_cuda_places
  from pgl.utils.logger import log
  from datetime import datetime
  from config_fleet import get_strategy
  import util
  import models
  from paddle.distributed import fleet
  from embedding import DistEmbedding
  from graph import DistGraph
  from dataset import UnsupReprLearningDataset, InferDataset
  from distributed_program import make_distributed_train_program, make_distributed_infer_program
  from util_config import prepare_config, pretty
  import util_hadoop
label_desc: Use image node_id 1 for calling a global function with example usage: train(args, exe, model_dict, dataset) and returns: int, unknown