code: def test_mf_skips():
      """Test processing of data with skips."""
      raw = read_raw_fif(skip_fname, preload=True)
      raw.fix_mag_coil_types()
      raw.pick(raw.ch_names[:50])  # fast and inaccurate
      kwargs = dict(
          st_only=True, coord_frame="meg", int_order=4, ext_order=3
      )
      # smoke test that this runs
      maxwell_filter(
          raw, st_duration=17.0, skip_by_annotation=(), **kwargs
      )
      # and this one, too, which will process some all-zero data
      maxwell_filter(
          raw, st_duration=2.0, skip_by_annotation=(), **kwargs
      )
      with pytest.raises(ValueError, match="duration"):
          # skips decrease acceptable duration
          maxwell_filter(raw, st_duration=17.0, **kwargs)
      onsets, ends = _annotations_starts_stops(
          raw, ("edge", "bad_acq_skip"), invert=True
      )
      assert (ends - onsets).min() / raw.info["sfreq"] == 2.0
      assert (ends - onsets).max() / raw.info["sfreq"] == 3.0
      for st_duration in (2.0, 3.0):
          raw_sss = maxwell_filter(
              raw, st_duration=st_duration, **kwargs
          )
          for start, stop in zip(onsets, ends):
              orig_data = raw[:, start:stop][0]
              new_data = raw_sss[:, start:stop][0]
              if (stop - start) / raw.info["sfreq"] >= st_duration:
                  # Should be modified
                  assert not np.allclose(
                      new_data, orig_data, atol=1e-20
                  )
              else:
                  # Should not be modified
                  assert_allclose(new_data, orig_data, atol=1e-20)
      # Processing an individual file and concat should be equivalent to
      # concat then process
      raw.crop(0, 1)
      raw_sss = maxwell_filter(raw, st_duration=1.0, **kwargs)
      raw_sss_concat = concatenate_raws([raw_sss, raw_sss.copy()])
      raw_concat = concatenate_raws([raw.copy(), raw.copy()])
      raw_concat_sss = maxwell_filter(
          raw_concat, st_duration=1.0, **kwargs
      )
      raw_concat_sss_bad = maxwell_filter(
          raw_concat, st_duration=1.0, skip_by_annotation=(), **kwargs
      )
      data_c = raw_concat[:][0]
      data_sc = raw_sss_concat[:][0]
      data_cs = raw_concat_sss[:][0]
      data_csb = raw_concat_sss_bad[:][0]
      assert not np.allclose(data_cs, data_c, atol=1e-20)
      assert not np.allclose(data_cs, data_csb, atol=1e-20)
      assert_allclose(data_sc, data_cs, atol=1e-20)
  
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 25 for calling a global function with example usage: test_mf_skips() without return types