MCPcopy Index your code
hub / github.com/python/cpython / unbracket

Function unbracket

Lib/_pyrepl/utils.py:88–96  ·  view source on GitHub ↗

r"""Return `s` with \001 and \002 characters removed. If `including_content` is True, content between \001 and \002 is also stripped.

(s: str, including_content: bool = False)

Source from the content-addressed store, hash-verified

86
87
88def unbracket(s: str, including_content: bool = False) -> str:
89 r"""Return `s` with \001 and \002 characters removed.
90
91 If `including_content` is True, content between \001 and \002 is also
92 stripped.
93 """
94 if including_content:
95 return ZERO_WIDTH_BRACKET.sub("", s)
96 return s.translate(ZERO_WIDTH_TRANS)
97
98
99def gen_colors(buffer: str) -> Iterator[ColorSpan]:

Callers 2

clean_screenFunction · 0.90
process_promptMethod · 0.85

Calls 2

subMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…