code: def run_epoch(
      epoch,
      config,
      dataset,
      data,
      train_prog,
      test_prog,
      model,
      feed_dict,
      exe,
      for_test=False,
  ):
      """Run training process of every epoch."""
      total_loss = []
      for idx, batch_data in enumerate(data):
          feed_dict["train_inputs"] = batch_data[0]
          feed_dict["train_labels"] = batch_data[1]
          feed_dict["train_negs"] = batch_data[2]
          feed_dict["train_types"] = batch_data[3]
  
          loss, lr = exe.run(
              train_prog,
              feed=feed_dict,
              fetch_list=[model.loss, model.lr],
              return_numpy=True,
          )
          total_loss.append(loss[0])
  
          if (idx + 1) % 500 == 0:
              avg_loss = np.mean(total_loss)
              logging.info(
                  "epoch %d | step %d | lr %.4f | train_loss %f "
                  % (epoch, idx + 1, lr, avg_loss)
              )
              total_loss = []
  
      return avg_loss
  
imports: import os
  import argparse
  import time
  import numpy
  import logging
  import pickle
  import pgl
  from pgl.utils import paddle_helper
  import paddle
  import paddle.fluid
  import paddle.fluid.layers
  from utils import *
  import Dataset
  import model
  from sklearn.metrics import auc, f1_score, precision_recall_curve, roc_auc_score
label_desc: Use image node_id 6 for calling a global function with example usage: run_epoch(epoch, config, dataset, data, train_prog, test_prog, model, feed_dict, exe, for_test) and returns: avg_loss