def _format_msg(text, width, indent=<NUM_LIT:0>, prefix="<STR_LIT>"):
text = repr(text).replace("<STR_LIT>", "<STR_LIT>").replace("<STR_LIT>", "<STR_LIT>")<EOL>sindent = "<STR_LIT:U+0020>" * indent if not prefix else prefix<EOL>wrapped_text = textwrap.wrap(text, width, subsequent_indent=sindent)<EOL>return ("<STR_LIT:\n>".join(wrapped_text))[<NUM_LIT:1>:-<NUM_LIT:1>].rstrip()<EOL>
r"""
    Format exception message.

    Replace newline characters \n with ``\n``, ` with \` and then wrap text as
    needed