'Remove selected components from the signal.
Given the unmixing matrix, transform data,
zero out components, and inverse transform the data.
This procedure will reconstruct M/EEG signals from which
the dynamics described by the excluded components is subtracted.
Parameters
inst : instance of Raw, Epochs or Evoked
The data to be processed. The instance is modified inplace.
include : array_like of int.
The indices referring to columns in the ummixing matrix. The
components to be kept.
exclude : array_like of int.
The indices referring to columns in the ummixing matrix. The
components to be zeroed out.
n_pca_components : int | float | None
The number of PCA components to be kept, either absolute (int)
or percentage of the explained variance (float). If None (default),
all PCA components will be used.
start : int | float | None
First sample to include. If float, data will be interpreted as
time in seconds. If None, data will be used from the first sample.
stop : int | float | None
Last sample to not include. If float, data will be interpreted as
time in seconds. If None, data will be used to the last sample.'

def apply(self, inst, include=None, exclude=None, n_pca_components=None, start=None, stop=None):

    if isinstance(inst, BaseRaw):
        out = self._apply_raw(raw=inst, include=include, exclude=exclude, n_pca_components=n_pca_components, start=start, stop=stop)
    elif isinstance(inst, BaseEpochs):
        out = self._apply_epochs(epochs=inst, include=include, exclude=exclude, n_pca_components=n_pca_components)
    elif isinstance(inst, Evoked):
        out = self._apply_evoked(evoked=inst, include=include, exclude=exclude, n_pca_components=n_pca_components)
    else:
        raise ValueError('Data    input    must    be    of    Raw,    Epochs    or    Evoked    type')
    return out
