def legacy_html_escape(string):
 return re.sub('([&<"\\\'>])', (lambda m: xml_escapes[m.group()]), string)

def legacy_html_escape ( string ) : return re . sub ( '([&<"\\\'>])' , ( lambda m : xml_escapes [ m . group ( ) ] ) , string )
legacy html escape for non-unicode mode .