code: def test_read_ica_eeglab_mismatch(tmp_path):
      """Test read_ica_eeglab function when there is a mismatch."""
      fname_orig = test_base_dir / "EEGLAB" / "test_raw.set"
      base = fname_orig.stem + "."
      shutil.copyfile(
          fname_orig.with_suffix(".fdt"),
          tmp_path / fname_orig.with_suffix(".fdt").name,
      )
      fname = tmp_path / base
      data = loadmat(fname_orig)
      w = data["EEG"]["icaweights"][0][0]
      w[:] = np.random.RandomState(0).randn(*w.shape)
      savemat(fname, data, appendmat=False)
      assert fname.is_file()
      with pytest.warns(
          RuntimeWarning, match="Mismatch.*removal.*icawinv.*"
      ):
          ica = read_ica_eeglab(fname)
      _assert_ica_attributes(ica)
      ica_correct = read_ica_eeglab(fname_orig)
      attrs = [
          attr
          for attr in dir(ica_correct)
          if attr.endswith("_") and not attr.startswith("_")
      ]
      assert "mixing_matrix_" in attrs
      assert "unmixing_matrix_" in attrs
      assert ica.labels_ == ica_correct.labels_ == {}
      attrs.pop(attrs.index("labels_"))
      attrs.pop(attrs.index("reject_"))
      for attr in attrs:
          a, b = getattr(ica, attr), getattr(ica_correct, attr)
          assert_allclose(a, b, rtol=1e-12, atol=1e-12, err_msg=attr)
  
imports: import os
  import shutil
  from contextlib import nullcontext
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy import linalg, stats
  from scipy.io import loadmat, savemat
  from mne import Annotations, Epochs, EpochsArray, EvokedArray, Info, create_info, make_ad_hoc_cov, pick_channels_regexp, pick_types, read_events
  from mne._fiff.pick import _DATA_CH_TYPES_SPLIT, get_channel_type_constants
  from mne.cov import read_cov
  from mne.datasets import testing
  from mne.event import make_fixed_length_events
  from mne.io import RawArray, read_raw_ctf, read_raw_eeglab, read_raw_fif
  from mne.io.eeglab.eeglab import _check_load_mat
  from mne.preprocessing import ICA
  from mne.preprocessing import ica_find_ecg_events, ica_find_eog_events, read_ica
  from mne.preprocessing.ica import _ica_explained_variance, _sort_components, corrmap, get_score_funcs, read_ica_eeglab
  from mne.rank import _compute_rank_int
  from mne.utils import _record_warnings, catch_logging, check_version
label_desc: Use image node_id 28 for calling a global function with example usage: test_read_ica_eeglab_mismatch(tmp_path) without return types