code: def run_epoch(
      batch_iter,
      exe,
      program,
      prefix,
      model_loss,
      model_acc,
      epoch,
      log_per_step=100,
  ):
      """Test"""
      batch = 0
      total_loss = 0.0
      total_acc = 0.0
      total_sample = 0
      start = time.time()
      for batch_feed_dict in batch_iter():
          batch += 1
          batch_loss, batch_acc = exe.run(
              program,
              fetch_list=[model_loss, model_acc],
              feed=batch_feed_dict,
          )
  
          if batch % log_per_step == 0:
              log.info(
                  "Batch %s %s-Loss %s %s-Acc %s"
                  % (batch, prefix, batch_loss, prefix, batch_acc)
              )
  
          num_samples = len(batch_feed_dict["node_index"])
          total_loss += batch_loss * num_samples
          total_acc += batch_acc * num_samples
          total_sample += num_samples
      end = time.time()
  
      log.info(
          "%s Epoch %s Loss %.5lf Acc %.5lf Speed(per batch) %.5lf sec"
          % (
              prefix,
              epoch,
              total_loss / total_sample,
              total_acc / total_sample,
              (end - start) / batch,
          )
      )
  
file_path: PGL/legacy/examples/graphsage/train_scale.py
imports: import argparse
  import time
  import numpy
  import scipy.sparse
  from sklearn.preprocessing import StandardScaler
  import pgl
  from pgl.utils.logger import log
  from pgl.utils import paddle_helper
  import paddle
  import paddle.fluid
  import reader
  from model import graphsage_mean, graphsage_meanpool, graphsage_maxpool, graphsage_lstm
label_desc: Use image node_id 4 for calling a global function with example usage: run_epoch(batch_iter, exe, program, prefix, model_loss, model_acc, epoch, log_per_step) without return types