class_docstr: MNIST-M Dataset.
  Auto-downloads the dataset and provide the torch Dataset API.
  
  Args:
      root (str): path to directory where the MNISTM folder will be created (or exists.)
      train (bool, optional): defaults to True.
          If True, loads the training data. Otherwise, loads the test data.
      transform (callable, optional): defaults to None.
          A function/transform that takes in
          an PIL image and returns a transformed version.
          E.g., ``transforms.RandomCrop``
          This preprocessing function applied to all images (whether source or target)
  
      target_transform (callable, optional): default to None, similar to transform.
          This preprocessing function applied to all target images, after `transform`
  
      download (bool optional): defaults to False.
          Whether to allow downloading the data if not found on disk.
docstr: Init MNIST-M dataset.
docstr_tok: ["Init","MNIST-M","dataset","."]
code: def __init__(
      self,
      root,
      train=True,
      transform=None,
      target_transform=None,
      download=False,
  ):
      """Init MNIST-M dataset."""
      super(MNISTM, self).__init__()
      self.root = os.path.join(root, "MNISTM")
      self.mnist_root = root
      self.transform = transform
      self.target_transform = target_transform
      self.train = train  # training set or test set
  
      if download:
          self.download()
  
      if not self._check_exists():
          raise RuntimeError(
              "Dataset not found."
              + " You can use download=True to download it"
          )
  
      if self.train:
          self.data, self.targets = torch.load(
              os.path.join(
                  self.root, self.processed_folder, self.training_file
              )
          )
      else:
          self.data, self.targets = torch.load(
              os.path.join(
                  self.root, self.processed_folder, self.test_file
              )
          )
  
file_path: pykale/kale/loaddata/mnistm.py
imports: from __future__ import print_function
  import errno
  import logging
  import os
  import torch
  import torch.utils.data
  from PIL import Image
label_desc: Use image node_id 1 to create a new MNISTM object from inherited base classes: data with example: obj = MNISTM(root, train, transform, target_transform, download)