code: def main(test_params):
      test_config = namedtuple("Struct", test_params.keys())(
          *test_params.values()
      )
      assert os.path.exists(
          test_config.checkpoint
      ), "Checkpoint does not exist"
  
      download_dataset(test_config.dataset)
  
      test_dataset = AlignedDataset(test_config)
      test_dataset = CustomDatasetDataLoader(test_config, test_dataset)
      _logger.info(
          "Number of testing images = {}".format(len(test_dataset))
      )
  
      model = Pix2PixModel(test_config)
      model.setup(test_config)
  
      if test_config.eval:
          model.eval()
  
      for i, data in enumerate(test_dataset):
          print(
              "Testing on {} image {}".format(test_config.dataset, i),
              end="\r",
          )
          model.set_input(data)
          model.test()
  
          visuals = model.get_current_visuals()
          cur_input = tensor2im(visuals["real_A"])
          cur_label = tensor2im(visuals["real_B"])
          cur_output = tensor2im(visuals["fake_B"])
  
          image_name = "{}_test_{}.png".format(test_config.dataset, i)
          Image.fromarray(cur_input).save(
              os.path.join(test_config.output_dir, "input", image_name)
          )
          Image.fromarray(cur_label).save(
              os.path.join(test_config.output_dir, "label", image_name)
          )
          Image.fromarray(cur_output).save(
              os.path.join(test_config.output_dir, "output", image_name)
          )
  
      _logger.info(
          "Images successfully saved to " + test_config.output_dir
      )
  
file_path: nni/examples/trials/pix2pix-pytorch/test.py
imports: import sys
  import os
  import pathlib
  import logging
  import argparse
  import json
  from collections import namedtuple
  from PIL import Image
  import numpy
  import torch
  from nni.utils import merge_parameter
  from pix2pixlib.data.aligned_dataset import AlignedDataset
  from pix2pixlib.data import CustomDatasetDataLoader
  from pix2pixlib.models.pix2pix_model import Pix2PixModel
  from pix2pixlib.util.util import tensor2im
  from base_params import get_base_params
label_desc: Use image node_id 3 for calling a global function with example usage: main(test_params) without return types