class_docstr: Common API for office dataset access
  
  Args:
      root (string): root directory of dataset
      transform (callable, optional): A function/transform that takes in an PIL image and returns a transformed
          version. Defaults to office_transform.
      download (bool, optional): Whether to allow downloading the data if not found on disk. Defaults to False.
  
  References:
      [1] Saenko, K., Kulis, B., Fritz, M. and Darrell, T., 2010, September. Adapting visual category models to
      new domains. In European Conference on Computer Vision (pp. 213-226). Springer, Berlin, Heidelberg.
      [2] Griffin, Gregory and Holub, Alex and Perona, Pietro, 2007. Caltech-256 Object Category Dataset.
      California Institute of Technology. (Unpublished).
      https://resolver.caltech.edu/CaltechAUTHORS:CNS-TR-2007-001.
      [3] Gong, B., Shi, Y., Sha, F. and Grauman, K., 2012, June. Geodesic flow kernel for unsupervised
      domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition (pp. 2066-2073).
class_docstr_tok: ["Common","API","for","office","dataset","access","Args",":","root","(","string",")",":","root","directory","of","dataset","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an","PIL","image","and","returns","a","transformed","version",".","Defaults","to","office_transform",".","download","(","bool",",","optional",")",":","Whether","to","allow","downloading","the","data","if","not","found","on","disk",".","Defaults","to","False",".","References",":","[","1","]","Saenko",",","K.",",","Kulis",",","B.",",","Fritz",",","M.","and","Darrell",",","T.",",","2010",",","September",".","Adapting","visual","category","models","to","new","domains",".","In","European","Conference","on","Computer","Vision","(","pp",".","213-226",")",".","Springer",",","Berlin",",","Heidelberg",".","[","2","]","Griffin",",","Gregory","and","Holub",",","Alex","and","Perona",",","Pietro",",","2007",".","Caltech-256","Object","Category","Dataset",".","California","Institute","of","Technology",".","(","Unpublished",")",".","https",":","\/\/resolver.caltech.edu\/CaltechAUTHORS",":","CNS-TR-2007-001",".","[","3","]","Gong",",","B.",",","Shi",",","Y.",",","Sha",",","F.","and","Grauman",",","K.",",","2012",",","June",".","Geodesic","flow","kernel","for","unsupervised","domain","adaptation",".","In","IEEE","Conference","on","Computer","Vision","and","Pattern","Recognition","(","pp",".","2066-2073",")","."]
docstr: Download dataset.
  Office-31 source: https://www.cc.gatech.edu/~judy/domainadapt/#datasets_code
  Caltech-256 source: http://www.vision.caltech.edu/Image_Datasets/Caltech256/
  Data with this library is adapted from: http://www.stat.ucla.edu/~jxie/iFRAME/code/imageClassification.rar
docstr_tok: ["Download","dataset",".","Office-31","source",":","https",":","\/\/www.cc.gatech.edu\/~judy\/domainadapt\/","#","datasets_code","Caltech-256","source",":","http",":","\/\/www.vision.caltech.edu\/Image_Datasets\/Caltech256\/","Data","with","this","library","is","adapted","from",":","http",":","\/\/www.stat.ucla.edu\/~jxie\/iFRAME\/code\/imageClassification.rar"]
code: def download(path):
      """Download dataset.
      Office-31 source: https://www.cc.gatech.edu/~judy/domainadapt/#datasets_code
      Caltech-256 source: http://www.vision.caltech.edu/Image_Datasets/Caltech256/
      Data with this library is adapted from: http://www.stat.ucla.edu/~jxie/iFRAME/code/imageClassification.rar
      """
      url = "https://github.com/pykale/data/raw/main/images/office"
  
      if not os.path.exists(path):
          os.makedirs(path)
      for domain_ in OFFICE_DOMAINS:
          filename = "%s.zip" % domain_
          data_path = os.path.join(path, filename)
          if os.path.exists(data_path):
              logging.info(f"Data file {filename} already exists.")
              continue
          else:
              data_url = "%s/%s" % (url, filename)
              download_file_by_url(data_url, path, filename, "zip")
              logging.info(f"Download {data_url} to {data_path}")
  
      logging.info("[DONE]")
      return
  
imports: import glob
  import logging
  import os
  from enum import Enum
  import numpy
  import pydicom
  import torch
  from torchvision import datasets, transforms
  from kale.loaddata.dataset_access import DatasetAccess
  from kale.loaddata.mnistm import MNISTM
  from kale.loaddata.multi_domain import MultiDomainAccess, MultiDomainImageFolder
  from kale.loaddata.usps import USPS
  from kale.prepdata.image_transform import get_transform
  from kale.utils.download import download_file_by_url
label_desc: Use image node_id 2 for calling the OfficeAccess obj's underlying member method code with example usage: obj.download(path) without return types