code: def test_regularization():
      """Test Maxwell filter regularization."""
      # Load testing data (raw, SSS std origin, SSS non-standard origin)
      min_tols = (20.0, 2.6, 1.0)
      med_tols = (200.0, 21.0, 3.7)
      origins = ((0.0, 0.0, 0.04), (0.0,) * 3, (0.0, 0.02, 0.02))
      coord_frames = ("head", "meg", "head")
      raw_fnames = (raw_fname, erm_fname, sample_fname)
      sss_fnames = (
          sss_reg_in_fname,
          sss_erm_reg_in_fname,
          sss_samp_reg_in_fname,
      )
      comp_tols = [0, 1, 4]
      for ii, rf in enumerate(raw_fnames):
          raw = read_crop(rf, (0.0, 1.0))
          sss_reg_in = read_crop(sss_fnames[ii])
  
          # Test "in" regularization
          raw_sss = maxwell_filter(
              raw, coord_frame=coord_frames[ii], origin=origins[ii]
          )
          assert_meg_snr(
              raw_sss, sss_reg_in, min_tols[ii], med_tols[ii], msg=rf
          )
  
          # check components match
          _check_reg_match(raw_sss, sss_reg_in, comp_tols[ii])
  
imports: import pathlib
  import re
  from contextlib import contextmanager
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from scipy import sparse
  from scipy.special import sph_harm
  import mne
  from mne import compute_raw_covariance, concatenate_raws, pick_info, pick_types
  from mne._fiff.constants import FIFF
  from mne.annotations import _annotations_starts_stops
  from mne.chpi import filter_chpi, read_head_pos
  from mne.datasets import testing
  from mne.forward import _prep_meg_channels, use_coil_def
  from mne.io import BaseRaw, read_info, read_raw_bti, read_raw_ctf, read_raw_fif, read_raw_kit
  from mne.preprocessing import annotate_amplitude, annotate_movement, compute_maxwell_basis, find_bad_channels_maxwell, maxwell_filter, maxwell_filter_prepare_emptyroom
  from mne.preprocessing.maxwell import _bases_complex_to_real, _bases_real_to_complex, _get_n_moments, _prep_mf_coils, _sh_complex_to_real, _sh_negate, _sh_real_to_complex, _sss_basis_basic, _trans_sss_basis
  from mne.rank import _compute_rank_int, _get_rank_sss, compute_rank
  from mne.utils import _record_warnings, assert_meg_snr, buggy_mkl_svd, catch_logging, object_diff, use_log_level
label_desc: Use image node_id 14 for calling a global function with example usage: test_regularization() without return types