class_docstr: Concatenate multiple datasets as a single dataset with domain labels
  
  Args:
      data_access (dict): Dictionary of domain datasets, e.g. {"Domain1_name": domain1_set,
          "Domain2_name": domain2_set}
      domain_to_idx (dict): Dictionary of domain name to domain labels, e.g. {"Domain1_name": 0, "Domain2_name": 1}
      return_domain_label (Optional[bool], optional): Whether return domain labels in each batch. Defaults to False.
class_docstr_tok: ["Concatenate","multiple","datasets","as","a","single","dataset","with","domain","labels","Args",":","data_access","(","dict",")",":","Dictionary","of","domain","datasets",",","e.g",".","{","``","Domain1_name","''",":","domain1_set",",","``","Domain2_name","''",":","domain2_set","}","domain_to_idx","(","dict",")",":","Dictionary","of","domain","name","to","domain","labels",",","e.g",".","{","``","Domain1_name","''",":","0",",","``","Domain2_name","''",":","1","}","return_domain_label","(","Optional","[","bool","]",",","optional",")",":","Whether","return","domain","labels","in","each","batch",".","Defaults","to","False","."]
code: def __getitem__(self, index: int) -> Tuple:
      if self.return_domain_label:
          return (
              self.data[index],
              self.labels[index],
              self.domain_labels[index],
          )
      else:
          return self.data[index], self.labels[index]
  
imports: import logging
  import os
  from enum import Enum
  from typing import Any, Callable, cast, Dict, List, Optional, Tuple
  import numpy
  import torch.utils.data
  from sklearn.utils import check_random_state
  from torchvision.datasets import VisionDataset
  from torchvision.datasets.folder import default_loader, has_file_allowed_extension, IMG_EXTENSIONS
  from kale.loaddata.dataset_access import DatasetAccess, get_class_subset, split_by_ratios
  from kale.loaddata.sampler import FixedSeedSamplingConfig, get_labels, MultiDataLoader, SamplingConfig
label_desc: Use image node_id 2 for calling the ConcatMultiDomainAccess obj's underlying member method code with example usage: obj.__getitem__(index) and returns: self,  self,  self, self,  self