code: def test_acqparser():
      """Test AcqParserFIF."""
      # no acquisition parameters
      pytest.raises(ValueError, AcqParserFIF, {"acq_pars": ""})
      # invalid acquisition parameters
      pytest.raises(ValueError, AcqParserFIF, {"acq_pars": "baaa"})
      pytest.raises(
          ValueError, AcqParserFIF, {"acq_pars": "ERFVersion\n1"}
      )
      # test oldish file
      raw = read_raw_fif(raw_fname, preload=False)
      acqp = AcqParserFIF(raw.info)
      # test __repr__()
      assert repr(acqp)
      # old file should trigger compat mode
      assert acqp.compat
      # count events and categories
      assert_equal(len(acqp.categories), 6)
      assert_equal(len(acqp._categories), 17)
      assert_equal(len(acqp.events), 6)
      assert_equal(len(acqp._events), 17)
      # get category
      assert acqp["Surprise visual"]
      # test TRIUX file
      raw = read_raw_fif(fname_raw_elekta, preload=False)
      acqp = raw.acqparser
      assert acqp is raw.acqparser  # same one, not regenerated
      # test __repr__()
      assert repr(acqp)
      # this file should not be in compatibility mode
      assert not acqp.compat
      # nonexistent category
      pytest.raises(KeyError, acqp.__getitem__, "does not exist")
      pytest.raises(KeyError, acqp.get_condition, raw, "foo")
      # category not a string
      pytest.raises(TypeError, acqp.__getitem__, 0)
      # number of events / categories
      assert_equal(len(acqp), 7)
      assert_equal(len(acqp.categories), 7)
      assert_equal(len(acqp._categories), 32)
      assert_equal(len(acqp.events), 6)
      assert_equal(len(acqp._events), 32)
      # get category
      assert acqp["Test event 5"]
  
imports: import os
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import Annotations, Epochs, compute_raw_covariance, count_events, create_info, find_events, find_stim_steps, make_fixed_length_events, pick_channels, pick_events, read_events, read_evokeds, write_events
  from mne.datasets import testing
  from mne.event import AcqParserFIF, define_target_events, match_event_names, merge_events, shift_time_events
  from mne.io import RawArray, read_raw_fif
label_desc: Use image node_id 10 for calling a global function with example usage: test_acqparser() without return types