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 download_mnist.py (e.g. python3 download_mnist.py)"
          )
          sys.exit(0)
      return dirpath
  
imports: from singa import singa_wrap
  from singa import autograd
  from singa import layer
  from singa import tensor
  from singa import device
  from singa import opt
  import numpy
  import os
  import sys
  import gzip
  import codecs
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: check_dataset_exist(dirpath) and returns: dirpath