class_docstr: Abstract class for cifar readers
class_docstr_tok: ["Abstract","class","for","cifar","readers"]
docstr: Args:
          save_path: `str`
          validation_set: `bool`.
          validation_split: `float` or None
                  float: chunk of `train set` will be marked as `validation set`.
                  None: if 'validation set' == True, `validation set` will be
                          copy of `test set`
          shuffle: `str` or None
                  None: no any shuffling
                  once_prior_train: shuffle train data only once prior train
                  every_epoch: shuffle train data prior every epoch
          normalization: `str` or None
                  None: no any normalization
                  divide_255: divide all pixels by 255
                  divide_256: divide all pixels by 256
                  by_channels: substract mean of every chanel and divide each
                          chanel data by it's standard deviation
          one_hot: `bool`, return laels one hot encoded
docstr_tok: ["Args",":","save_path",":","`","str","`","validation_set",":","`","bool","`",".","validation_split",":","`","float","`","or","None","float",":","chunk","of","`","train","set","`","will","be","marked","as","`","validation","set","`",".","None",":","if","'validation","set","'","==","True",",","`","validation","set","`","will","be","copy","of","`","test","set","`","shuffle",":","`","str","`","or","None","None",":","no","any","shuffling","once_prior_train",":","shuffle","train","data","only","once","prior","train","every_epoch",":","shuffle","train","data","prior","every","epoch","normalization",":","`","str","`","or","None","None",":","no","any","normalization","divide_255",":","divide","all","pixels","by","255","divide_256",":","divide","all","pixels","by","256","by_channels",":","substract","mean","of","every","chanel","and","divide","each","chanel","data","by","it","'s","standard","deviation","one_hot",":","`","bool","`",",","return","laels","one","hot","encoded"]
code: def __init__(
      self,
      save_path=None,
      validation_size=None,
      shuffle=None,
      normalization=None,
      one_hot=True,
      **kwargs,
  ):
      """
      Args:
              save_path: `str`
              validation_set: `bool`.
              validation_split: `float` or None
                      float: chunk of `train set` will be marked as `validation set`.
                      None: if 'validation set' == True, `validation set` will be
                              copy of `test set`
              shuffle: `str` or None
                      None: no any shuffling
                      once_prior_train: shuffle train data only once prior train
                      every_epoch: shuffle train data prior every epoch
              normalization: `str` or None
                      None: no any normalization
                      divide_255: divide all pixels by 255
                      divide_256: divide all pixels by 256
                      by_channels: substract mean of every chanel and divide each
                              chanel data by it's standard deviation
              one_hot: `bool`, return laels one hot encoded
      """
      self._save_path = save_path
      self.one_hot = one_hot
      download_data_url(self.data_url, self.save_path)
      train_fnames, test_fnames = self.get_filenames(self.save_path)
  
      # add train and validations datasets
      images, labels = self.read_cifar(train_fnames)
      train_meanstd = ImagesDataSet.measure_mean_and_std(images)
      if validation_size is not None:
          np.random.seed(DataProvider._SEED)
          rand_indexes = np.random.permutation(images.shape[0])
          valid_indexes = rand_indexes[:validation_size]
          train_indexes = rand_indexes[validation_size:]
          self.train = CifarDataSet(
              images=images[train_indexes],
              labels=labels[train_indexes],
              n_classes=self.n_classes,
              shuffle=shuffle,
              normalization=normalization,
              augmentation=self.data_augmentation,
              meanstd=train_meanstd,
          )
          self.validation = CifarDataSet(
              images=images[valid_indexes],
              labels=labels[valid_indexes],
              n_classes=self.n_classes,
              shuffle=None,
              normalization=normalization,
              augmentation=False,
              meanstd=train_meanstd,
          )
      else:
          self.train = CifarDataSet(
              images=images,
              labels=labels,
              n_classes=self.n_classes,
              shuffle=shuffle,
              normalization=normalization,
              augmentation=self.data_augmentation,
              meanstd=train_meanstd,
          )
  
      # add test set
      images, labels = self.read_cifar(test_fnames)
      self.test = CifarDataSet(
          images=images,
          labels=labels,
          shuffle=None,
          n_classes=self.n_classes,
          normalization=normalization,
          augmentation=False,
          meanstd=train_meanstd,
      )
  
      if validation_size is None:
          self.validation = self.test
  
imports: import tempfile
  import os
  import pickle
  import random
  import numpy
  from ..data_providers.base_provider import ImagesDataSet, DataProvider
  from ..data_providers.downloader import download_data_url
label_desc: Use image node_id 1 to create a new CifarDataProvider object from inherited base classes: DataProvider with example: obj = CifarDataProvider(save_path, validation_size, shuffle, normalization, one_hot)