code: def get_data_rdd(dataset, sc):
      from bigdl.dataset import mnist
  
      (images_data, labels_data) = mnist.read_data_sets(
          "/tmp/mnist", dataset
      )
      image_rdd = sc.parallelize(images_data)
      labels_rdd = sc.parallelize(labels_data)
      rdd = image_rdd.zip(labels_rdd).map(
          lambda rec_tuple: (
              (rec_tuple[0] - mnist.TRAIN_MEAN) / mnist.TRAIN_STD,
              np.array(rec_tuple[1]),
          )
      )
      return rdd
  
imports: import sys
  import tensorflow
  import numpy
  from zoo import init_nncontext
  from zoo.tfpark import KerasModel, TFDataset
label_desc: Use image node_id 1 for calling a global function with example usage: get_data_rdd(dataset, sc) and returns: rdd