code: def _init_mne_qtapp(enable_icon=True, pg_app=False, splash=False):
      """Get QApplication-instance for MNE-Python.
  
      Parameter
      ---------
      enable_icon: bool
          If to set an MNE-icon for the app.
      pg_app: bool
          If to create the QApplication with pyqtgraph. For an until know
          undiscovered reason the pyqtgraph-browser won't show without
          mkQApp from pyqtgraph.
      splash : bool | str
          If not False, display a splash screen. If str, set the message
          to the given string.
  
      Returns
      -------
      app : ``qtpy.QtWidgets.QApplication``
          Instance of QApplication.
      splash : ``qtpy.QtWidgets.QSplashScreen``
          Instance of QSplashScreen. Only returned if splash is True or a
          string.
      """
      from qtpy.QtCore import Qt
      from qtpy.QtGui import QGuiApplication, QIcon, QPixmap
      from qtpy.QtWidgets import QApplication, QSplashScreen
  
      app_name = "MNE-Python"
      organization_name = "MNE"
  
      # Fix from cbrnr/mnelab for app name in menu bar
      # This has to come *before* the creation of the QApplication to work.
      # It also only affects the title bar, not the application dock.
      # There seems to be no way to change the application dock from "python"
      # at runtime.
      if sys.platform.startswith("darwin"):
          try:
              # set bundle name on macOS (app name shown in the menu bar)
              from Foundation import NSBundle
  
              bundle = NSBundle.mainBundle()
              info = (
                  bundle.localizedInfoDictionary()
                  or bundle.infoDictionary()
              )
              info["CFBundleName"] = app_name
          except ModuleNotFoundError:
              pass
  
      # First we need to check to make sure the display is valid, otherwise
      # Qt might segfault on us
      app = QApplication.instance()
      if not (app or _display_is_valid()):
          raise RuntimeError("Cannot connect to a valid display")
  
      if pg_app:
          from pyqtgraph import mkQApp
  
          old_argv = sys.argv
          try:
              sys.argv = []
              app = mkQApp(app_name)
          finally:
              sys.argv = old_argv
      elif not app:
          app = QApplication([app_name])
      app.setApplicationName(app_name)
      app.setOrganizationName(organization_name)
      qt_version = _check_qt_version(check_usable_display=False)
      # HiDPI is enabled by default in Qt6, requires to be explicitly set for Qt5
      if _compare_version(qt_version, "<", "6.0"):
          app.setAttribute(Qt.AA_UseHighDpiPixmaps)
  
      if enable_icon or splash:
          icons_path = _qt_init_icons()
  
      if (
          enable_icon
          and app.windowIcon().cacheKey() != _QT_ICON_KEYS["app"]
      ):
          # Set icon
          kind = (
              "bigsur_"
              if platform.mac_ver()[0] >= "10.16"
              else "default_"
          )
          icon = QIcon(f"{icons_path}/mne_{kind}icon.png")
          app.setWindowIcon(icon)
          _QT_ICON_KEYS["app"] = app.windowIcon().cacheKey()
  
      out = app
      if splash:
          pixmap = QPixmap(f"{icons_path}/mne_splash.png")
          pixmap.setDevicePixelRatio(
              QGuiApplication.primaryScreen().devicePixelRatio()
          )
          args = (pixmap,)
          if _should_raise_window():
              args += (Qt.WindowStaysOnTopHint,)
          qsplash = QSplashScreen(*args)
          qsplash.setAttribute(Qt.WA_ShowWithoutActivating, True)
          if isinstance(splash, str):
              alignment = int(Qt.AlignBottom | Qt.AlignHCenter)
              qsplash.showMessage(
                  splash, alignment=alignment, color=Qt.white
              )
          qsplash.show()
          app.processEvents()
          out = (out, qsplash)
  
      return out
  
imports: import collections.abc
  import functools
  import os
  import platform
  import signal
  import sys
  from colorsys import rgb_to_hls
  from contextlib import contextmanager
  from ctypes import c_char_p, c_void_p, cdll
  from pathlib import Path
  import numpy
  from ...fixes import _compare_version
  from ...utils import _check_qt_version, _validate_type, logger, warn
  from ..utils import _get_cmap
label_desc: Use image node_id 6 for calling a global function with example usage: _init_mne_qtapp(enable_icon, pg_app, splash) and returns: out