def _apply_extractor(extractor, X):
    """ Utility function to apply features extractor to ndarray X.

    Parameters
    ----------
    extractor : Instance of sklearn.pipeline.FeatureUnion or sklearn.pipeline

    X : ndarray, shape (n_channels, n_times)

    Returns
    -------
    ndarray, shape (n_features,)
    """
    return extractor.fit_transform(X)