def get_dataset_example_mnist(path_dataset, name_dataset, using_test_dataset):
    "\n    read input images (vector), dump into \n    '.pickle' format for next load, and return it as a numpy array.\n    "
    flag_dataloaded = 0
    if ((name_dataset != 'mnist_test_example') and (name_dataset != 'mnist_train_example')):
        raise Exception('You have provide the wrong dataset name or path, please check carefully')
    else:
        dataset_path_name = (path_dataset + name_dataset)
        if os.path.isfile(('%s.pickle' % dataset_path_name)):
            example = pickle.load(open(('%s.pickle' % dataset_path_name)))
            flag_dataloaded = 1
        else:
            flag_datasetsource = (((os.path.isfile((path_dataset + 'train-images.idx3-ubyte')) & os.path.isfile((path_dataset + 'train-labels.idx1-ubyte'))) & os.path.isfile((path_dataset + 't10k-images.idx3-ubyte'))) & os.path.isfile((path_dataset + 't10k-labels.idx1-ubyte')))
            if (flag_datasetsource == False):
                raise Exception(("You haven't downloaded the dataset into the %s!" % path_dataset))
            else:
                if using_test_dataset:
                    image = open((path_dataset + 't10k-images.idx3-ubyte'), 'rb')
                else:
                    image = open((path_dataset + 'train-images.idx3-ubyte'), 'rb')
                image.read(4)
                num_image = unpack('>I', image.read(4))[0]
                height_image = unpack('>I', image.read(4))[0]
                length_image = unpack('>I', image.read(4))[0]
                example = np.zeros((num_image, height_image, length_image), dtype=np.uint8)
                for i in xrange(num_image):
                    example[i] = [[unpack('>B', image.read(1))[0] for m in xrange(length_image)] for n in xrange(height_image)]
                pickle.dump(example, open(('%s.pickle' % dataset_path_name), 'wb'))
                flag_dataloaded = 1
    if (flag_dataloaded == 0):
        raise Exception('Failed to load the required dataset, please check the name_dataset and other printed information!')
    else:
        return example
read input images (vector), dump into 
'.pickle' format for next load, and return it as a numpy array.
def get_dataset_example_mnist(path_dataset, name_dataset, using_test_dataset):
    "\n    read input images (vector), dump into \n    '.pickle' format for next load, and return it as a numpy array.\n    "
    flag_dataloaded = 0
    if ((name_dataset != 'mnist_test_example') and (name_dataset != 'mnist_train_example')):
        raise Exception('You have provide the wrong dataset name or path, please check carefully')
    else:
        dataset_path_name = (path_dataset + name_dataset)
        if os.path.isfile(('%s.pickle' % dataset_path_name)):
            example = pickle.load(open(('%s.pickle' % dataset_path_name)))
            flag_dataloaded = 1
        else:
            flag_datasetsource = (((os.path.isfile((path_dataset + 'train-images.idx3-ubyte')) & os.path.isfile((path_dataset + 'train-labels.idx1-ubyte'))) & os.path.isfile((path_dataset + 't10k-images.idx3-ubyte'))) & os.path.isfile((path_dataset + 't10k-labels.idx1-ubyte')))
            if (flag_datasetsource == False):
                raise Exception(("You haven't downloaded the dataset into the %s!" % path_dataset))
            else:
                if using_test_dataset:
                    image = open((path_dataset + 't10k-images.idx3-ubyte'), 'rb')
                else:
                    image = open((path_dataset + 'train-images.idx3-ubyte'), 'rb')
                image.read(4)
                num_image = unpack('>I', image.read(4))[0]
                height_image = unpack('>I', image.read(4))[0]
                length_image = unpack('>I', image.read(4))[0]
                example = np.zeros((num_image, height_image, length_image), dtype=np.uint8)
                for i in xrange(num_image):
                    example[i] = [[unpack('>B', image.read(1))[0] for m in xrange(length_image)] for n in xrange(height_image)]
                pickle.dump(example, open(('%s.pickle' % dataset_path_name), 'wb'))
                flag_dataloaded = 1
    if (flag_dataloaded == 0):
        raise Exception('Failed to load the required dataset, please check the name_dataset and other printed information!')
    else:
        return example