code: def remove_escape_codes(text: str) -> str:
      """Remove ANSI escapes codes from string; used to remove "colors" from log messages."""
      return ANSI_ESCAPE.sub("", text)
  
imports: from __future__ import annotations
  import abc
  import enum
  import logging
  import sys
  from io import IOBase
  from logging import Handler, StreamHandler
  from typing import IO, TYPE_CHECKING, Any, Optional, TypeVar, cast
  import re2
label_desc: Use image node_id 2 for calling a global function with example usage: remove_escape_codes(text) and returns: ANSI_ESCAPE