def METHOD_NAME(self, unit_id, start_frame, end_frame):
    mask = self._spike_ids == unit_id
    times = self._spike_times[mask]
    if start_frame is not None:
        times = times[times >= start_frame]
    if end_frame is not None:
        times = times[times < end_frame]
    return times