code: def _allow_interrupt_macos():
      """A context manager that allows terminating a plot by sending a SIGINT."""
      return _allow_interrupt(
          lambda rsock: _macosx.wake_on_fd_write(rsock.fileno()),
          _macosx.stop,
      )
  
imports: import os
  import matplotlib
  from matplotlib import _api, cbook
  from matplotlib._pylab_helpers import Gcf
  from .None import _macosx
  from .backend_agg import FigureCanvasAgg
  from matplotlib.backend_bases import _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2, ResizeEvent, TimerBase, _allow_interrupt
label_desc: Use image node_id 1 for calling a global function with example usage: _allow_interrupt_macos() and returns: _allow_interrupt