def normalize(string: str) -> str:
string = string.replace("<STR_LIT:\t>", "<STR_LIT:U+0020>")<EOL>lines = string.split("<STR_LIT:\n>")<EOL>while lines and (not lines[<NUM_LIT:0>] or lines[<NUM_LIT:0>].isspace()):<EOL><INDENT>lines.pop(<NUM_LIT:0>)<EOL><DEDENT>while lines and (not lines[-<NUM_LIT:1>] or lines[-<NUM_LIT:1>].isspace()):<EOL><INDENT>lines.pop()<EOL><DEDENT>for i, line in enumerate(lines):<EOL><INDENT>lines[i] = line.rstrip()<EOL><DEDENT>string = "<STR_LIT:\n>".join(lines)<EOL>string = textwrap.dedent(string)<EOL>return string<EOL>
Normalizes whitespace.

Strips leading and trailing blank lines, dedents, and removes trailing
whitespace from the result.