class_docstr: USPS Dataset.
  
  Args:
      root (string): Root directory of dataset where dataset file exist.
      train (bool, optional): If True, resample from dataset randomly.
      download (bool, optional): If true, downloads the dataset
          from the internet and puts it in root directory.
          If dataset is already downloaded, it is not downloaded again.
      transform (callable, optional): A function/transform that takes in
          an PIL image and returns a transformed version.
          E.g, ``transforms.RandomCrop``
docstr: Init USPS dataset.
docstr_tok: ["Init","USPS","dataset","."]
code: def __init__(self, root, train=True, transform=None, download=False):
      """Init USPS dataset."""
      # init params
      self.root = os.path.expanduser(root)
      self.filename = "usps_28x28.pkl"
      self.train = train
      # Num of Train = 7438, Num ot Test 1860
      self.transform = transform
      self.dataset_size = None
  
      # download dataset.
      if download:
          self.download()
      if not self._check_exists():
          raise RuntimeError(
              "Dataset not found."
              + " You can use download=True to download it"
          )
  
      self.data, self.targets = self.load_samples()
      self.targets = torch.LongTensor(self.targets)
      if self.train:
          total_num_samples = self.data.shape[0]
          indices = np.arange(total_num_samples)
          np.random.shuffle(indices)
          self.data = self.data[indices[0 : self.dataset_size], ::]
          self.targets = self.targets[indices[0 : self.dataset_size]]
      # self.train_data *= 255.0  # TODO check bug
      self.data = self.data.transpose((0, 2, 3, 1))
  
file_path: pykale/kale/loaddata/usps.py
imports: import gzip
  import logging
  import os
  import pickle
  import urllib
  import numpy
  import torch
  import torch.utils.data
label_desc: Use image node_id 1 to create a new USPS object from inherited base classes: data with example: obj = USPS(root, train, transform, download)