code: def test_publish(event_channels):
      """Test publishing UI events."""
      fig = plt.figure()
      ui_events.publish(fig, ui_events.TimeChange(time=10.2))
  
      # Publishing the event should have created the needed channel.
      assert len(event_channels) == 1
      assert fig in event_channels
  
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 5 for calling a global function with example usage: test_publish(event_channels) without return types