code: def test_plot_ica_scores():
      """Test plotting of ICA scores."""
      raw = _get_raw()
      picks = _get_picks(raw)
      ica = ICA(noise_cov=read_cov(cov_fname), n_components=2)
      with pytest.warns(RuntimeWarning, match="projection"):
          ica.fit(raw, picks=picks)
      ica.plot_scores(
          [0.3, 0.2], axhline=[0.1, -0.1], figsize=(6.4, 2.7)
      )
      ica.plot_scores([[0.3, 0.2], [0.3, 0.2]], axhline=[0.1, -0.1])
  
      # check labels
      ica.labels_ = dict()
      ica.labels_["eog"] = 0
      ica.labels_["ecg"] = 1
      ica.plot_scores([0.3, 0.2], axhline=[0.1, -0.1], labels="eog")
      ica.plot_scores([0.3, 0.2], axhline=[0.1, -0.1], labels="ecg")
      ica.labels_["eog/0/foo"] = 0
      ica.labels_["ecg/1/bar"] = 0
      ica.plot_scores([0.3, 0.2], axhline=[0.1, -0.1], labels="foo")
      ica.plot_scores([0.3, 0.2], axhline=[0.1, -0.1], labels="eog")
      ica.plot_scores([0.3, 0.2], axhline=[0.1, -0.1], labels="ecg")
  
      # check setting number of columns
      fig = ica.plot_scores(
          [[0.3, 0.2], [0.3, 0.2], [0.3, 0.2]], axhline=[0.1, -0.1]
      )
      assert 2 == _get_geometry(fig)[1]
      fig = ica.plot_scores(
          [[0.3, 0.2], [0.3, 0.2]], axhline=[0.1, -0.1], n_cols=1
      )
      assert 1 == _get_geometry(fig)[1]
  
      # only use 1 column (even though 2 were requested)
      fig = ica.plot_scores([0.3, 0.2], axhline=[0.1, -0.1], n_cols=2)
      assert 1 == _get_geometry(fig)[1]
  
      with pytest.raises(ValueError, match="Need as many"):
          ica.plot_scores(
              [0.3, 0.2],
              axhline=[0.1, -0.1],
              labels=["one", "one-too-many"],
          )
      with pytest.raises(ValueError, match="The length of"):
          ica.plot_scores([0.2])
  
imports: import sys
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from mne import Annotations, Epochs, make_fixed_length_events, pick_types, read_cov, read_events
  from mne.io import read_raw_fif
  from mne.preprocessing import ICA, create_ecg_epochs, create_eog_epochs
  from mne.utils import _record_warnings, catch_logging
  from mne.viz.ica import _create_properties_layout, plot_ica_properties
  from mne.viz.utils import _fake_click, _fake_keypress
label_desc: Use image node_id 10 for calling a global function with example usage: test_plot_ica_scores() without return types