class_docstr: Produces [image, label] in Cifar10/100 dataset,
  image is 32x32x3 in the range [0,255].
  label is an int.
docstr: Args:
      train_or_test (str): 'train' or 'test'
      shuffle (bool): defaults to True for training set.
      dir (str): path to the dataset directory
      cifar_classnum (int): 10 or 100
docstr_tok: ["Args",":","train_or_test","(","str",")",":","'train","'","or","'test'","shuffle","(","bool",")",":","defaults","to","True","for","training","set",".","dir","(","str",")",":","path","to","the","dataset","directory","cifar_classnum","(","int",")",":","10","or","100"]
code: def __init__(
      self, train_or_test, shuffle=None, dir=None, cifar_classnum=10
  ):
      """
      Args:
          train_or_test (str): 'train' or 'test'
          shuffle (bool): defaults to True for training set.
          dir (str): path to the dataset directory
          cifar_classnum (int): 10 or 100
      """
      assert train_or_test in ["train", "test"]
      assert cifar_classnum == 10 or cifar_classnum == 100
      self.cifar_classnum = cifar_classnum
      if dir is None:
          dir = get_dataset_path("cifar{}_data".format(cifar_classnum))
      maybe_download_and_extract(dir, self.cifar_classnum)
      train_files, test_files, meta_file = get_filenames(
          dir, cifar_classnum
      )
      if train_or_test == "train":
          self.fs = train_files
      else:
          self.fs = test_files
      for f in self.fs:
          if not os.path.isfile(f):
              raise ValueError("Failed to find file: " + f)
      self._label_names = _parse_meta(meta_file, cifar_classnum)
      self.train_or_test = train_or_test
      self.data = read_cifar(self.fs, cifar_classnum)
      self.dir = dir
  
      if shuffle is None:
          shuffle = train_or_test == "train"
      self.shuffle = shuffle
  
imports: import numpy
  import os
  import pickle
  import tarfile
  from ...utils import logger
  from ...utils.fs import download, get_dataset_path
  from ..base import RNGDataFlow
label_desc: Use image node_id 1 to create a new CifarBase object from inherited base classes: RNGDataFlow with example: obj = CifarBase(train_or_test, shuffle, dir, cifar_classnum)