code: def test_degenerate(tmp_path):
      """Test some degenerate conditions."""
      # test if .dat file raises an error
      eeg = io.loadmat(
          epochs_fname_mat, struct_as_record=False, squeeze_me=True
      )["EEG"]
      eeg.data = "epochs_fname.dat"
      bad_epochs_fname = tmp_path / "test_epochs.set"
      io.savemat(
          bad_epochs_fname,
          {
              "EEG": {
                  "trials": eeg.trials,
                  "srate": eeg.srate,
                  "nbchan": eeg.nbchan,
                  "data": eeg.data,
                  "epoch": eeg.epoch,
                  "event": eeg.event,
                  "chanlocs": eeg.chanlocs,
                  "pnts": eeg.pnts,
              }
          },
          appendmat=False,
          oned_as="row",
      )
      shutil.copyfile(
          base_dir / "test_epochs.fdt", tmp_path / "test_epochs.dat"
      )
      pytest.raises(
          NotImplementedError, read_epochs_eeglab, bad_epochs_fname
      )
  
      # error when montage units incorrect
      with pytest.raises(ValueError, match=r"Invalid value"):
          read_epochs_eeglab(epochs_fname_mat, montage_units="mV")
  
      # warning when head radius too large
      with pytest.warns(RuntimeWarning, match="is above"):
          read_raw_eeglab(raw_fname_chanloc, montage_units="m")
  
      # warning when head radius too small
      m_fname = tmp_path / "test_montage_m.set"
      _create_eeg_with_scaled_montage_units(
          raw_fname_chanloc, m_fname, 1e-3
      )
      with pytest.warns(RuntimeWarning, match="is below"):
          read_raw_eeglab(m_fname, montage_units="mm")
  
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 5 for calling a global function with example usage: test_degenerate(tmp_path) without return types