code: def main(args, train_dataset, val_dataset, test_dataset):
      """main function for running one testing results."""
      log.info("Train Examples: %s" % len(train_dataset))
      log.info("Val Examples: %s" % len(val_dataset))
      log.info("Test Examples: %s" % len(test_dataset))
  
      train_program = fluid.Program()
      train_program.random_seed = args.seed
      startup_program = fluid.Program()
      startup_program.random_seed = args.seed
  
      if args.use_cuda:
          place = fluid.CUDAPlace(0)
      else:
          place = fluid.CPUPlace()
      exe = fluid.Executor(place)
  
      log.info("building model")
  
      with fluid.program_guard(train_program, startup_program):
          with fluid.unique_name.guard():
              graph_model = GlobalModel(args, dataset)
              train_loader = GraphDataloader(
                  train_dataset,
                  graph_model.graph_wrapper,
                  batch_size=args.batch_size,
              )
              optimizer = fluid.optimizer.Adam(
                  learning_rate=args.learning_rate,
                  regularization=fluid.regularizer.L2DecayRegularizer(
                      args.weight_decay
                  ),
              )
              optimizer.minimize(graph_model.loss)
  
      exe.run(startup_program)
      test_program = fluid.Program()
      test_program = train_program.clone(for_test=True)
  
      val_loader = GraphDataloader(
          val_dataset,
          graph_model.graph_wrapper,
          batch_size=args.batch_size,
          shuffle=False,
      )
      test_loader = GraphDataloader(
          test_dataset,
          graph_model.graph_wrapper,
          batch_size=args.batch_size,
          shuffle=False,
      )
  
      min_loss = 1e10
      global_step = 0
      for epoch in range(args.epochs):
          for feed_dict in train_loader:
              loss, pred = exe.run(
                  train_program,
                  feed=feed_dict,
                  fetch_list=[graph_model.loss, graph_model.pred],
              )
  
              log.info(
                  "Epoch: %d, global_step: %d, Training loss: %f"
                  % (epoch, global_step, loss)
              )
              global_step += 1
  
          # validation
          valid_loss = 0.0
          correct = 0.0
          for feed_dict in val_loader:
              valid_loss_, correct_ = exe.run(
                  test_program,
                  feed=feed_dict,
                  fetch_list=[graph_model.loss, graph_model.correct],
              )
              valid_loss += valid_loss_
              correct += correct_
  
          if epoch % 50 == 0:
              log.info(
                  "Epoch:%d, Validation loss: %f, Validation acc: %f"
                  % (epoch, valid_loss, correct / len(val_loader))
              )
  
          if valid_loss < min_loss:
              min_loss = valid_loss
              patience = 0
              path = "./save/%s" % args.dataset_name
              if not os.path.exists(path):
                  os.makedirs(path)
              fluid.save(
                  train_program, "%s/%s" % (path, args.save_model)
              )
              log.info("Model saved at epoch %d" % epoch)
          else:
              patience += 1
          if patience > args.patience:
              break
  
      correct = 0.0
      fluid.load(
          test_program,
          "./save/%s/%s" % (args.dataset_name, args.save_model),
          exe,
      )
      for feed_dict in test_loader:
          correct_ = exe.run(
              test_program,
              feed=feed_dict,
              fetch_list=[graph_model.correct],
          )
          correct += correct_[0]
      log.info("Test acc: %f" % (correct / len(test_loader)))
      return correct / len(test_loader)
  
imports: import sys
  import os
  import argparse
  import pgl
  from pgl.utils.logger import log
  import paddle
  import re
  import time
  import random
  import numpy
  import math
  import paddle
  import paddle.fluid
  import paddle.fluid.layers
  import pgl
  from pgl.utils.logger import log
  from model import GlobalModel
  from base_dataset import Subset, Dataset
  from dataloader import GraphDataloader
  from args import parser
  import warnings
  from sklearn.model_selection import KFold
label_desc: Use image node_id 1 for calling a global function with example usage: main(args, train_dataset, val_dataset, test_dataset) and returns: unknown