code: def check_dir_exist(dirpath):
      if os.path.exists(dirpath):
          print(
              "Directory %s does exist. To redownload the files, "
              "remove the existing directory and %s.tar.gz"
              % (dirpath, dirpath)
          )
          return True
      else:
          return False
  
file_path: singa/examples/cpp/cifar10/download_data.py
imports: from __future__ import print_function
  from future import standard_library
  import urllib.request, urllib.parse, urllib.error
  import tarfile
  import os
  import sys
  import argparse
label_desc: Use image node_id 2 for calling a global function with example usage: check_dir_exist(dirpath) and returns: True, False