'Simulate the data for a particular event-id.
The epochs corresponding to a particular event-id are returned. The
method remembers the epoch that was returned in the previous call and
returns the next epoch in sequence. Once all epochs corresponding to
an event-id have been exhausted, the method returns None.
Parameters
event_id : int
The id of the event to consider.
tmin : float
Start time before event.
tmax : float
End time after event.
picks : array-like of int
Indices of channels.
stim_channel : None | string | list of string
Name of the stim channel or all the stim channels
affected by the trigger. If None, the config variables
\'MNE_STIM_CHANNEL\', \'MNE_STIM_CHANNEL_1\', \'MNE_STIM_CHANNEL_2\',
etc. are read. If these are not found, it will default to
\'STI 014\'.
min_duration : float
The minimum duration of a change in the events channel required
to consider it as an event (in seconds).
Returns
data : 2D array with shape [n_channels, n_times]
The epochs that are being simulated'

def get_event_data(self, event_id, tmin, tmax, picks, stim_channel=None, min_duration=0):

    events = find_events(self.raw, stim_channel=stim_channel, verbose=False, output='onset', consecutive='increasing', min_duration=min_duration)
    idx = np.where((events[:, (-1)] == event_id))[0]
    event_samp = events[(idx, 0)]
    if (event_id not in self._current):
        self._current[event_id] = 0
        self._last[event_id] = len(event_samp)
    tmin_samp = int(round((self.info['sfreq'] * tmin)))
    tmax_samp = (int(round((self.info['sfreq'] * tmax))) + 1)
    if (self._current[event_id] < self._last[event_id]):
        ev_samp = event_samp[self._current[event_id]]
        start = ((ev_samp + tmin_samp) - self.raw.first_samp)
        stop = ((ev_samp + tmax_samp) - self.raw.first_samp)
        self._current[event_id] += 1
        (data, _) = self.raw[picks, start:stop]
        return data
    else:
        return None
