code: def get_mnist(data_type="train", location="/tmp/mnist"):
      """
      Get mnist dataset with features and label as ndarray.
      Data would be downloaded automatically if it doesn't present at the specific location.
  
      :param data_type: "train" for training data and "test" for testing data.
      :param location: Location to store mnist dataset.
      :return: (features: ndarray, label: ndarray)
      """
      X, Y = mnist.read_data_sets(location, data_type)
      return X, Y + 1
  
imports: from optparse import OptionParser
  from bigdl.dllib.feature.dataset import mnist
  from bigdl.dllib.models.lenet.lenet5 import build_model
  from bigdl.dllib.nn.criterion import *
  from bigdl.dllib.optim.optimizer import *
  from bigdl.dllib.utils.common import *
label_desc: Use image node_id 1 for calling a global function with example usage: get_mnist(data_type, location) and returns: X,  unknown