code: def in_terminal_that_supports_colour() -> bool:
      """
      Determine (within reason) if we are in an interactive terminal that supports color.
  
      Note: this is not exhaustive, but it covers a lot (most?) of the common cases.
      """
      if hasattr(sys.stdout, "isatty"):
          # can enhance as necessary, but this is a reasonable start
          return (
              sys.stdout.isatty()
              and (
                  sys.platform != "win32"
                  or "ANSICON" in os.environ
                  or "WT_SESSION" in os.environ
                  or os.environ.get("TERM_PROGRAM") == "vscode"
                  or os.environ.get("TERM") == "xterm-256color"
              )
          ) or os.environ.get("PYCHARM_HOSTED") == "1"
      return False
  
imports: from __future__ import annotations
  import inspect
  import os
  import re
  import sys
  import warnings
  from collections.abc import MappingView, Sized
  from enum import Enum
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Generator, Iterable, Literal, Sequence, TypeVar
  import polars
  from polars import functions
  from polars.datatypes import FLOAT_DTYPES, INTEGER_DTYPES, Boolean, Date, Datetime, Decimal, Duration, Int64, String, Time
  from polars.dependencies import _check_for_numpy
  from polars.dependencies import numpy
label_desc: Use image node_id 24 for calling a global function with example usage: in_terminal_that_supports_colour() and returns: False, unknown