code: def test_compute_proj_ctf():
      """Test to show that projector code completes on CTF data."""
      raw = read_raw_ctf(ctf_fname, preload=True)
  
      # expected channels per projector type
      mag_picks = pick_types(
          raw.info, meg="mag", ref_meg=False, exclude="bads"
      )[::10]
      n_mags = len(mag_picks)
      grad_picks = pick_types(
          raw.info, meg="grad", ref_meg=False, exclude="bads"
      )[::10]
      n_grads = len(grad_picks)
      eeg_picks = pick_types(
          raw.info, meg=False, eeg=True, ref_meg=False, exclude="bads"
      )[2::3]
      n_eegs = len(eeg_picks)
      ref_picks = pick_types(raw.info, meg=False, ref_meg=True)
      raw.pick(
          np.sort(
              np.concatenate(
                  [mag_picks, grad_picks, eeg_picks, ref_picks]
              )
          )
      )
      del mag_picks, grad_picks, eeg_picks, ref_picks
  
      # Test with and without gradient compensation
      raw.apply_gradient_compensation(0)
      n_projs_init = len(raw.info["projs"])
      with pytest.warns(RuntimeWarning, match="Attenuation"):
          projs, _ = compute_proj_eog(
              raw,
              n_mag=2,
              n_grad=2,
              n_eeg=2,
              average=True,
              ch_name="EEG059",
              avg_ref=True,
              no_proj=False,
              l_freq=None,
              h_freq=None,
              reject=None,
              tmax=dur_use,
              filter_length=1000,
          )
      _check_projs_for_expected_channels(projs, n_mags, n_grads, n_eegs)
      assert len(projs) == (5 + n_projs_init)
  
      raw.apply_gradient_compensation(1)
      with pytest.warns(RuntimeWarning, match="Attenuation"):
          projs, _ = compute_proj_ecg(
              raw,
              n_mag=1,
              n_grad=1,
              n_eeg=2,
              average=True,
              ch_name="EEG059",
              avg_ref=True,
              no_proj=False,
              l_freq=None,
              h_freq=None,
              reject=None,
              tmax=dur_use,
              filter_length=1000,
          )
      _check_projs_for_expected_channels(projs, n_mags, n_grads, n_eegs)
      assert len(projs) == (4 + n_projs_init)
  
file_path: mne-python/mne/preprocessing/tests/test_ssp.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from mne import pick_types
  from mne._fiff.proj import activate_proj, make_projector
  from mne.datasets import testing
  from mne.io import read_raw_ctf, read_raw_fif
  from mne.preprocessing.ssp import compute_proj_ecg, compute_proj_eog
label_desc: Use image node_id 6 for calling a global function with example usage: test_compute_proj_ctf() without return types