code: def test_plot_overlapping_epochs_with_events(
      browser_backend, event_id, expected_texts
  ):
      """Test drawing of event lines in overlapping epochs."""
      data = np.zeros(
          shape=(3, 2, 100)
      )  # 3 epochs, 2 channels, 100 samples
      sfreq = 100
      info = create_info(
          ch_names=("a", "b"), ch_types=("misc", "misc"), sfreq=sfreq
      )
      # 90% overlap, so all 3 events should appear in all 3 epochs when plotted:
      events = np.column_stack(([40, 50, 60], [0, 0, 0], [1, 2, 3]))
      epochs = EpochsArray(
          data,
          info,
          tmin=-0.4,
          events=events,
          event_id=dict(a=1, b=2, c=3),
      )
      fig = epochs.plot(events=events, picks="misc", event_id=event_id)
      # check that the event lines are there and the labels are correct
      lines, texts = _get_event_lines_and_texts(fig)
      assert len(lines) == len(epochs) * len(events)
      # TODO: Qt browser doesn't show event names, only integers
      if browser_backend.name == "matplotlib":
          assert set(texts) == expected_texts
      # plot one epoch with its defining event plus events at its first & last sample
      # (regression test for https://mne.discourse.group/t/6334)
      events = np.vstack(([[0, 0, 4]], events[[0]], [[99, 0, 4]]))
      fig = epochs[0].plot(
          events=events, picks="misc", event_id=event_id
      )
      expected_texts.add("4")
      for text in ("2", "3", "b", "c"):
          expected_texts.discard(text)
      lines, texts = _get_event_lines_and_texts(fig)
      assert len(lines) == len(events)
      # TODO: Qt browser doesn't show event names, only integers
      if browser_backend.name == "matplotlib":
          assert set(texts) == expected_texts
  
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 9 for calling a global function with example usage: test_plot_overlapping_epochs_with_events(browser_backend, event_id, expected_texts) without return types