code: def main(config):
      """main function for training metapath2vec model."""
      logging.info(config)
  
      set_seed(config["seed"])
  
      dataset = getattr(Dataset, config["data_loader"]["type"])(
          config["data_loader"]["args"]
      )
      data_generator = multiprocess_data_generator(config, dataset)
  
      # move word2id file to checkpoints directory
      src_word2id_file = dataset.word2id_file
      dst_wor2id_file = (
          config["trainer"]["args"]["save_dir"]
          + config["data_loader"]["args"]["word2id_file"]
      )
      logging.info("backup word2id file to %s" % dst_wor2id_file)
      shutil.move(src_word2id_file, dst_wor2id_file)
  
      place = (
          fluid.CUDAPlace(0) if config["use_cuda"] else fluid.CPUPlace()
      )
      train_program = fluid.Program()
      startup_program = fluid.Program()
  
      with fluid.program_guard(train_program, startup_program):
          model = getattr(Models, config["model"]["type"])(
              dataset=dataset,
              config=config["model"]["args"],
              place=place,
          )
  
      with fluid.program_guard(train_program, startup_program):
          global_steps = int(
              dataset.sentences_count
              * config["trainer"]["args"]["epochs"]
              / config["data_loader"]["args"]["batch_size"]
          )
          model.backward(global_steps, config["optimizer"]["args"])
  
      # train
      exe = fluid.Executor(place)
      exe.run(startup_program)
      feed_dict = {}
  
      logging.info("training...")
      for epoch in range(1, 1 + config["trainer"]["args"]["epochs"]):
          run_epoch(
              epoch,
              config["trainer"]["args"],
              data_generator,
              train_program,
              model,
              feed_dict,
              exe,
          )
  
          logging.info("saving model...")
          cur_save_path = os.path.join(
              config["trainer"]["args"]["save_dir"],
              "model_epoch%d" % (epoch),
          )
          save_param(cur_save_path, ["content"])
  
      logging.info("finishing training")
  
imports: import os
  import sys
  import argparse
  import time
  import numpy
  import logging
  import pickle
  import shutil
  import glob
  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 pgl.utils import mp_reader
  from sklearn.metrics import auc, f1_score, precision_recall_curve, roc_auc_score
label_desc: Use image node_id 5 for calling a global function with example usage: main(config) without return types