code: def main(dataset_name, train_params, test_params):
      download_dataset(dataset_name)
  
      train_config = namedtuple("Struct", train_params.keys())(
          *train_params.values()
      )
      test_config = namedtuple("Struct", test_params.keys())(
          *test_params.values()
      )
  
      train_dataset, test_dataset = AlignedDataset(
          train_config
      ), AlignedDataset(test_config)
      print(train_dataset, train_config)
      train_dataset = CustomDatasetDataLoader(
          train_config, train_dataset
      )
      test_dataset = CustomDatasetDataLoader(test_config, test_dataset)
      _logger.info(
          "Number of training images = {}".format(len(train_dataset))
      )
      _logger.info(
          "Number of testing images = {}".format(len(test_dataset))
      )
  
      model = Pix2PixModel(train_config)
      model.setup(train_config)
  
      # training
      total_iters = 0  # the total number of training iterations
      for epoch in range(
          train_config.epoch_count,
          train_config.n_epochs + train_config.n_epochs_decay + 1,
      ):
          _logger.info("Training epoch {}".format(epoch))
          epoch_start_time = time.time()  # timer for entire epoch
          iter_data_time = (
              time.time()
          )  # timer for data loading per iteration
          epoch_iter = 0
          model.update_learning_rate()
          for i, data in enumerate(
              train_dataset
          ):  # inner loop within one epoch
              iter_start_time = (
                  time.time()
              )  # timer for computation per iteration
              if total_iters % train_config.print_freq == 0:
                  t_data = iter_start_time - iter_data_time
              total_iters += train_config.batch_size
              epoch_iter += train_config.batch_size
              model.set_input(
                  data
              )  # unpack data from dataset and apply preprocessing
              model.optimize_parameters()  # calculate loss functions, get gradients, update network weights
              iter_data_time = time.time()
          _logger.info(
              "End of epoch {} / {} \t Time Taken: {} sec".format(
                  epoch,
                  train_config.n_epochs + train_config.n_epochs_decay,
                  time.time() - epoch_start_time,
              )
          )
  
      model.save_networks("latest")
      _logger.info("Training done. Saving the final model.")
  
      l1_score = evaluate_L1(test_config, model, test_dataset)
      _logger.info(
          "The final L1 loss the test set is {}".format(l1_score)
      )
      nni.report_final_result(l1_score)
  
imports: import sys
  import os
  import pathlib
  import logging
  import time
  import argparse
  from collections import namedtuple
  import numpy
  import torch
  import torch.utils.data
  import nni
  from nni.utils import merge_parameter
  from pix2pixlib.data.aligned_dataset import AlignedDataset
  from pix2pixlib.models.pix2pix_model import Pix2PixModel
  from base_params import get_base_params
label_desc: Use image node_id 5 for calling a global function with example usage: main(dataset_name, train_params, test_params) without return types