import six
import pickle


def load_pickle(file_path):
    """
    Load pickled data from file

    Parameters
    -------
    file_path : string
        Path of the file to load pickled data

    Returns
    -------
    data : data pickled in file
    """
    with open(file_path, 'rb') as f:
        if six.PY2:
            return pickle.load(f)
        else:
            return pickle.load(f, encoding='bytes')