code: def test_disable_ui_events(event_channels, disabled_event_channels):
      """Test disable_ui_events context manager."""
      callback_calls = list()
  
      def callback(event):
          """Respond to time change event."""
          callback_calls.append(event)
  
      fig = plt.figure()
      ui_events.subscribe(fig, "time_change", callback)
      with ui_events.disable_ui_events(fig):
          ui_events.publish(fig, ui_events.TimeChange(time=10.2))
      assert not callback_calls
      ui_events.publish(fig, ui_events.TimeChange(time=10.2))
      assert callback_calls
  
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 10 for calling a global function with example usage: test_disable_ui_events(event_channels, disabled_event_channels) without return types