code: def test_plot_alignment_meg(renderer, system):
      """Test plotting of MEG sensors + helmet."""
      pytest.importorskip("nibabel")
      if system == "Neuromag":
          this_info = read_info(evoked_fname)
      elif system == "CTF":
          this_info = read_raw_ctf(ctf_fname).info
      elif system == "BTi":
          this_info = read_raw_bti(
              pdf_fname,
              config_fname,
              hs_fname,
              convert=True,
              preload=False,
          ).info
      else:
          assert system == "KIT"
          this_info = read_raw_kit(sqd_fname).info
  
      meg = {"helmet": 0.1, "sensors": 0.2}
      sensor_colors = "k"  # should be upsampled to correct shape
      if system == "KIT":
          meg["ref"] = 0.3
          with pytest.raises(TypeError, match="instance of dict"):
              plot_alignment(
                  this_info, meg=meg, sensor_colors=sensor_colors
              )
          sensor_colors = dict(meg=sensor_colors)
          sensor_colors["ref_meg"] = ["r"] * len(
              pick_types(this_info, ref_meg=True)
          )
      fig = plot_alignment(
          this_info,
          read_trans(trans_fname),
          subject="sample",
          subjects_dir=subjects_dir,
          meg=meg,
          eeg=False,
          sensor_colors=sensor_colors,
      )
      assert isinstance(fig, Figure3D)
      # count the number of objects: should be n_meg_ch + 1 (helmet) + 1 (head)
      use_info = pick_info(
          this_info,
          pick_types(
              this_info,
              meg=True,
              eeg=False,
              ref_meg="ref" in meg,
              exclude=(),
          ),
      )
      n_actors = use_info["nchan"] + 2
      _assert_n_actors(fig, renderer, n_actors)
  
imports: from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from matplotlib.colors import Colormap
  from matplotlib.figure import Figure
  from numpy.testing import assert_allclose, assert_array_equal
  from mne import MixedSourceEstimate, SourceEstimate, convert_forward_solution, make_field_map, make_sphere_model, pick_info, pick_types, read_dipole, read_evokeds, read_forward_solution, read_trans, setup_volume_source_space, use_coil_def
  from mne._fiff._digitization import write_dig
  from mne._fiff.constants import FIFF
  from mne.bem import read_bem_solution, read_bem_surfaces
  from mne.datasets import testing
  from mne.defaults import DEFAULTS
  from mne.io import read_info, read_raw_bti, read_raw_ctf, read_raw_kit, read_raw_nirx
  from mne.minimum_norm import apply_inverse
  from mne.source_estimate import _BaseVolSourceEstimate
  from mne.source_space import read_source_spaces
  from mne.transforms import Transform
  from mne.utils import _record_warnings, catch_logging
  from mne.viz import Brain, EvokedField, Figure3D, link_brains, mne_analyze_colormap, plot_alignment, plot_brain_colorbar, plot_head_positions, plot_source_estimates, plot_sparse_source_estimates, snapshot_brain_montage
  from mne.viz._3d import _get_map_ticks, _linearize_map, _process_clim
  from mne.viz.utils import _fake_click, _fake_keypress, _fake_scroll, _get_cmap
label_desc: Use image node_id 6 for calling a global function with example usage: test_plot_alignment_meg(renderer, system) without return types