code: def run_epoch(
      py_reader,
      exe,
      program,
      prefix,
      model_dict,
      epoch,
      batch_size,
      log_per_step=100,
      save_per_step=10000,
  ):
      """run_epoch"""
      batch = 0
      start = time.time()
  
      batch_end = time.time()
  
      for batch_feed_dict in py_reader():
          if prefix == "train":
              if batch_feed_dict["src_index"].shape[0] != batch_size:
                  log.warning(
                      'batch_feed_dict["src_index"].shape[0] != 1024, continue'
                  )
                  continue
          batch_start = time.time()
          batch += 1
          batch_loss, batch_auc = exe.run(
              program,
              feed=batch_feed_dict,
              fetch_list=[model_dict.loss.name, model_dict.auc.name],
          )
  
          batch_end = time.time()
          if batch % log_per_step == 0:
              log.info(
                  "Batch %s %s-Loss %s \t %s-Auc  %s \t Speed(per batch) %.5lf sec"
                  % (
                      batch,
                      prefix,
                      np.mean(batch_loss),
                      prefix,
                      np.mean(batch_auc),
                      batch_end - batch_start,
                  )
              )
          if batch != 0 and batch % save_per_step == 0:
              fluid.io.save_params(
                  exe, dirname="checkpoint", main_program=program
              )
      fluid.io.save_params(
          exe, dirname="checkpoint", main_program=program
      )
  
imports: import argparse
  import time
  import glob
  import os
  import numpy
  import pgl
  from pgl.utils.logger import log
  from pgl.utils import paddle_helper
  import paddle
  import paddle.fluid
  import tqdm
  import reader
  import model
label_desc: Use image node_id 5 for calling a global function with example usage: run_epoch(py_reader, exe, program, prefix, model_dict, epoch, batch_size, log_per_step, save_per_step) without return types