def escape(s):
if s is None:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>assert isinstance(s, basestring),"<STR_LIT>" % (basestring, type(s), s)<EOL>s = s.replace('<STR_LIT:\\>', '<STR_LIT>')<EOL>s = s.replace('<STR_LIT:\n>', '<STR_LIT>')<EOL>s = s.replace('<STR_LIT:\t>', '<STR_LIT>')<EOL>s = s.replace('<STR_LIT:U+002C>', '<STR_LIT:\t>')<EOL>return s<EOL>
Escape commas, tabs, newlines and dashes in a string

Commas are encoded as tabs.

:param s: (string) to escape
:returns: (string) escaped string