code: def main():
      """The main for this multi-source domain adaptation example, showing the workflow"""
      args = arg_parse()
  
      # ---- setup configs ----
      cfg = get_cfg_defaults()
      cfg.merge_from_file(args.cfg)
      cfg.freeze()
      print(cfg)
  
      # ---- setup output ----
      format_str = (
          "@%(asctime)s %(name)s [%(levelname)s] - (%(message)s)"
      )
      logging.basicConfig(format=format_str)
      # ---- setup dataset ----
      if type(cfg.DATASET.SOURCE) == list:
          sub_domain_set = cfg.DATASET.SOURCE + [cfg.DATASET.TARGET]
      else:
          sub_domain_set = None
      num_channels = cfg.DATASET.NUM_CHANNELS
      if cfg.DATASET.NAME.upper() == "DIGITS":
          kwargs = {"return_domain_label": True}
      else:
          kwargs = {"download": True, "return_domain_label": True}
  
      data_access = ImageAccess.get_multi_domain_images(
          cfg.DATASET.NAME.upper(),
          cfg.DATASET.ROOT,
          sub_domain_set=sub_domain_set,
          **kwargs,
      )
  
      # Repeat multiple times to get std
      for i in range(0, cfg.DATASET.NUM_REPEAT):
          seed = cfg.SOLVER.SEED + i * 10
          dataset = MultiDomainAdapDataset(
              data_access, random_state=seed
          )
          set_seed(
              seed
          )  # seed_everything in pytorch_lightning did not set torch.backends.cudnn
          print(f"==> Building model for seed {seed} ......")
          # ---- setup model and logger ----
          model, train_params = get_model(cfg, dataset, num_channels)
  
          tb_logger = TensorBoardLogger(
              cfg.OUTPUT.OUT_DIR, name="seed{}".format(seed)
          )
          checkpoint_callback = ModelCheckpoint(
              filename="{epoch}-{step}-{valid_loss:.4f}",
              monitor="valid_loss",
              mode="min",
          )
          progress_bar = TQDMProgressBar(cfg.OUTPUT.PB_FRESH)
  
          trainer = pl.Trainer(
              min_epochs=cfg.SOLVER.MIN_EPOCHS,
              max_epochs=cfg.SOLVER.MAX_EPOCHS,
              callbacks=[checkpoint_callback, progress_bar],
              accelerator="gpu" if args.devices != 0 else "cpu",
              devices=args.devices if args.devices != 0 else "auto",
              logger=tb_logger,  # logger,
              # weights_summary='full',
              fast_dev_run=False,  # True,
          )
  
          trainer.fit(model)
          trainer.test()
  
file_path: pykale/examples/office_multisource_adapt/main.py
imports: import argparse
  import logging
  import pytorch_lightning
  from config import get_cfg_defaults
  from model import get_model
  from pytorch_lightning.callbacks import ModelCheckpoint, TQDMProgressBar
  from pytorch_lightning.loggers import TensorBoardLogger
  from kale.loaddata.image_access import ImageAccess
  from kale.loaddata.multi_domain import MultiDomainAdapDataset
  from kale.utils.seed import set_seed
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types