code: def maybe_download_and_extract(dest_directory, cifar_classnum):
      """Download and extract the tarball from Alex's website. Copied from tensorflow example"""
      assert cifar_classnum == 10 or cifar_classnum == 100
      if cifar_classnum == 10:
          cifar_foldername = "cifar-10-batches-py"
      else:
          cifar_foldername = "cifar-100-python"
      if os.path.isdir(os.path.join(dest_directory, cifar_foldername)):
          logger.info(
              "Found cifar{} data in {}.".format(
                  cifar_classnum, dest_directory
              )
          )
          return
      else:
          DATA_URL = (
              DATA_URL_CIFAR_10
              if cifar_classnum == 10
              else DATA_URL_CIFAR_100
          )
          filename = DATA_URL[0].split("/")[-1]
          filepath = os.path.join(dest_directory, filename)
          download(DATA_URL[0], dest_directory, expect_size=DATA_URL[1])
          tarfile.open(filepath, "r:gz").extractall(dest_directory)
  
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 for calling a global function with example usage: maybe_download_and_extract(dest_directory, cifar_classnum) without return types