def _check_epochs_input(epochs, y, picks=None):
    if y is None:
        y = epochs.events[:, 2]
    elif isinstance(y, list):
        y = np.array(y)

    # Convert MNE data into trials x features x time matrix
    X = epochs.get_data()

    # Pick channels
    if picks is None:  # just use good data channels
        picks = _pick_data_channels(epochs.info, with_ref_meg=False)
    if isinstance(picks, (list, np.ndarray)):
        picks = np.array(picks, dtype=np.int)
    else:
        raise ValueError('picks must be a list or a numpy.ndarray of int')
    X = X[:, picks, :]

    # Check data sets
    assert X.shape[0] == y.shape[0]
    return X, y, picks
Aux function of GeneralizationAcrossTime
dataset/ETHPy150Open mne-tools/mne-python/mne/decoding/time_gen.py/_check_epochs_input