def _set_stimchannels(self, info, stim, stim_code):
        """Specify how the trigger channel is synthesized from analog channels.

        Has to be done before loading data. For a RawKIT instance that has been
        created with preload=True, this method will raise a
        NotImplementedError.

        Parameters
        ----------
        info : instance of MeasInfo
            The measurement info.
        stim : list of int | '<' | '>'
            Can be submitted as list of trigger channels.
            If a list is not specified, the default triggers extracted from
            misc channels will be used with specified directionality.
            '<' means that largest values assigned to the first channel
            in sequence.
            '>' means the largest trigger assigned to the last channel
            in sequence.
        stim_code : 'binary' | 'channel'
            How to decode trigger values from stim channels. 'binary' read stim
            channel events as binary code, 'channel' encodes channel number.
        """
        if ('binary', 'channel') not in stim_code:
            raise ValueError("stim_code=%r, needs to be 'binary' or 'channel'"
                             % stim_code)

        if stim is not None:
            if isinstance(stim, str):
                picks = pick_types(info, meg=False, ref_meg=False,
                                   misc=True, exclude=[])[:8]
                if stim == '<':
                    stim = picks[::-1]
                elif stim == '>':
                    stim = picks
                else:
                    raise ValueError("stim needs to be list of int, '>' or "
                                     "'<', not %r" % str(stim))
            elif np.max(stim) >= self._raw_extras[0]['nchan']:
                raise ValueError('Tried to set stim channel %i, but sqd file '
                                 'only has %i channels'
                                 % (np.max(stim),
                                    self._raw_extras[0]['nchan']))
            # modify info
            nchan = self._raw_extras[0]['nchan'] + 1
            ch_name = 'STI 014'
            chan_info = {}
            chan_info['cal'] = KIT.CALIB_FACTOR
            chan_info['logno'] = nchan
            chan_info['scanno'] = nchan
            chan_info['range'] = 1.0
            chan_info['unit'] = FIFF.FIFF_UNIT_NONE
            chan_info['unit_mul'] = 0
            chan_info['ch_name'] = ch_name
            chan_info['coil_type'] = FIFF.FIFFV_COIL_NONE
            chan_info['loc'] = np.zeros(12)
            chan_info['kind'] = FIFF.FIFFV_STIM_CH
            info['chs'].append(chan_info)
            info._update_redundant()
        if self.preload:
            err = "Can't change stim channel after preloading data"
            raise NotImplementedError(err)

        self._raw_extras[0]['stim'] = stim
        self._raw_extras[0]['stim_code'] = stim_code
dataset/ETHPy150Open mne-tools/mne-python/mne/io/kit/kit.py/RawKIT._set_stimchannels/swapped operands of `not in`