def _check_excludes_includes(chs, info=None, allow_bads=False):
    from .meas_info import Info
    if not isinstance(chs, (list, tuple, np.ndarray)):
        if allow_bads is True:
            if not isinstance(info, Info):
                raise ValueError('Supply an info object if allow_bads is true')
            elif chs != 'bads':
                raise ValueError('If chs is a string, it must be "bads"')
            else:
                chs = info['bads']
        else:
            raise ValueError(
                'include/exclude must be list, tuple, ndarray, or "bads". ' +
                'You provided type {0}'.format(type(chs)))
    return chs
Ensure that inputs to exclude/include are list-like or "bads".
dataset/ETHPy150Open mne-tools/mne-python/mne/io/pick.py/_check_excludes_includes