class_docstr: TF data handler for CIFAR-10 dataset and model.
class_docstr_tok: ["TF","data","handler","for","CIFAR-10","dataset","and","model","."]
docstr: Download and extract the tarball from Alex Krizhevsky's website.
docstr_tok: ["Download","and","extract","the","tarball","from","Alex","Krizhevsky","'s","website","."]
code: def maybe_download_and_extract(self):
      """Download and extract the tarball from Alex Krizhevsky's website."""
      if not os.path.exists(self.cifar10_dir):
          if not os.path.exists(self.data_dir):
              os.makedirs(self.data_dir)
  
          def _progress(count, block_size, total_size):
              status_msg = "\r>> Downloading {} {:>3}%   "
              sys.stdout.write(
                  status_msg.format(
                      self.cifar10_tarball,
                      float(count * block_size) / total_size * 100.0,
                  )
              )
              sys.stdout.flush()
  
          file_path, _ = urlretrieve(
              CIFAR10_URL, self.cifar10_tarball, _progress
          )
  
          stat_info = os.stat(file_path)
          print(
              "\nSuccessfully downloaded",
              file_path,
              stat_info.st_size,
              "bytes.\n",
          )
  
          tarfile.open(file_path, "r:gz").extractall(self.data_dir)
  
file_path: hiddenlayer/demos/tf_cifar10.py
imports: from __future__ import absolute_import, division, print_function
  import os, sys, tarfile, pickle
  import tensorflow
  import numpy
  from urllib.request import urlretrieve
label_desc: Use image node_id 9 for calling the CIFAR10 obj's underlying member method code with example usage: obj.maybe_download_and_extract() without return types