def unescape(data):
cc = re.compile(r'<STR_LIT>')<EOL>result = []<EOL>m = cc.search(data)<EOL>while m:<EOL><INDENT>result.append(data[<NUM_LIT:0>:m.start()])<EOL>d = m.group(<NUM_LIT:1>)<EOL>if d:<EOL><INDENT>d = int(d)<EOL>result.append(unichr(d))<EOL><DEDENT>else:<EOL><INDENT>d = _unescape.get(m.group(<NUM_LIT:2>), ord('<STR_LIT:?>'))<EOL>result.append(unichr(d))<EOL><DEDENT>data = data[m.end():]<EOL>m = cc.search(data)<EOL><DEDENT>result.append(data)<EOL>return '<STR_LIT>'.join(result)<EOL>
unescapes html entities. the opposite of escape.