code: def test_set_standard_montage_mff(fname, standard_montage):
      """Test setting a standard montage."""
      pytest.importorskip("defusedxml")
      raw = read_raw_egi(fname, verbose="warning")
      n_eeg = int(standard_montage.split("-")[-1])
      n_dig = n_eeg + 3
      dig_before_mon = deepcopy(raw.info["dig"])
      assert len(dig_before_mon) == n_dig
      ref_loc = dig_before_mon[-1]["r"]
      picks = pick_types(raw.info, eeg=True)
      assert len(picks) == n_eeg
      for pick in picks:
          assert_allclose(raw.info["chs"][pick]["loc"][3:6], ref_loc)
  
      raw.set_montage(
          standard_montage, match_alias=True, on_missing="ignore"
      )
      dig_after_mon = raw.info["dig"]
  
      # No dig entries should have been dropped while setting montage
      assert len(dig_before_mon) == n_dig
      assert len(dig_after_mon) == n_dig
  
      # Check that the reference remained
      for pick in picks:
          assert_allclose(raw.info["chs"][pick]["loc"][3:6], ref_loc)
  
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 12 for calling a global function with example usage: test_set_standard_montage_mff(fname, standard_montage) without return types