def provide_data(mnist):
    """
    This function provide data object with desired shape.
    The attribute of data object:
        - train
        - validation
        - test
    The sub attributs of the data object attributes:
        -images
        -labels

    :param mnist: The downloaded MNIST dataset
    :return: data: The data object.
                   ex: data.train.images return the images of the dataset object in the training set!


    """
    ################################################
    ########## Get the images and labels############
    ################################################

    # Note: This setup is specific to mnist data but can be generalized for any data.
    # The ?_images(? can be train, validation or test) must have the format of [num_samples, rows, columns, depth] after extraction from data.
    # The ?_labels(? can be train, validation or test) must have the format of [num_samples,] after extraction from data.
    train_images = mnist.train.images
    train_labels = mnist.train.labels
    validation_images = mnist.validation.images
    validation_labels = mnist.validation.labels
    test_images = mnist.test.images
    test_labels = mnist.test.labels

    # Create separate objects for train, validation & test.
    train = DATA_OBJECT(train_images, train_labels, num_classes=10, one_hot=True, dtype=np.float32, reshape=False)
    validation = DATA_OBJECT(validation_images, validation_labels, num_classes=10, one_hot=True, dtype=np.float32,
                             reshape=False)
    test = DATA_OBJECT(test_images, test_labels, num_classes=10, one_hot=True, dtype=np.float32, reshape=False)

    # Create the whole data object
    DataSetObject = collections.namedtuple('DataSetObject', ['train', 'validation', 'test'])
    data = DataSetObject(train=train, validation=validation, test=test)

    return data

    This function provide data object with desired shape.
    The attribute of data object:
        - train
        - validation
        - test
    The sub attributs of the data object attributes:
        -images
        -labels

    :param mnist: The downloaded MNIST dataset
    :return: data: The data object.
                   ex: data.train.images return the images of the dataset object in the training set!


    
codes/3-neural_networks/convolutional-neural-network/code/input_function/input.py