code: def main():
      args = arg_parse()
  
      # ---- setup config ----
      cfg = get_cfg_defaults()
      cfg.merge_from_file(args.cfg)
      cfg.freeze()
      seed.set_seed(cfg.SOLVER.SEED)
  
      # ---- setup dataset ----
      train_loader, valid_loader = get_cifar(cfg)
  
      # ---- setup model ----
      print("==> Building model..")
      model = get_model(cfg)
  
      # ---- setup logger ----
      # Choose one logger (CometLogger or TensorBoardLogger) using cfg.COMET.ENABLE
      if cfg.COMET.ENABLE:
          suffix = str(int(time.time() * 1000))[6:]
          logger = pl_loggers.CometLogger(
              api_key=cfg.COMET.API_KEY,
              project_name=cfg.COMET.PROJECT_NAME,
              save_dir=cfg.OUTPUT.OUT_DIR,
              experiment_name="{}_{}".format(
                  cfg.COMET.EXPERIMENT_NAME, suffix
              ),
          )
      else:
          logger = pl_loggers.TensorBoardLogger(cfg.OUTPUT.OUT_DIR)
  
      # ---- setup callbacks ----
      # setup progress bar
      progress_bar = TQDMProgressBar(cfg.OUTPUT.PB_FRESH)
  
      # setup learning rate monitor
      lr_monitor = LearningRateMonitor(logging_interval="epoch")
  
      # ---- setup trainers ----
      trainer = pl.Trainer(
          default_root_dir=cfg.OUTPUT.OUT_DIR,
          max_epochs=cfg.SOLVER.MAX_EPOCHS,
          accelerator="gpu" if args.devices != 0 else "cpu",
          devices=args.devices if args.devices != 0 else "auto",
          logger=logger,
          callbacks=[progress_bar, lr_monitor],
          strategy="ddp",  # comment this line on Windows, because Windows does not support CCL backend
          log_every_n_steps=1,
      )
  
      # ---- start training ----
      trainer.fit(
          model, train_loader, valid_loader, ckpt_path=args.ckpt_resume
      )
  
      # ---- start testing ----
      trainer.test(model, valid_loader, ckpt_path=args.ckpt_test)
  
file_path: pykale/examples/cifar_cnntransformer/main.py
imports: import argparse
  import time
  import pytorch_lightning
  from config import get_cfg_defaults
  from model import get_model
  from pytorch_lightning import loggers
  from pytorch_lightning.callbacks import LearningRateMonitor, TQDMProgressBar
  import kale.utils.seed
  from kale.loaddata.image_access import get_cifar
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types