code: def _create_application():
      global _application
  
      if _application is None:
          app = Gio.Application.get_default()
          if app is None or getattr(
              app, "_created_by_matplotlib", False
          ):
              # display_is_valid returns False only if on Linux and neither X11
              # nor Wayland display can be opened.
              if not mpl._c_internal_utils.display_is_valid():
                  raise RuntimeError("Invalid DISPLAY variable")
              _application = Gtk.Application.new(
                  "org.matplotlib.Matplotlib3",
                  Gio.ApplicationFlags.NON_UNIQUE,
              )
              # The activate signal must be connected, but we don't care for
              # handling it, since we don't do any remote processing.
              _application.connect(
                  "activate", lambda *args, **kwargs: None
              )
              _application.connect("shutdown", _shutdown_application)
              _application.register()
              cbook._setup_new_guiapp()
          else:
              _application = app
  
      return _application
  
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 2 for calling a global function with example usage: _create_application() and returns: _application