import pickle


def unPickle(pickle_file):
    """
    Unpickles the data file into tr, te, and validation data
    """
    with open(pickle_file, 'rb') as f:
        datasets = pickle.load(f)
        test_dataset = datasets['test_dataset']
        test_labels = datasets['test_labels']
        train_dataset = datasets['train_dataset']
        train_labels = datasets['train_labels']
        valid_dataset = datasets['valid_dataset']
        valid_labels = datasets['valid_labels']
    return test_dataset, test_labels, train_dataset, train_labels,\
        valid_dataset, valid_labels