every occurrence of '<' with '&lt;', every occurrence of '>' with '&gt;', every occurrence of '"' with '&quot;', and every occurrence of "'" with '&#39;', call the function mark_safe with the previous result as an argument, return the result. call the function allow_lazy with 2 arguments: escape, six.text_type, substitute the result for escape.
escape = allow_lazy ( escape , six . text_type )