def METHOD_NAME(self, variable, filter_ids=None):
    N = {}
    filtered_ids = self.filter_recorded(variable, filter_ids)
    padding = self.population.first_id
    indices = np.fromiter(filtered_ids, dtype=int) - padding
    spiky = self._devices['spikes'].spike_trains()
    for i, id in zip(indices, filtered_ids):
        N[id] = len(spiky[i])
    return N