MCPcopy Create free account
hub / github.com/ipython/ipython / strip_ansi

Function strip_ansi

IPython/utils/text.py:475–484  ·  view source on GitHub ↗

Remove ansi escape codes from text. Parameters ---------- source : str Source to remove the ansi from

(source)

Source from the content-addressed store, hash-verified

473 return text
474
475def strip_ansi(source):
476 """
477 Remove ansi escape codes from text.
478
479 Parameters
480 ----------
481 source : str
482 Source to remove the ansi from
483 """
484 return re.sub(r'\033\[(\d|;)+?m', '', source)
485
486
487class EvalFormatter(Formatter):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected