code: def download_mnist_retry(seed=0, max_num_retries=20):
      for _ in range(max_num_retries):
          try:
              return input_data.read_data_sets(
                  "MNIST_data", one_hot=True, seed=seed
              )
          except tf.errors.AlreadyExistsError:
              time.sleep(1)
      invalidInputError(False, "Failed to download MNIST.")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import time
  import tensorflow
  from tensorflow.examples.tutorials.mnist import input_data
  import ray
  import ray.experimental.tf_utils
  from bigdl.dllib.utils.log4Error import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: download_mnist_retry(seed, max_num_retries) and returns: input_data