code: def test_io_egi_pns_mff_bug(preload):
      """Test importing EGI MFF with PNS data (BUG)."""
      pytest.importorskip("defusedxml")
      egi_fname_mff = testing_path / "EGI" / "test_egi_pns_bug.mff"
      with pytest.warns(RuntimeWarning, match="EGI PSG sample bug"):
          raw = read_raw_egi(
              egi_fname_mff,
              include=None,
              preload=preload,
              verbose="warning",
          )
      assert len(raw.annotations) == 1
      assert_allclose(raw.annotations.duration, [0.004])
      assert_allclose(raw.annotations.onset, [13.948])
      egi_fname_mat = testing_path / "EGI" / "test_egi_pns.mat"
      mc = sio.loadmat(egi_fname_mat)
      pns_chans = pick_types(raw.info, ecg=True, bio=True, emg=True)
      pns_names = [
          "Resp. Temperature"[:15],
          "Resp. Pressure",
          "ECG",
          "Body Position",
          "Resp. Effort Chest"[:15],
          "Resp. Effort Abdomen"[:15],
          "EMG-Leg",
      ]
      mat_names = [
          "Resp_Temperature"[:15],
          "Resp_Pressure",
          "ECG",
          "Body_Position",
          "Resp_Effort_Chest"[:15],
          "Resp_Effort_Abdomen"[:15],
          "EMGLeg",
      ]
      for ch_name, ch_idx, mat_name in zip(
          pns_names, pns_chans, mat_names
      ):
          print(f"Testing {ch_name}")
          mc_key = [x for x in mc.keys() if mat_name in x][0]
          cal = raw.info["chs"][ch_idx]["cal"]
          mat_data = mc[mc_key] * cal
          mat_data[
              :, -1
          ] = 0  # The MFF has one less sample, the last one
          raw_data = raw[ch_idx][0]
          assert_array_equal(mat_data, raw_data)
  
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 6 for calling a global function with example usage: test_io_egi_pns_mff_bug(preload) without return types