code: def test_unlink(event_channel_links):
      """Test unlinking event channels."""
      fig1 = plt.figure()
      fig2 = plt.figure()
      fig3 = plt.figure()
      ui_events.link(fig1, fig2)
      ui_events.link(fig2, fig3)
      assert len(event_channel_links) == 3
  
      # Fig1 is involved in two of the 4 links.
      ui_events.unlink(fig1)
      assert len(event_channel_links) == 2
      assert fig1 not in event_channel_links[fig2]
      assert fig1 not in event_channel_links[fig3]
      ui_events.link(fig1, fig2)  # Relink for the next test.
  
      # Fig2 is involved in all links, unlinking it should clear them all.
      ui_events.unlink(fig2)
      assert len(event_channel_links) == 0
  
file_path: mne-python/mne/viz/tests/test_ui_events.py
imports: import matplotlib.pyplot
  import pytest
  from mne.datasets import testing
  from mne.viz import ui_events
label_desc: Use image node_id 9 for calling a global function with example usage: test_unlink(event_channel_links) without return types