def unescape(escaped, escape_char=ESCAPE_CHAR):
if isinstance(escaped, bytes):<EOL><INDENT>escaped = escaped.decode('<STR_LIT:utf8>')<EOL><DEDENT>escape_pat = re.compile(re.escape(escape_char).encode('<STR_LIT:utf8>') + b'<STR_LIT>', re.IGNORECASE)<EOL>buf = escape_pat.subn(_unescape_char, escaped.encode('<STR_LIT:utf8>'))[<NUM_LIT:0>]<EOL>return buf.decode('<STR_LIT:utf8>')<EOL>
Unescape a string escaped with `escape`

    escape_char must be the same as that used in the call to escape.