code: def test_io_egi_mff():
      """Test importing EGI MFF simple binary files."""
      pytest.importorskip("defusedxml")
      # want vars for n chans
      n_ref = 1
      n_eeg = 128
      n_card = 3
  
      raw = read_raw_egi(egi_mff_fname, include=None)
      assert "RawMff" in repr(raw)
      assert raw.orig_format == "single"
      include = ["DIN1", "DIN2", "DIN3", "DIN4", "DIN5", "DIN7"]
      raw = _test_raw_reader(
          read_raw_egi,
          input_fname=egi_mff_fname,
          include=include,
          channel_naming="EEG %03d",
          test_scaling=False,  # XXX probably some bug
      )
      assert raw.info["sfreq"] == 1000.0
      assert len(raw.info["dig"]) == n_card + n_eeg + n_ref
      assert raw.info["dig"][0]["ident"] == FIFF.FIFFV_POINT_LPA
      assert raw.info["dig"][0]["kind"] == FIFF.FIFFV_POINT_CARDINAL
      assert raw.info["dig"][3]["kind"] == FIFF.FIFFV_POINT_EEG
      assert raw.info["dig"][-1]["ident"] == 129
      # This is not a custom reference, it's consistent across all channels
      assert (
          raw.info["custom_ref_applied"]
          == FIFF.FIFFV_MNE_CUSTOM_REF_OFF
      )
      ref_loc = raw.info["dig"][-1]["r"]
      eeg_picks = pick_types(raw.info, eeg=True)
      assert len(eeg_picks) == n_eeg + n_ref  # 129
      # ref channel should store its own loc as ref location, so't test it
      for i in eeg_picks:
          loc = raw.info["chs"][i]["loc"]
          assert loc[:3].any(), loc[:3]
          assert_array_equal(loc[3:6], ref_loc, err_msg=f"{i}")
      assert raw.info["device_info"]["type"] == "HydroCel GSN 128 1.0"
  
      assert "eeg" in raw
      # test our custom channel naming logic functionality
      eeg_chan = [c for c in raw.ch_names if "EEG" in c]
      assert (
          len(eeg_chan) == n_eeg
      )  # 128: VREF will not match in comprehension
      assert "STI 014" in raw.ch_names
  
      events = find_events(raw, stim_channel="STI 014")
      assert len(events) == 8
      assert np.unique(events[:, 1])[0] == 0
      assert np.unique(events[:, 0])[0] != 0
      assert np.unique(events[:, 2])[0] != 0
  
      with pytest.raises(ValueError, match="Could not find event"):
          read_raw_egi(egi_mff_fname, include=["Foo"])
      with pytest.raises(ValueError, match="Could not find event"):
          read_raw_egi(egi_mff_fname, exclude=["Bar"])
      for ch in include:
          assert ch in raw.event_id
          assert raw.event_id[ch] == int(ch[-1])
  
imports: import os
  import shutil
  from copy import deepcopy
  from datetime import datetime, timezone
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from scipy import io
  from mne import find_events, pick_types
  from mne._fiff.constants import FIFF
  from mne.datasets.testing import data_path, requires_testing_data
  from mne.io import read_evokeds_mff, read_raw_egi, read_raw_fif
  from mne.io.egi.egi import _combine_triggers
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.utils import object_diff
label_desc: Use image node_id 3 for calling a global function with example usage: test_io_egi_mff() without return types