code: def test_estimate_montage_units(tmp_path):
      """Test automatic estimation of montage units."""
      m_fname = tmp_path / "test_montage_m.set"
      _create_eeg_with_scaled_montage_units(
          raw_fname_chanloc, m_fname, 1e-3
      )
      cm_fname = tmp_path / "test_montage_cm.set"
      _create_eeg_with_scaled_montage_units(
          raw_fname_chanloc, cm_fname, 1e-1
      )
      with pytest.warns(
          RuntimeWarning, match="The data contains 'boundary' events"
      ):
          # read 3 versions of the same file, with different montage units
          raw_mm = read_raw_eeglab(
              raw_fname_chanloc, montage_units="auto"
          )
          raw_m = read_raw_eeglab(m_fname, montage_units="auto")
          raw_cm = read_raw_eeglab(cm_fname, montage_units="auto")
      # All locations should be the same if the units are correctly estimated
      assert_allclose(
          np.array([ch["loc"] for ch in raw_mm.info["chs"]]),
          np.array([ch["loc"] for ch in raw_m.info["chs"]]),
      )
      assert_allclose(
          np.array([ch["loc"] for ch in raw_mm.info["chs"]]),
          np.array([ch["loc"] for ch in raw_cm.info["chs"]]),
      )
  
imports: import os
  import shutil
  from copy import deepcopy
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy import io
  import mne
  from mne import read_epochs_eeglab, write_events
  from mne.annotations import events_from_annotations, read_annotations
  from mne.channels import read_custom_montage
  from mne.datasets import testing
  from mne.io import read_raw_eeglab
  from mne.io.eeglab._eeglab import _readmat
  from mne.io.eeglab.eeglab import _dol_to_lod, _get_montage_information
  from mne.io.tests.test_raw import _test_raw_reader
  from mne.utils import Bunch, _check_pymatreader_installed
label_desc: Use image node_id 13 for calling a global function with example usage: test_estimate_montage_units(tmp_path) without return types