<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _wrap_tracebackexception_format(redact: Callable[[str], str]):
 """Monkey-patch TracebackException.format to redact printed lines. Only the last call will be effective. Consecutive calls will overwrite the previous monkey patches. """

    original_format = getattr(TracebackException, '_original', None)
    if original_format is None:
        original_format = TracebackException.format
        setattr(TracebackException, '_original', original_format)

    @wraps(original_format)
    def tracebackexception_format(self, *, chain=True):
        for line in original_format(self, chain=chain):
            yield redact(line)

    setattr(TracebackException, 'format', tracebackexception_format)