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: Get images and target for data loader.
  Args:
      index (int): Index
  Returns:
      tuple: (image, target) where target is index of the target class.
docstr_tok: ["Get","images","and","target","for","data","loader",".","Args",":","index","(","int",")",":","Index","Returns",":","tuple",":","(","image",",","target",")","where","target","is","index","of","the","target","class","."]
code: def __getitem__(self, index):
      """Get images and target for data loader.
      Args:
          index (int): Index
      Returns:
          tuple: (image, target) where target is index of the target class.
      """
      img, target = self.data[index], self.targets[index]
  
      # doing this so that it is consistent with all other datasets
      # to return a PIL Image
      img = Image.fromarray(img.squeeze().numpy(), mode="RGB")
  
      if self.transform is not None:
          img = self.transform(img)
  
      if self.target_transform is not None:
          target = self.target_transform(target)
  
      return img, target
  
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 2 for calling the MNISTM obj's underlying member method code with example usage: obj.__getitem__(index) and returns: img,  target