parameters: (text, escape_quotes = False)
return_statement: return out
docstring: Returns 'text' with <, > and & (and optionally ") escaped to named HTML
    entities.  Any existing named entity or HTML entity defined by decimal or
    hex code will be left untouched.  This is appropriate for escaping text for
    inclusion in HTML, but not for XML.
docstring_summary: Returns 'text' with <, > and & (and optionally ") escaped to named HTML
    entities.  Any existing named entity or HTML entity defined by decimal or
    hex code will be left untouched.  This is appropriate for escaping text for
    inclusion in HTML, but not for XML.
docstring_tokens: Returns text with < > and & ( and optionally ) escaped to named HTML entities . Any existing named entity or HTML entity defined by decimal or hex code will be left untouched . This is appropriate for escaping text for inclusion in HTML but not for XML .
function: def EscapeHtml(text, escape_quotes = False):
    '''Returns 'text' with <, > and & (and optionally ") escaped to named HTML
    entities.  Any existing named entity or HTML entity defined by decimal or
    hex code will be left untouched.  This is appropriate for escaping text for
    inclusion in HTML, but not for XML.
    '''
    def Replace(match):
      if match.group() == '&': return '&amp;'
      elif match.group() == '<': return '&lt;'
      elif match.group() == '>': return '&gt;'
      elif match.group() == '"':
        if escape_quotes: return '&quot;'
        else: return match.group()
      else: assert False
    out = _HTML_CHARS_TO_ESCAPE.sub(Replace, text)
    return out
function_tokens: def EscapeHtml ( text , escape_quotes = False ) : def Replace ( match ) : if match . group ( ) == '&' : return '&amp;' elif match . group ( ) == '<' : return '&lt;' elif match . group ( ) == '>' : return '&gt;' elif match . group ( ) == '"' : if escape_quotes : return '&quot;' else : return match . group ( ) else : assert False out = _HTML_CHARS_TO_ESCAPE . sub ( Replace , text ) return out