def _check_set(ch, projs, ch_type):
    """Helper to make sure type change is compatible with projectors"""
    new_kind = _human2fiff[ch_type]
    if ch['kind'] != new_kind:
        for proj in projs:
            if ch['ch_name'] in proj['data']['col_names']:
                raise RuntimeError('Cannot change channel type for channel %s '
                                   'in projector "%s"'
                                   % (ch['ch_name'], proj['desc']))
    ch['kind'] = new_kind
dataset/ETHPy150Open mne-tools/mne-python/mne/channels/channels.py/_check_set/original