'Iterate over epoch data.
Parameters
return_event_id : bool
If True, return both the epoch data and an event_id.
Returns
epoch : array of shape (n_channels, n_times)
The epoch data.
event_id : int
The event id. Only returned if ``return_event_id`` is ``True``.'

def next(self, return_event_id=False):

    if self.preload:
        if (self._current >= len(self._data)):
            return
        epoch = self._data[self._current]
        self._current += 1
    else:
        is_good = False
        while (not is_good):
            if (self._current >= len(self.events)):
                return
            epoch_noproj = self._get_epoch_from_raw(self._current)
            epoch_noproj = self._detrend_offset_decim(epoch_noproj)
            epoch = self._project_epoch(epoch_noproj)
            self._current += 1
            (is_good, _) = self._is_good_epoch(epoch)
        if self._do_delayed_proj:
            epoch = epoch_noproj
    if (not return_event_id):
        return epoch
    else:
        return (epoch, self.events[(self._current - 1)][(-1)])
    return ((epoch if (not return_event_id) else epoch), self.event_id)
