(data, entities={})
return data
Escape &, <, and > in a string of data.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
Escape &, <, and > in a string of data.
Escape & < and > in a string of data .
def escape(data, entities={}):
    """Escape &, <, and > in a string of data.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    """

    # must do ampersand first
    data = data.replace("&", "&amp;")
    data = data.replace(">", "&gt;")
    data = data.replace("<", "&lt;")
    if entities:
        data = __dict_replace(data, entities)
    return data
def escape ( data , entities = { } ) : # must do ampersand first data = data . replace ( "&" , "&amp;" ) data = data . replace ( ">" , "&gt;" ) data = data . replace ( "<" , "&lt;" ) if entities : data = __dict_replace ( data , entities ) return data