@classmethod<EOL><INDENT>def translate_escaped_str(cls, str_val):<DEDENT>
if isinstance(str_val, string_types):<EOL><INDENT>str_val = str_val.encode('<STR_LIT>')<EOL>if sys.version_info >= (<NUM_LIT:3>, <NUM_LIT:0>):<EOL><INDENT>str_val = str_val.decode('<STR_LIT:utf-8>')<EOL><DEDENT>str_val = str_val.replace('<STR_LIT:">', r'<STR_LIT>')<EOL><DEDENT>return '<STR_LIT>'.format(str_val)<EOL>
Reusable by most interpreters