code: def check_dataset_exist(dirpath):
      if not os.path.exists(dirpath):
          print(
              "The MNIST dataset does not exist. Please download the mnist dataset using python data/download_mnist.py"
          )
          sys.exit(0)
      return dirpath
  
file_path: singa/examples/cifar_distributed_cnn/data/mnist.py
imports: import numpy
  import os
  import sys
  import gzip
  import codecs
label_desc: Use image node_id 1 for calling a global function with example usage: check_dataset_exist(dirpath) and returns: dirpath