import pickle


def load_spikes(pklf_name):
    """
    Loads in saved spikes from simulations
    param pklf_name: name of saved file
    return: spike_times, spiking_neurons, rate
    """

    with open(pklf_name, "rb") as f:
        tmp = pickle.load(f, encoding="latin1")
    return tmp["spike_times"], tmp["spiking_neurons"], tmp["rate"]