MCPcopy Index your code
hub / github.com/ipython/ipython / strip_ansi_from_outputs

Function strip_ansi_from_outputs

tests/test_magic.py:1099–1108  ·  view source on GitHub ↗
(outputs)

Source from the content-addressed store, hash-verified

1097 _strip_ansi = re.compile(r"\x1b\[[0-9;]*m").sub
1098
1099 def strip_ansi_from_outputs(outputs):
1100 result = []
1101 for out in outputs:
1102 out = dict(out)
1103 if "traceback" in out:
1104 out["traceback"] = [
1105 _strip_ansi("", line) for line in out["traceback"]
1106 ]
1107 result.append(out)
1108 return result
1109
1110 assert strip_ansi_from_outputs(actual["outputs"]) == strip_ansi_from_outputs(
1111 expected["outputs"]

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…