code: def should_do_markup(file: TextIO) -> bool:
      if os.environ.get("PY_COLORS") == "1":
          return True
      if os.environ.get("PY_COLORS") == "0":
          return False
      if "NO_COLOR" in os.environ:
          return False
      if "FORCE_COLOR" in os.environ:
          return True
      return (
          hasattr(file, "isatty")
          and file.isatty()
          and os.environ.get("TERM") != "dumb"
      )
  
imports: import os
  import shutil
  import sys
  from typing import Optional
  from typing import Sequence
  from typing import TextIO
  from .wcwidth import wcswidth
  from _pytest.compat import final
label_desc: Use image node_id 2 for calling a global function with example usage: should_do_markup(file) and returns: unknown, True, False, False, True