code: def test_plot_bridged_electrodes():
      """Test plotting of bridged electrodes."""
      rng = np.random.default_rng(42)
      montage = make_standard_montage("biosemi64")
      info = create_info(montage.ch_names, 256, "eeg").set_montage(
          "biosemi64"
      )
      bridged_idx = [(0, 1), (2, 3)]
      n_epochs = 10
      ed_matrix = (
          np.zeros((n_epochs, len(info.ch_names), len(info.ch_names)))
          * np.nan
      )
      triu_idx = np.triu_indices(len(info.ch_names), 1)
      for i in range(n_epochs):
          ed_matrix[i][triu_idx] = rng.random() + rng.random(
              triu_idx[0].size
          )
      fig = plot_bridged_electrodes(
          info,
          bridged_idx,
          ed_matrix,
          topomap_args=dict(names=info.ch_names, vlim=(None, 1)),
      )
      # two bridged lines plus head outlines
      assert len(fig.axes[0].lines) == 6
      # test with sphere="eeglab"
      fig = plot_bridged_electrodes(
          info,
          bridged_idx,
          ed_matrix,
          topomap_args=dict(
              names=info.ch_names, sphere="eeglab", vlim=(None, 1)
          ),
      )
  
      with pytest.raises(RuntimeError, match="Expected"):
          plot_bridged_electrodes(
              info, bridged_idx, np.zeros((5, 6, 7))
          )
  
      # test with multiple channel types
      raw = read_raw_fif(raw_fname, preload=True)
      picks = _picks_to_idx(raw.info, "eeg")
      raw._data[picks[0]] = raw._data[
          picks[1]
      ]  # artificially bridge electrodes
      bridged_idx, ed_matrix = compute_bridged_electrodes(raw)
      plot_bridged_electrodes(raw.info, bridged_idx, ed_matrix)
  
imports: from functools import partial
  from pathlib import Path
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pytest
  from matplotlib.patches import Circle
  from numpy.testing import assert_almost_equal, assert_array_equal, assert_equal
  from mne import Epochs, EvokedArray, Projection, compute_proj_evoked, compute_proj_raw, create_info, find_layout, make_fixed_length_events, pick_types, read_cov, read_evokeds, read_proj
  from mne._fiff.compensator import get_current_comp
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import _picks_to_idx, channel_indices_by_type, pick_info
  from mne._fiff.proj import make_eeg_average_ref_proj
  from mne.channels import find_ch_adjacency, make_dig_montage, make_standard_montage, read_layout
  from mne.datasets import testing
  from mne.io import RawArray, read_info, read_raw_fif
  from mne.preprocessing import compute_bridged_electrodes
  from mne.time_frequency.tfr import AverageTFR
  from mne.viz import plot_evoked_topomap, plot_projs_topomap, topomap
  from mne.viz.tests.test_raw import _proj_status
  from mne.viz.topomap import _get_pos_outlines, _onselect, plot_arrowmap, plot_bridged_electrodes, plot_ch_adjacency, plot_psds_topomap, plot_topomap
  from mne.viz.utils import _fake_click, _fake_keypress, _fake_scroll, _find_peaks
label_desc: Use image node_id 22 for calling a global function with example usage: test_plot_bridged_electrodes() without return types