code: def train_prog(exe, program, loss, pyreader, args, train_steps):
      trainer_id = int(os.getenv("PADDLE_TRAINER_ID", "0"))
      step = 0
      while True:
          try:
              begin_time = time.time()
              (loss_val,) = exe.run(program, fetch_list=[loss])
              log.info(
                  "step %s: loss %.5f speed: %.5f s/step"
                  % (step, np.mean(loss_val), time.time() - begin_time)
              )
              step += 1
          except F.core.EOFException:
              pyreader.reset()
  
          if step % args.steps_per_save == 0 or step == train_steps:
              if trainer_id == 0 or args.is_distributed:
                  model_save_dir = args.save_path
                  model_path = os.path.join(model_save_dir, str(step))
                  if not os.path.exists(model_save_dir):
                      os.makedirs(model_save_dir)
                  fleet.save_persistables(exe, model_path)
  
          if step == train_steps:
              break
  
imports: import argparse
  import time
  import os
  import math
  from multiprocessing import Process
  import numpy
  import paddle.fluid
  import paddle.fluid.layers
  from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
  from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import StrategyFactory
  import paddle.fluid.incubate.fleet.base.role_maker
  import pgl
  from pgl.utils.logger import log
  from pgl import data_loader
  from reader import DeepwalkReader
  from model import DeepwalkModel
  from utils import get_file_list
  from utils import build_graph
  from utils import build_random_graph
  from utils import build_fake_graph
  from utils import build_gen_func
label_desc: Use image node_id 3 for calling a global function with example usage: train_prog(exe, program, loss, pyreader, args, train_steps) without return types