def totalSpikeRate(resp, spikes, xBest, xData, expUnits=qu.Hz):
    '''
    Calculates the spike rate during interval [0, 1000)ms of stimulus application
    :param resp: unused
    :param spikes: see file documentation above
    :param xBest: unused
    :param xData: unused
    :param expUnits: see file documentation above
    :return: quantites.Quantity
    '''
    spikeRate = getSpikeRateIn(spikes,
                               intervalStart=0 * qu.ms,
                               intervalEnd=1 * qu.s)

    spikeRate *= simpleFloat(expUnits / qu.Hz)

    return spikeRate
def spontAct3Sec(resp, spikes, xBest, xData, expUnits=qu.Hz):
    '''
    Calculates the spike rate during the 3s interval preceding stimulus application
    :param resp: unused
    :param spikes: see file documentation above
    :param xBest: unused
    :param xData: unused
    :param expUnits: see file documentation above
    :return: quantities.Quantity
    '''
    spikeRate = getSpikeRateIn(spikes,
                               intervalStart=-3 * qu.s,
                               intervalEnd=0 * qu.s)

    spikeRate *= simpleFloat(expUnits / qu.Hz)

    return spikeRate