code: def prepare_ImageNet_data():
      base_path = os.path.join(
          os.path.dirname(os.path.abspath(__file__)),
          *"../../../../Examples/Image/DataSets/ImageNet".split("/"),
      )
      base_path = os.path.normpath(base_path)
      if not os.path.isdir(base_path):
          os.mkdir(base_path)
  
      # If val1024_map.txt don't exist locally, copy to local location
      if not (
          os.path.isfile(os.path.join(base_path, "train_map.txt"))
          and os.path.isfile(os.path.join(base_path, "val_map.txt"))
      ):
          # copy from backup location
          base_path_bak = os.path.join(
              os.environ[envvar], *"Image/ImageNet/2012/v0".split("/")
          )
          base_path_bak = os.path.normpath(base_path_bak)
  
          copyfile(
              os.path.join(base_path_bak, "val1024_map.txt"),
              os.path.join(base_path, "train_map.txt"),
          )
          copyfile(
              os.path.join(base_path_bak, "val1024_map.txt"),
              os.path.join(base_path, "val_map.txt"),
          )
          copyfile(
              os.path.join(base_path_bak, "val1024.zip"),
              os.path.join(base_path, "val1024.zip"),
          )
      return base_path
  
file_path: CNTK/Tests/EndToEndTests/CNTKv2Python/Examples/prepare_test_data.py
imports: import os
  import tarfile
  import zipfile
  from shutil import copyfile
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_ImageNet_data() and returns: base_path