code: def _shutdown_application(app):
      # The application might prematurely shut down if Ctrl-C'd out of IPython,
      # so close all windows.
      for win in app.get_windows():
          win.close()
      # The PyGObject wrapper incorrectly thinks that None is not allowed, or we
      # would call this:
      # Gio.Application.set_default(None)
      # Instead, we set this property and ignore default applications with it:
      app._created_by_matplotlib = True
      global _application
      _application = None
  
imports: import logging
  import sys
  import matplotlib
  from matplotlib import _api, backend_tools, cbook
  from matplotlib._pylab_helpers import Gcf
  from matplotlib.backend_bases import _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2, TimerBase
  from matplotlib.backend_tools import Cursors
  import gi
  from gi.repository import Gdk, Gio, GLib, Gtk
label_desc: Use image node_id 1 for calling a global function with example usage: _shutdown_application(app) without return types