code: def check_dataset_exist(dirpath):
      if not os.path.exists(dirpath):
          print(
              "Please download the cifar10 dataset using download_data.py (e.g. python ~/singa/examples/cifar10/download_data.py py)"
          )
          sys.exit(0)
      return dirpath
  
imports: from singa import singa_wrap
  from singa import autograd
  from singa import tensor
  from singa import device
  from singa import opt
  from PIL import Image
  import numpy
  import os
  import sys
  import time
label_desc: Use image node_id 4 for calling a global function with example usage: check_dataset_exist(dirpath) and returns: dirpath