code: def test_office31(office_path, test_on_all):
      office_access = ImageAccess.get_multi_domain_images(
          "OFFICE31",
          office_path,
          download=False,
          return_domain_label=True,
      )
      testing.assert_equal(len(office_access.class_to_idx), 31)
      testing.assert_equal(len(office_access.domain_to_idx), 3)
      dataset = MultiDomainAdapDataset(
          office_access, test_on_all=test_on_all
      )
      dataset.prepare_data_loaders()
      domain_labels = list(dataset.domain_to_idx.values())
      for split in ["train", "valid", "test"]:
          dataloader = dataset.get_domain_loaders(split=split)
          x, y, z = next(iter(dataloader))
          for domain_label_ in domain_labels:
              testing.assert_equal(y[z == domain_label_].shape[0], 10)
  
file_path: pykale/tests/loaddata/test_image_access.py
imports: import pytest
  import torch
  from numpy import testing
  from yacs.config import CfgNode
  from kale.loaddata.dataset_access import get_class_subset
  from kale.loaddata.image_access import DigitDataset, DigitDatasetAccess, get_cifar, ImageAccess
  from kale.loaddata.multi_domain import DomainsDatasetBase, MultiDomainAdapDataset, MultiDomainDatasets
label_desc: Use image node_id 1 for calling a global function with example usage: test_office31(office_path, test_on_all) without return types