code: def _qt_detect_theme():
      try:
          import darkdetect
  
          theme = darkdetect.theme().lower()
      except ModuleNotFoundError:
          logger.info(
              'For automatic theme detection, "darkdetect" has to'
              " be installed! You can install it with "
              "`pip install darkdetect`"
          )
          theme = "light"
      except Exception:
          theme = "light"
      return theme
  
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 9 for calling a global function with example usage: _qt_detect_theme() and returns: theme