def METHOD_NAME(self, variable, filter_ids=None):
    N = {}
    if variable == 'spikes':
        for id in self.filter_recorded(variable, filter_ids):
            N[int(id)] = id._cell.spike_times.size()
    else:
        raise Exception("Only implemented for spikes")
    return N