class_docstr: Parser for Elekta data acquisition settings.
  
  This class parses parameters (e.g. events and averaging categories) that
  are defined in the Elekta TRIUX/VectorView data acquisition software (DACQ)
  and stored in ``info['acq_pars']``. It can be used to reaverage raw data
  according to DACQ settings and modify original averaging settings if
  necessary.
  
  Parameters
  ----------
  %(info_not_none)s This is where the DACQ parameters will be taken from.
  
  Attributes
  ----------
  categories : list
      List of averaging categories marked active in DACQ.
  events : list
      List of events that are in use (referenced by some averaging category).
  reject : dict
      Rejection criteria from DACQ that can be used with mne.Epochs.
      Note that mne does not support all DACQ rejection criteria
      (e.g. spike, slope).
  flat : dict
      Flatness rejection criteria from DACQ that can be used with mne.Epochs.
  acq_dict : dict
      All DACQ parameters.
  
  See Also
  --------
  mne.io.Raw.acqparser : Access the parser through a Raw attribute.
  
  Notes
  -----
  Any averaging category (also non-active ones) can be accessed by indexing
  as ``acqparserfif['category_name']``.
docstr: Get averaging parameters for a condition (averaging category).
  
  Output is designed to be used with the Epochs class to extract the
  corresponding epochs.
  
  Parameters
  ----------
  raw : Raw object
      An instance of Raw.
  condition : None | str | dict | list of dict
      Condition or a list of conditions. Conditions can be strings
      (DACQ comment field, e.g. 'Auditory left') or category dicts
      (e.g. acqp['Auditory left'], where acqp is an instance of
      AcqParserFIF). If None, get all conditions marked active in
      DACQ.
  stim_channel : None | str | list of str
      Name of the stim channel or all the stim channels
      affected by the trigger. If None, the config variables
      'MNE_STIM_CHANNEL', 'MNE_STIM_CHANNEL_1', 'MNE_STIM_CHANNEL_2',
      etc. are read. If these are not found, it will fall back to
      'STI101' or 'STI 014' if present, then fall back to the first
      channel of type 'stim', if present.
  mask : int | None
      The value of the digital mask to apply to the stim channel values.
      If None (default), no masking is performed.
  uint_cast : bool
      If True (default False), do a cast to ``uint16`` on the channel
      data. This can be used to fix a bug with STI101 and STI014 in
      Neuromag acquisition setups that use channel STI016 (channel 16
      turns data into e.g. -32768), similar to ``mne_fix_stim14 --32``
      in MNE-C.
  mask_type : 'and' | 'not_and'
      The type of operation between the mask and the trigger.
      Choose 'and' for MNE-C masking behavior.
  delayed_lookup : bool
      If True, use the 'delayed lookup' procedure implemented in Elekta
      software. When a trigger transition occurs, the lookup of
      the new trigger value will not happen immediately at the following
      sample, but with a 1-sample delay. This allows a slight
      asynchrony between trigger onsets, when they are intended to be
      synchronous. If you have accurate hardware and want to detect
      transitions with a resolution of one sample, use
      delayed_lookup=False.
  
  Returns
  -------
  conds_data : dict or list of dict
      Each dict has the following keys:
  
      events : array, shape (n_epochs_out, 3)
          List of zero time points (t0) for the epochs matching the
          condition. Use as the ``events`` parameter to Epochs. Note
          that these are not (necessarily) actual events.
      event_id : dict
          Name of condition and index compatible with ``events``.
          Should be passed as the ``event_id`` parameter to Epochs.
      tmin : float
          Epoch starting time relative to t0. Use as the ``tmin``
          parameter to Epochs.
      tmax : float
          Epoch ending time relative to t0. Use as the ``tmax``
          parameter to Epochs.
docstr_tok: ["Get","averaging","parameters","for","a","condition","(","averaging","category",")",".","Output","is","designed","to","be","used","with","the","Epochs","class","to","extract","the","corresponding","epochs",".","Parameters","--","--","--","--","--","raw",":","Raw","object","An","instance","of","Raw",".","condition",":","None","|","str","|","dict","|","list","of","dict","Condition","or","a","list","of","conditions",".","Conditions","can","be","strings","(","DACQ","comment","field",",","e.g",".","'Auditory","left","'",")","or","category","dicts","(","e.g",".","acqp","[","'Auditory","left","'","]",",","where","acqp","is","an","instance","of","AcqParserFIF",")",".","If","None",",","get","all","conditions","marked","active","in","DACQ",".","stim_channel",":","None","|","str","|","list","of","str","Name","of","the","stim","channel","or","all","the","stim","channels","affected","by","the","trigger",".","If","None",",","the","config","variables","'MNE_STIM_CHANNEL","'",",","'MNE_STIM_CHANNEL_1","'",",","'MNE_STIM_CHANNEL_2","'",",","etc",".","are","read",".","If","these","are","not","found",",","it","will","fall","back","to","'STI101","'","or","'STI","014","'","if","present",",","then","fall","back","to","the","first","channel","of","type","'stim","'",",","if","present",".","mask",":","int","|","None","The","value","of","the","digital","mask","to","apply","to","the","stim","channel","values",".","If","None","(","default",")",",","no","masking","is","performed",".","uint_cast",":","bool","If","True","(","default","False",")",",","do","a","cast","to","``","uint16","``","on","the","channel","data",".","This","can","be","used","to","fix","a","bug","with","STI101","and","STI014","in","Neuromag","acquisition","setups","that","use","channel","STI016","(","channel","16","turns","data","into","e.g",".","-32768",")",",","similar","to","``","mne_fix_stim14","--","32","``","in","MNE-C.","mask_type",":","'and","'","|","'not_and'","The","type","of","operation","between","the","mask","and","the","trigger",".","Choose","'and","'","for","MNE-C","masking","behavior",".","delayed_lookup",":","bool","If","True",",","use","the","'delayed","lookup","'","procedure","implemented","in","Elekta","software",".","When","a","trigger","transition","occurs",",","the","lookup","of","the","new","trigger","value","will","not","happen","immediately","at","the","following","sample",",","but","with","a","1-sample","delay",".","This","allows","a","slight","asynchrony","between","trigger","onsets",",","when","they","are","intended","to","be","synchronous",".","If","you","have","accurate","hardware","and","want","to","detect","transitions","with","a","resolution","of","one","sample",",","use","delayed_lookup=False",".","Returns","--","--","--","-","conds_data",":","dict","or","list","of","dict","Each","dict","has","the","following","keys",":","events",":","array",",","shape","(","n_epochs_out",",","3",")","List","of","zero","time","points","(","t0",")","for","the","epochs","matching","the","condition",".","Use","as","the","``","events","``","parameter","to","Epochs",".","Note","that","these","are","not","(","necessarily",")","actual","events",".","event_id",":","dict","Name","of","condition","and","index","compatible","with","``","events","``",".","Should","be","passed","as","the","``","event_id","``","parameter","to","Epochs",".","tmin",":","float","Epoch","starting","time","relative","to","t0",".","Use","as","the","``","tmin","``","parameter","to","Epochs",".","tmax",":","float","Epoch","ending","time","relative","to","t0",".","Use","as","the","``","tmax","``","parameter","to","Epochs","."]
code: def get_condition(
      self,
      raw,
      condition=None,
      stim_channel=None,
      mask=None,
      uint_cast=None,
      mask_type="and",
      delayed_lookup=True,
  ):
      """Get averaging parameters for a condition (averaging category).
  
      Output is designed to be used with the Epochs class to extract the
      corresponding epochs.
  
      Parameters
      ----------
      raw : Raw object
          An instance of Raw.
      condition : None | str | dict | list of dict
          Condition or a list of conditions. Conditions can be strings
          (DACQ comment field, e.g. 'Auditory left') or category dicts
          (e.g. acqp['Auditory left'], where acqp is an instance of
          AcqParserFIF). If None, get all conditions marked active in
          DACQ.
      stim_channel : None | str | list of str
          Name of the stim channel or all the stim channels
          affected by the trigger. If None, the config variables
          'MNE_STIM_CHANNEL', 'MNE_STIM_CHANNEL_1', 'MNE_STIM_CHANNEL_2',
          etc. are read. If these are not found, it will fall back to
          'STI101' or 'STI 014' if present, then fall back to the first
          channel of type 'stim', if present.
      mask : int | None
          The value of the digital mask to apply to the stim channel values.
          If None (default), no masking is performed.
      uint_cast : bool
          If True (default False), do a cast to ``uint16`` on the channel
          data. This can be used to fix a bug with STI101 and STI014 in
          Neuromag acquisition setups that use channel STI016 (channel 16
          turns data into e.g. -32768), similar to ``mne_fix_stim14 --32``
          in MNE-C.
      mask_type : 'and' | 'not_and'
          The type of operation between the mask and the trigger.
          Choose 'and' for MNE-C masking behavior.
      delayed_lookup : bool
          If True, use the 'delayed lookup' procedure implemented in Elekta
          software. When a trigger transition occurs, the lookup of
          the new trigger value will not happen immediately at the following
          sample, but with a 1-sample delay. This allows a slight
          asynchrony between trigger onsets, when they are intended to be
          synchronous. If you have accurate hardware and want to detect
          transitions with a resolution of one sample, use
          delayed_lookup=False.
  
      Returns
      -------
      conds_data : dict or list of dict
          Each dict has the following keys:
  
          events : array, shape (n_epochs_out, 3)
              List of zero time points (t0) for the epochs matching the
              condition. Use as the ``events`` parameter to Epochs. Note
              that these are not (necessarily) actual events.
          event_id : dict
              Name of condition and index compatible with ``events``.
              Should be passed as the ``event_id`` parameter to Epochs.
          tmin : float
              Epoch starting time relative to t0. Use as the ``tmin``
              parameter to Epochs.
          tmax : float
              Epoch ending time relative to t0. Use as the ``tmax``
              parameter to Epochs.
      """
      if condition is None:
          condition = self.categories  # get all
      if not isinstance(condition, list):
          condition = [condition]  # single cond -> listify
      conds_data = list()
      for cat in condition:
          if isinstance(cat, str):
              cat = self[cat]
          mne_events = find_events(
              raw,
              stim_channel=stim_channel,
              mask=mask,
              mask_type=mask_type,
              output="step",
              uint_cast=uint_cast,
              consecutive=True,
              verbose=False,
              shortest_event=1,
          )
          if delayed_lookup:
              ind = np.where(np.diff(mne_events[:, 0]) == 1)[0]
              if 1 in np.diff(ind):
                  raise ValueError(
                      "There are several subsequent "
                      "transitions on the trigger channel. "
                      "This will not work well with "
                      "delayed_lookup=True. You may want to "
                      "check your trigger data and "
                      "set delayed_lookup=False."
                  )
              mne_events[ind, 2] = mne_events[ind + 1, 2]
              mne_events = np.delete(mne_events, ind + 1, axis=0)
          sfreq = raw.info["sfreq"]
          cat_t0_ = self._mne_events_to_category_t0(
              cat, mne_events, sfreq
          )
          # make it compatible with the usual events array
          cat_t0 = np.c_[
              cat_t0_,
              np.zeros(cat_t0_.shape),
              cat["index"] * np.ones(cat_t0_.shape),
          ].astype(np.uint32)
          cat_id = {cat["comment"]: cat["index"]}
          tmin, tmax = cat["start"], cat["end"]
          conds_data.append(
              dict(events=cat_t0, event_id=cat_id, tmin=tmin, tmax=tmax)
          )
      return conds_data[0] if len(conds_data) == 1 else conds_data
  
imports: from collections.abc import Sequence
  from pathlib import Path
  import numpy
  from ._fiff.constants import FIFF
  from ._fiff.open import fiff_open
  from ._fiff.pick import pick_channels
  from ._fiff.tag import read_tag
  from ._fiff.tree import dir_tree_find
  from ._fiff.write import end_block, start_and_end_file, start_block, write_int
  from .utils import _check_fname, _check_integer_or_list, _check_on_missing, _check_option, _get_stim_channel, _on_missing, _pl, _validate_type, check_fname, fill_doc, logger, verbose, warn
label_desc: Use image node_id 14 for calling the AcqParserFIF obj's underlying member method code with example usage: obj.get_condition(raw, condition, stim_channel, mask, uint_cast, mask_type, delayed_lookup) and returns: unknown