code: def _qt_get_stylesheet(theme):
      _validate_type(theme, ("path-like",), "theme")
      theme = str(theme)
      orig_theme = theme
      system_theme = None
      stylesheet = ""
      extra_msg = ""
      if theme == "auto":
          theme = system_theme = _qt_detect_theme()
      if theme in ("dark", "light"):
          if system_theme is None:
              system_theme = _qt_detect_theme()
          qt_version, api = _check_qt_version(return_api=True)
          # On macOS, we shouldn't need to set anything when the requested theme
          # matches that of the current OS state
          if sys.platform == "darwin":
              extra_msg = f"when in {system_theme} mode on macOS"
          # But before 5.13, we need to patch some mistakes
          if sys.platform == "darwin" and theme == system_theme:
              if theme == "dark" and _compare_version(
                  qt_version, "<", "5.13"
              ):
                  # Taken using "Digital Color Meter" on macOS 12.2.1 looking at
                  # Meld, and also adapting (MIT-licensed)
                  # https://github.com/ColinDuquesnoy/QDarkStyleSheet/blob/master/qdarkstyle/dark/style.qss  # noqa: E501
                  # Something around rgb(51, 51, 51) worked as the bgcolor here,
                  # but it's easy enough just to set it transparent and inherit
                  # the bgcolor of the window (which is the same). We also take
                  # the separator images from QDarkStyle (MIT).
                  icons_path = _qt_init_icons()
                  stylesheet = """\
  QStatusBar {
    border: 1px solid rgb(76, 76, 75);
    background: transparent;
  }
  QStatusBar QLabel {
    background: transparent;
  }
  QToolBar {
    background-color: transparent;
    border-bottom: 1px solid rgb(99, 99, 99);
  }
  QToolBar::separator:horizontal {
    width: 16px;
    image: url("%(icons_path)s/toolbar_separator_horizontal@2x.png");
  }
  QToolBar::separator:vertical {
    height: 16px;
    image: url("%(icons_path)s/toolbar_separator_vertical@2x.png");
  }
  QToolBar::handle:horizontal {
    width: 16px;
    image: url("%(icons_path)s/toolbar_move_horizontal@2x.png");
  }
  QToolBar::handle:vertical {
    height: 16px;
    image: url("%(icons_path)s/toolbar_move_vertical@2x.png");
  }
  """ % dict(
                      icons_path=icons_path
                  )
          else:
              # Here we are on non-macOS (or on macOS but our sys theme does not
              # match the requested theme)
              if api in ("PySide6", "PyQt6"):
                  if orig_theme != "auto" and not (
                      theme == system_theme == "light"
                  ):
                      warn(
                          f"Setting theme={repr(theme)} is not yet supported "
                          f"for {api} in qdarkstyle, it will be ignored"
                      )
              else:
                  try:
                      import qdarkstyle
                  except ModuleNotFoundError:
                      logger.info(
                          f'To use {theme} mode{extra_msg}, "qdarkstyle" has to '
                          "be installed! You can install it with:\n"
                          "pip install qdarkstyle\n"
                      )
                  else:
                      klass = getattr(
                          getattr(qdarkstyle, theme).palette,
                          f"{theme.capitalize()}Palette",
                      )
                      stylesheet = qdarkstyle.load_stylesheet(klass)
      else:
          try:
              file = open(theme)
          except OSError:
              warn(
                  "Requested theme file not found, will use light instead: "
                  f"{repr(theme)}"
              )
          else:
              with file as fid:
                  stylesheet = fid.read()
  
      return stylesheet
  
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 10 for calling a global function with example usage: _qt_get_stylesheet(theme) and returns: stylesheet