code: def test_plot_epochs_clicks(
      epochs, epochs_full, capsys, browser_backend
  ):
      """Test plot_epochs mouse interaction."""
      fig = epochs.plot(events=True)
      x = fig.mne.traces[0].get_xdata()[3]
      y = fig.mne.traces[0].get_ydata()[3]
      n_epochs = len(epochs)
      epoch_num = fig.mne.inst.selection[0]
      # test (un)marking bad epochs
      fig._fake_click((x, y), xform="data")  # mark a bad epoch
      assert epoch_num in fig.mne.bad_epochs
      fig._fake_click((x, y), xform="data")  # unmark it
      assert epoch_num not in fig.mne.bad_epochs
      fig._fake_click((x, y), xform="data")  # mark it bad again
      assert epoch_num in fig.mne.bad_epochs
      # test vline
      fig._fake_keypress("escape")  # close and drop epochs
      fig._close_event()  # XXX workaround, MPL Agg doesn't trigger close event
      assert n_epochs - 1 == len(epochs)
      # test marking bad channels
      # need more than 1 epoch this time
      fig = epochs_full.plot(n_epochs=3)
      first_ch = fig._get_ticklabels("y")[0]
      assert first_ch not in fig.mne.info["bads"]
      fig._click_ch_name(
          ch_index=0, button=1
      )  # click ch name to mark bad
      assert first_ch in fig.mne.info["bads"]
      # test clicking scrollbars
      fig._fake_click((0.5, 0.5), ax=fig.mne.ax_vscroll)
      fig._fake_click((0.5, 0.5), ax=fig.mne.ax_hscroll)
      # test moving bad epoch offscreen
      fig._fake_keypress("right")  # move right
      x = fig.mne.traces[0].get_xdata()[-3]
      y = fig.mne.traces[0].get_ydata()[-3]
      fig._fake_click((x, y), xform="data")  # mark a bad epoch
      fig._fake_keypress("left")  # move back
      out, err = capsys.readouterr()
      assert "out of bounds" not in out
      assert "out of bounds" not in err
      fig._fake_keypress("escape")
      fig._close_event()  # XXX workaround, MPL Agg doesn't trigger close event
      assert len(epochs_full) == 6
      # test rightclick → image plot
      fig = epochs_full.plot()
      fig._click_ch_name(ch_index=0, button=3)  # show image plot
      assert len(fig.mne.child_figs) == 1
      # test scroll wheel
      fig._fake_scroll(0.5, 0.5, -0.5)  # scroll down
      fig._fake_scroll(0.5, 0.5, 0.5)
  
imports: import platform
  import matplotlib.pyplot
  import numpy
  import pytest
  from mne import Epochs, EpochsArray, create_info
  from mne.datasets import testing
  from mne.event import make_fixed_length_events
  from mne.viz import plot_drop_log
label_desc: Use image node_id 6 for calling a global function with example usage: test_plot_epochs_clicks(epochs, epochs_full, capsys, browser_backend) without return types