'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.'

def _set_stimchannels(self, info, stim, stim_code):

    if (stim_code not in ('binary', 'channel')):
        raise ValueError(("stim_code=%r,    needs    to    be    'binary'    or    'channel'" % stim_code))
    if (stim is not None):
        if isinstance(stim, str):
            picks = _default_stim_chs(info)
            if (stim == '<'):
                stim = picks[::(-1)]
            elif (stim == '>'):
                stim = picks
            else:
                raise ValueError(("stim    needs    to    be    list    of    int,    '>'    or    '<',    not    %r" % str(stim)))
        else:
            stim = np.asarray(stim, int)
            if (stim.max() >= self._raw_extras[0]['nchan']):
                raise ValueError(('Got    stim=%s,    but    sqd    file    only    has    %i    channels' % (stim, self._raw_extras[0]['nchan'])))
        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
