class_docstr: CIFAR10 data set from https://www.cs.toronto.edu/~kriz/cifar.html
  
  Arguments:
      path (str): Local path to copy data files.
      normalize (bool): Flag to normalize data.
      whiten (bool): Flag to apply whitening transform.
      pad_classes (bool): Flag to pad out class count to 16
                          for compatibility with conv layers on GPU.
docstr: Fetch the CIFAR-10 dataset and load it into memory.
  
  Arguments:
      path (str, optional): Local directory in which to cache the raw
                            dataset.  Defaults to current directory.
      normalize (bool, optional): Whether to scale values between 0 and 1.
                                  Defaults to True.
  
  Returns:
      tuple: Both training and test sets are returned.
docstr_tok: ["Fetch","the","CIFAR-10","dataset","and","load","it","into","memory",".","Arguments",":","path","(","str",",","optional",")",":","Local","directory","in","which","to","cache","the","raw","dataset",".","Defaults","to","current","directory",".","normalize","(","bool",",","optional",")",":","Whether","to","scale","values","between","0","and","1",".","Defaults","to","True",".","Returns",":","tuple",":","Both","training","and","test","sets","are","returned","."]
code: def load_data(self):
      """
      Fetch the CIFAR-10 dataset and load it into memory.
  
      Arguments:
          path (str, optional): Local directory in which to cache the raw
                                dataset.  Defaults to current directory.
          normalize (bool, optional): Whether to scale values between 0 and 1.
                                      Defaults to True.
  
      Returns:
          tuple: Both training and test sets are returned.
      """
      workdir, filepath = self._valid_path_append(
          self.path, "", self.filename
      )
      batchdir = os.path.join(workdir, "cifar-10-batches-py")
      if not os.path.exists(os.path.join(batchdir, "data_batch_1")):
          if not os.path.exists(filepath):
              self.fetch_dataset(
                  self.url, self.filename, filepath, self.size
              )
          with tarfile.open(filepath, "r:gz") as f:
              f.extractall(workdir)
  
      train_batches = [
          os.path.join(batchdir, "data_batch_" + str(i))
          for i in range(1, 6)
      ]
      Xlist, ylist = [], []
      for batch in train_batches:
          with open(batch, "rb") as f:
              d = pickle_load(f)
              Xlist.append(d["data"])
              ylist.append(d["labels"])
  
      X_train = np.vstack(Xlist)
      y_train = np.vstack(ylist)
  
      with open(os.path.join(batchdir, "test_batch"), "rb") as f:
          d = pickle_load(f)
          X_test, y_test = d["data"], d["labels"]
  
      y_train = y_train.reshape(-1, 1)
      y_test = np.array(y_test).reshape(-1, 1)
  
      if self.contrast_normalize:
          norm_scale = 55.0  # Goodfellow
          X_train = self.global_contrast_normalize(
              X_train, scale=norm_scale
          )
          X_test = self.global_contrast_normalize(
              X_test, scale=norm_scale
          )
  
      if self.normalize:
          X_train = X_train / 255.0
          X_test = X_test / 255.0
  
      if self.whiten:
          zca_cache = os.path.join(workdir, "cifar-10-zca-cache.pkl")
          X_train, X_test = self.zca_whiten(
              X_train, X_test, cache=zca_cache
          )
  
      return (X_train, y_train), (X_test, y_test), 10
  
imports: from __future__ import division
  from future import standard_library
  from builtins import str
  import gzip
  import logging
  import numpy
  import os
  import tarfile
  from neon.util.compat import pickle
  from neon.util.compat import pickle_load
  from neon.data.datasets import Dataset
  from neon.data.dataiterator import ArrayIterator
label_desc: Use image node_id 2 for calling the CIFAR10 obj's underlying member method code with example usage: obj.load_data() and returns: X_train,  y_train,  X_test,  y_test,  int