code: def color_enabled() -> bool:
      """Check for whether color output is enabled
  
      If the configuration value ``datalad.ui.color`` is ``'on'`` or ``'off'``,
      that takes precedence.
      If ``datalad.ui.color`` is ``'auto'``, and the environment variable
      ``NO_COLOR`` is defined (see https://no-color.org), then color is disabled.
      Otherwise, enable colors if a TTY is detected by ``datalad.ui.ui.is_interactive``.
  
      Returns
      -------
      bool
      """
      ui_color = cfg.obtain("datalad.ui.color")
      return (
          ui_color == "on"
          or ui_color == "auto"
          and os.getenv("NO_COLOR") is None
          and ui.is_interactive
      )
  
file_path: datalad/datalad/support/ansi_colors.py
imports: from __future__ import annotations
  import os
  from typing import Optional
  from ..None import cfg
  from ..ui import ui
label_desc: Use image node_id 1 for calling a global function with example usage: color_enabled() and returns: unknown