def escape(text):
 text = text.replace('\\', '\\\\')
 text = text.replace('"""', '""\\"')
 text = text.replace(' \n', ' \\n\\\n')
 return text

def escape ( text ) : text = text . replace ( '\\' , '\\\\' ) text = text . replace ( '"""' , '""\\"' ) text = text . replace ( ' \n' , ' \\n\\\n' ) return text
escape a string in an oauth-compatible fashion .