def _maybe_download_cifar10(path):
 if (not os.path.exists(path)):
  os.makedirs(path)
 filepath = os.path.join(path, CIFAR10_FILE)
 if (not os.path.exists(filepath)):
  print('Downloading CIFAR10 dataset to {}'.format(filepath))
  url = os.path.join(CIFAR10_URL, CIFAR10_FILE)
  (filepath, _) = urllib.request.urlretrieve(url, filepath)
  statinfo = os.stat(filepath)
  print('Successfully downloaded {} bytes'.format(statinfo.st_size))
  tarfile.open(filepath, 'r:gz').extractall(path)

def _maybe_download_cifar10 ( path ) : if ( not os . path . exists ( path ) ) : os . makedirs ( path ) filepath = os . path . join ( path , CIFAR10_FILE ) if ( not os . path . exists ( filepath ) ) : print ( 'Downloading CIFAR10 dataset to {}' . format ( filepath ) ) url = os . path . join ( CIFAR10_URL , CIFAR10_FILE ) ( filepath , _ ) = urllib . request . urlretrieve ( url , filepath ) statinfo = os . stat ( filepath ) print ( 'Successfully downloaded {} bytes' . format ( statinfo . st_size ) ) tarfile . open ( filepath , 'r:gz' ) . extractall ( path )
download and extract the tarball from alexs website .