code: def test_plot_chpi_snr():
      """Test plotting cHPI SNRs."""
      raw = read_raw_fif(chpi_fif_fname, allow_maxshield="yes")
      result = compute_chpi_snr(raw)
      # test figure creation
      fig = plot_chpi_snr(result)
      assert len(fig.axes) == len(result) - 2
      assert len(fig.axes[0].lines) == len(result["freqs"])
      assert len(fig.legends) == 1
      texts = [entry.get_text() for entry in fig.legends[0].get_texts()]
      assert len(texts) == len(result["freqs"])
      freqs = [float(text.split()[0]) for text in texts]
      assert_array_equal(freqs, result["freqs"])
      # test user-passed axes
      _, axs = plt.subplots(2, 3)
      _ = plot_chpi_snr(result, axes=axs.ravel())
      # test error
      _, axs = plt.subplots(5)
      with pytest.raises(
          ValueError, match="a list of 6 axes, got length 5"
      ):
          _ = plot_chpi_snr(result, axes=axs.ravel())
  
imports: from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from mne import SourceEstimate, pick_events, read_cov, read_dipole, read_events, read_evokeds, read_source_spaces
  from mne.chpi import compute_chpi_snr
  from mne.datasets import testing
  from mne.filter import create_filter
  from mne.io import read_raw_fif
  from mne.minimum_norm import read_inverse_operator
  from mne.time_frequency import CrossSpectralDensity
  from mne.viz import plot_bem, plot_chpi_snr, plot_csd, plot_events, plot_filter, plot_snr_estimate, plot_source_spectrogram
  from mne.viz.misc import _handle_event_colors
  from mne.viz.utils import _get_color_list
label_desc: Use image node_id 12 for calling a global function with example usage: test_plot_chpi_snr() without return types