code: def test_multi_source(
      method, input_dimension, office_caltech_access, testing_cfg
  ):
      if method != "MFSAN" and input_dimension == 2:
          pytest.skip()
      dataset = MultiDomainAdapDataset(office_caltech_access)
      feature_network = ResNet18Feature()
      # setup classifier
      classifier_network = ClassNetSmallImage
      train_params = testing_cfg["train_params"].copy()
      if method == "MFSAN":
          train_params["input_dimension"] = input_dimension
          if input_dimension == 2:
              feature_network = torch.nn.Sequential(
                  *(list(feature_network.model.children())[:-1])
              )
  
      model = create_ms_adapt_trainer(
          method=method,
          dataset=dataset,
          feature_extractor=feature_network,
          task_classifier=classifier_network,
          n_classes=10,
          target_domain="amazon",
          **train_params,
      )
      kwargs = {
          "limit_train_batches": 0.1,
          "limit_val_batches": 0.3,
          "limit_test_batches": 0.2,
      }
      ModelTestHelper.test_model(model, train_params, **kwargs)
  
file_path: pykale/tests/pipeline/test_multi_domain_adapter.py
imports: import matplotlib.figure
  import pytest
  import torch
  from sklearn.metrics import accuracy_score
  from torch.nn.functional import one_hot
  from kale.embed.image_cnn import ResNet18Feature
  from kale.interpret.visualize import distplot_1d
  from kale.loaddata.image_access import ImageAccess
  from kale.loaddata.multi_domain import MultiDomainAdapDataset
  from kale.pipeline.multi_domain_adapter import CoIRLS, create_ms_adapt_trainer
  from kale.predict.class_domain_nets import ClassNetSmallImage
  from tests.helpers.pipe_test_helper import ModelTestHelper
label_desc: Use image node_id 3 for calling a global function with example usage: test_multi_source(method, input_dimension, office_caltech_access, testing_cfg) without return types