code: def test_spatiotemporal_only():
      """Test tSSS-only processing."""
      # Load raw testing data
      tmax = 0.5
      raw = read_crop(raw_fname, (0, tmax)).load_data()
      picks = pick_types(raw.info, meg=True, exclude="bads")[::2]
      raw.pick([raw.ch_names[pick] for pick in picks])
      mag_picks = pick_types(raw.info, meg="mag", exclude=())
      power = np.sqrt(np.sum(raw[mag_picks][0] ** 2))
      # basics
      raw_tsss = maxwell_filter(
          raw, st_duration=tmax / 2.0, st_only=True
      )
      assert len(raw.info["projs"]) == len(raw_tsss.info["projs"])
      assert _compute_rank_int(raw_tsss, proj=False) == len(picks)
      _assert_shielding(raw_tsss, power, 9)
      # with movement
      head_pos = read_head_pos(pos_fname)
      raw_tsss = maxwell_filter(
          raw, st_duration=tmax / 2.0, st_only=True, head_pos=head_pos
      )
      assert _compute_rank_int(raw_tsss, proj=False) == len(picks)
      _assert_shielding(raw_tsss, power, 9)
      with pytest.warns(RuntimeWarning, match="st_fixed"):
          raw_tsss = maxwell_filter(
              raw,
              st_duration=tmax / 2.0,
              st_only=True,
              head_pos=head_pos,
              st_fixed=False,
          )
      assert _compute_rank_int(raw_tsss, proj=False) == len(picks)
      _assert_shielding(raw_tsss, power, 9)
      # should do nothing
      raw_tsss = maxwell_filter(
          raw, st_duration=tmax, st_correlation=1.0, st_only=True
      )
      assert_allclose(raw[:][0], raw_tsss[:][0])
      # degenerate
      with pytest.raises(
          ValueError, match="must not be None if st_only"
      ):
          maxwell_filter(raw, st_only=True)
      # two-step process equivalent to single-step process
      raw_tsss = maxwell_filter(raw, st_duration=tmax, st_only=True)
      raw_tsss = maxwell_filter(raw_tsss)
      raw_tsss_2 = maxwell_filter(raw, st_duration=tmax)
      assert_meg_snr(raw_tsss, raw_tsss_2, 1e5)
      # now also with head movement, and a bad MEG channel
      assert len(raw.info["bads"]) == 0
      bads = [raw.ch_names[0]]
      raw.info["bads"] = list(bads)
      raw_tsss = maxwell_filter(
          raw, st_duration=tmax, st_only=True, head_pos=head_pos
      )
      assert raw.info["bads"] == bads
      assert raw_tsss.info["bads"] == bads  # don't reset
      raw_tsss = maxwell_filter(raw_tsss, head_pos=head_pos)
      assert raw_tsss.info["bads"] == []  # do reset MEG bads
      raw_tsss_2 = maxwell_filter(
          raw, st_duration=tmax, head_pos=head_pos
      )
      assert raw_tsss_2.info["bads"] == []
      assert_meg_snr(raw_tsss, raw_tsss_2, 1e5)
  
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 12 for calling a global function with example usage: test_spatiotemporal_only() without return types