'Save epochs in a fif file.
Parameters
fname : str
The name of the file, which should end with -epo.fif or
-epo.fif.gz.
split_size : string | int
Large raw files are automatically split into multiple pieces. This
parameter specifies the maximum size of each piece. If the
parameter is an integer, it specifies the size in Bytes. It is
also possible to pass a human-readable string, e.g., 100MB.
Note: Due to FIFF file limitations, the maximum split size is 2GB.
.. versionadded:: 0.10.0
Notes
Bad epochs will be dropped before saving the epochs to disk.'

def save(self, fname, split_size='2GB'):

    check_fname(fname, 'epochs', ('-epo.fif', '-epo.fif.gz'))
    split_size = _get_split_size(split_size)
    self.drop_bad()
    total_size = (self[0].get_data().nbytes * len(self))
    total_size /= 2
    n_parts = int(np.ceil((total_size / float(split_size))))
    epoch_idxs = np.array_split(np.arange(len(self)), n_parts)
    for (part_idx, epoch_idx) in enumerate(epoch_idxs):
        this_epochs = (self[epoch_idx] if (n_parts > 1) else self)
        this_epochs.event_id = self.event_id
        _save_split(this_epochs, fname, part_idx, n_parts)
