code: def test_data(tmp_path):
      """Test reading raw kit files."""
      pytest.raises(TypeError, read_raw_kit, epochs_path)
      pytest.raises(TypeError, read_epochs_kit, sqd_path)
      pytest.raises(
          ValueError, read_raw_kit, sqd_path, mrk_path, elp_txt_path
      )
      pytest.raises(
          ValueError,
          read_raw_kit,
          sqd_path,
          None,
          None,
          None,
          list(range(200, 190, -1)),
      )
      pytest.raises(
          ValueError,
          read_raw_kit,
          sqd_path,
          None,
          None,
          None,
          list(range(167, 159, -1)),
          "*",
          1,
          True,
      )
      # check functionality
      raw_mrk = read_raw_kit(
          sqd_path, [mrk2_path, mrk3_path], elp_txt_path, hsp_txt_path
      )
      assert (
          raw_mrk.info["description"]
          == "NYU 160ch System since Jan24 2009 (34) V2R004 EQ1160C"  # noqa: E501
      )
      raw_py = _test_raw_reader(
          read_raw_kit,
          input_fname=sqd_path,
          mrk=mrk_path,
          elp=elp_txt_path,
          hsp=hsp_txt_path,
          stim=list(range(167, 159, -1)),
          slope="+",
          stimthresh=1,
      )
      assert "RawKIT" in repr(raw_py)
      assert_equal(raw_mrk.info["kit_system_id"], KIT.SYSTEM_NYU_2010)
  
      # check number/kind of channels
      assert_equal(len(raw_py.info["chs"]), 193)
      kit_channels = (
          (
              "kind",
              {
                  FIFF.FIFFV_MEG_CH: 157,
                  FIFF.FIFFV_REF_MEG_CH: 3,
                  FIFF.FIFFV_MISC_CH: 32,
                  FIFF.FIFFV_STIM_CH: 1,
              },
          ),
          (
              "coil_type",
              {
                  FIFF.FIFFV_COIL_KIT_GRAD: 157,
                  FIFF.FIFFV_COIL_KIT_REF_MAG: 3,
                  FIFF.FIFFV_COIL_NONE: 33,
              },
          ),
      )
      for label, target in kit_channels:
          actual = {
              id_: sum(ch[label] == id_ for ch in raw_py.info["chs"])
              for id_ in target.keys()
          }
          assert_equal(actual, target)
  
      # Test stim channel
      raw_stim = read_raw_kit(
          sqd_path,
          mrk_path,
          elp_txt_path,
          hsp_txt_path,
          stim="<",
          preload=False,
      )
      for raw in [raw_py, raw_stim, raw_mrk]:
          stim_pick = pick_types(
              raw.info,
              meg=False,
              ref_meg=False,
              stim=True,
              exclude="bads",
          )
          stim1, _ = raw[stim_pick]
          stim2 = np.array(raw.read_stim_ch(), ndmin=2)
          assert_array_equal(stim1, stim2)
  
      # Binary file only stores the sensor channels
      py_picks = pick_types(raw_py.info, meg=True, exclude="bads")
      raw_bin = data_dir / "test_bin_raw.fif"
      raw_bin = read_raw_fif(raw_bin, preload=True)
      bin_picks = pick_types(
          raw_bin.info, meg=True, stim=True, exclude="bads"
      )
      data_bin, _ = raw_bin[bin_picks]
      data_py, _ = raw_py[py_picks]
  
      # this .mat was generated using the Yokogawa MEG Reader
      data_Ykgw = data_dir / "test_Ykgw.mat"
      data_Ykgw = scipy.io.loadmat(data_Ykgw)["data"]
      data_Ykgw = data_Ykgw[py_picks]
  
      assert_array_almost_equal(data_py, data_Ykgw)
  
      py_picks = pick_types(
          raw_py.info,
          meg=True,
          stim=True,
          ref_meg=False,
          exclude="bads",
      )
      data_py, _ = raw_py[py_picks]
      assert_array_almost_equal(data_py, data_bin)
  
      # KIT-UMD data
      _test_raw_reader(
          read_raw_kit, input_fname=sqd_umd_path, test_rank="less"
      )
      raw = read_raw_kit(sqd_umd_path)
      assert (
          raw.info["description"]
          == "University of Maryland/Kanazawa Institute of Technology/160-channel MEG System (53) V2R004 PQ1160R"  # noqa: E501
      )
      assert_equal(raw.info["kit_system_id"], KIT.SYSTEM_UMD_2014_12)
      # check number/kind of channels
      assert_equal(len(raw.info["chs"]), 193)
      for label, target in kit_channels:
          actual = {
              id_: sum(ch[label] == id_ for ch in raw.info["chs"])
              for id_ in target.keys()
          }
          assert_equal(actual, target)
  
      # KIT Academia Sinica
      raw = read_raw_kit(sqd_as_path, slope="+")
      assert (
          raw.info["description"]
          == "Academia Sinica/Institute of Linguistics//Magnetoencephalograph System (261) V2R004 PQ1160R-N2"  # noqa: E501
      )
      assert_equal(raw.info["kit_system_id"], KIT.SYSTEM_AS_2008)
      assert_equal(raw.info["chs"][100]["ch_name"], "MEG 101")
      assert_equal(raw.info["chs"][100]["kind"], FIFF.FIFFV_MEG_CH)
      assert_equal(
          raw.info["chs"][100]["coil_type"], FIFF.FIFFV_COIL_KIT_GRAD
      )
      assert_equal(raw.info["chs"][157]["ch_name"], "MEG 158")
      assert_equal(raw.info["chs"][157]["kind"], FIFF.FIFFV_REF_MEG_CH)
      assert_equal(
          raw.info["chs"][157]["coil_type"], FIFF.FIFFV_COIL_KIT_REF_MAG
      )
      assert_equal(raw.info["chs"][160]["ch_name"], "EEG 001")
      assert_equal(raw.info["chs"][160]["kind"], FIFF.FIFFV_EEG_CH)
      assert_equal(
          raw.info["chs"][160]["coil_type"], FIFF.FIFFV_COIL_EEG
      )
      assert_array_equal(find_events(raw), [[91, 0, 2]])
  
imports: from pathlib import Path
  import numpy
  import pytest
  import scipy.io
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy import linalg
  import mne
  from mne import Epochs, find_events, pick_types, read_events
  from mne._fiff.constants import FIFF
  from mne.datasets.testing import requires_testing_data
  from mne.io import read_epochs_kit, read_raw_fif, read_raw_kit
  from mne.io.kit.constants import KIT
  from mne.io.kit.coreg import read_sns
  from mne.io.kit.kit import get_kit_info
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.surface import _get_ico_surface
  from mne.transforms import apply_trans
  from mne.utils import assert_dig_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: test_data(tmp_path) without return types