'Crop a time interval from epochs object.
Parameters
tmin : float | None
Start time of selection in seconds.
tmax : float | None
End time of selection in seconds.
Returns
epochs : instance of Epochs
The cropped epochs.
Notes
Unlike Python slices, MNE time intervals include both their end points;
crop(tmin, tmax) returns the interval tmin <= t <= tmax.'

def crop(self, tmin=None, tmax=None):

    if (not self.preload):
        raise RuntimeError('Modifying    data    of    epochs    is    only    supported    when    preloading    is    used.    Use    preload=True    in    the    constructor.')
    if (tmin is None):
        tmin = self.tmin
    elif (tmin < self.tmin):
        warn('tmin    is    not    in    epochs    time    interval.    tmin    is    set    to    epochs.tmin')
        tmin = self.tmin
    if (tmax is None):
        tmax = self.tmax
    elif (tmax > self.tmax):
        warn('tmax    is    not    in    epochs    time    interval.    tmax    is    set    to    epochs.tmax')
        tmax = self.tmax
    tmask = _time_mask(self.times, tmin, tmax, sfreq=self.info['sfreq'])
    self.times = self.times[tmask]
    self._raw_times = self._raw_times[tmask]
    self._data = self._data[:, :, tmask]
    return self
