code: def _stderr_supports_color():
      try:
          if hasattr(sys.stderr, "isatty") and sys.stderr.isatty():
              if curses:
                  curses.setupterm()
                  if curses.tigetnum("colors") > 0:
                      return True
              elif colorama:
                  if sys.stderr is getattr(
                      colorama.initialise, "wrapped_stderr", object()
                  ):
                      return True
      except Exception:
          # Very broad exception handling because it's always better to
          # fall back to non-colored logs than to break at startup.
          pass
      return False
  
file_path: catboost/contrib/python/tornado/tornado-4/tornado/log.py
imports: from __future__ import absolute_import, division, print_function
  import logging
  import logging.handlers
  import sys
  from tornado.escape import _unicode
  from tornado.util import unicode_type, basestring_type
label_desc: Use image node_id 1 for calling a global function with example usage: _stderr_supports_color() and returns: False, True, True