Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore ListLoad Str FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Call NameLoad NameLoad keyword NameLoad attr Str Str decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str ListLoad Str Str ListLoad Str Str ListLoad Str NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListComp NameLoad comprehension NameStore NameLoad CompareNotEq SubscriptLoad NameLoad Index Num Str Assign AttributeStore NameLoad attr ListComp SubscriptLoad NameLoad Slice Num comprehension NameStore NameLoad CompareEq SubscriptLoad NameLoad Index Num Str AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Str Str Str Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd NameLoad UnaryOpNot AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If AttributeLoad NameLoad attr body Return orelse If BoolOpAnd CompareLt Call NameLoad NameLoad Num Call AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr BinOpMod Str NameLoad orelse AugAssignAdd AttributeStore NameLoad attr Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If AttributeLoad NameLoad attr body Return orelse If CompareIn NameLoad NameLoad body AugAssignAdd AttributeStore NameLoad attr BinOpMod Str NameLoad orelse AugAssignAdd AttributeStore NameLoad attr Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If AttributeLoad NameLoad attr body Return orelse If NameLoad body AugAssignAdd AttributeStore NameLoad attr Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If CompareNotIn NameLoad AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad orelse AugAssignAdd AttributeStore NameLoad attr Call NameLoad BinOpMod Str NameLoad orelse Assign NameStore BinOpAdd Str NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr ListComp NameLoad comprehension NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad BoolOpAnd CompareIn NameLoad NameLoad CompareGt Call NameLoad SubscriptLoad NameLoad Index NameLoad Num For NameStore AttributeLoad NameLoad attr body If CompareIn NameLoad ListLoad Str Str Str body If Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad body AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad orelse AugAssignAdd NameStore BinOpMod Str TupleLoad Call NameLoad NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Return If CompareIn NameLoad AttributeLoad NameLoad attr body AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpMod Str NameLoad If CompareNotIn NameLoad AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad orelse AugAssignAdd AttributeStore NameLoad attr Call NameLoad NameLoad orelse If CompareIn NameLoad AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Return BoolOpOr BoolOpAnd CompareIn SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr CompareIn Str SubscriptLoad NameLoad Index Num BoolOpAnd CompareIn SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr CompareIn Str SubscriptLoad NameLoad Index Num BoolOpAnd CompareEq SubscriptLoad NameLoad Index Num Str Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str NameLoad BinOpMod Str NameLoad If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body If CompareNotIn NameLoad AttributeLoad NameLoad attr body AugAssignAdd AttributeStore NameLoad attr BinOpMod Str NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str For NameStore Call NameLoad AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpAdd Str NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body For NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad AugAssignAdd NameStore Str Return Call NameLoad Call AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Dict Str Str Str Str ListLoad Str Str ListLoad Str Str ListLoad Str ListLoad Str NameLoad body If UnaryOpNot Call NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad Return Call AttributeLoad Call NameLoad keyword NameLoad keyword NameLoad attr NameLoad NameLoad decorator_list
N/A N/A 
::

    # from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496942
    # Title: Cross-site scripting (XSS) defense
    # Submitter: Josh Goldfoot (other recipes)
    # Last Updated: 2006/08/05
    # Version no: 1.0

 htmllib HTMLParser cgi escape urlparse urlparse formatter AbstractFormatter htmlentitydefs entitydefs xml.sax.saxutils quoteattr N/A __all__ N/A sanitize xssescape N/A N/A text N/A N/A N/A Gets rid of < and > and & and, for good measure, : N/A N/A N/A N/A escape text quote True replace : &#58; N/A XssCleaner N/A HTMLParser N/A __init__ N/A N/A self permitted_tags allowed_attributes fmt strip_disallowed N/A N/A a b blockquote br/ i li ol ul p cite code pre img/ N/A a img blockquote N/A href title N/A src alt N/A type AbstractFormatter False N/A N/A N/A N/A HTMLParser __init__ self fmt N/A N/A self result N/A N/A self open_tags N/A N/A N/A self permitted_tags N/A i N/A i permitted_tags N/A N/A i N/A -1 / N/A N/A self requires_no_close N/A N/A i N/A -1 N/A i permitted_tags N/A N/A i N/A -1 / N/A N/A self permitted_tags N/A self requires_no_close N/A N/A self allowed_attributes allowed_attributes N/A N/A self allowed_schemes N/A http https ftp mailto N/A N/A self strip_disallowed strip_disallowed N/A N/A self in_disallowed False N/A handle_data N/A N/A self data N/A N/A N/A N/A data N/A N/A self in_disallowed N/A N/A N/A self result N/A xssescape data N/A handle_charref N/A N/A self ref N/A N/A N/A N/A self in_disallowed N/A N/A N/A N/A N/A N/A N/A len ref 7 N/A N/A ref isdigit N/A N/A N/A self result N/A &#%s; ref N/A N/A N/A self result N/A xssescape N/A &#%s ref N/A handle_entityref N/A N/A self ref N/A N/A N/A N/A self in_disallowed N/A N/A N/A N/A N/A ref entitydefs N/A N/A N/A self result N/A &%s; ref N/A N/A N/A self result N/A xssescape N/A &%s ref N/A handle_comment N/A N/A self comment N/A N/A N/A N/A self in_disallowed N/A N/A N/A N/A comment N/A N/A N/A self result N/A xssescape N/A <!--%s--> comment N/A handle_starttag N/A N/A self tag method attrs N/A N/A N/A N/A tag N/A self permitted_tags N/A N/A N/A self strip_disallowed N/A N/A N/A self in_disallowed True N/A N/A N/A self result N/A xssescape N/A <%s> tag N/A N/A bt N/A < tag N/A N/A tag N/A self allowed_attributes N/A N/A attrs N/A dict attrs N/A N/A self allowed_attributes_here N/A x N/A x N/A N/A self allowed_attributes N/A tag N/A N/A x attrs N/A N/A len N/A attrs N/A x 0 N/A attribute N/A self allowed_attributes_here N/A N/A N/A attribute N/A href src background N/A N/A N/A N/A self url_is_acceptable N/A attrs N/A attribute N/A N/A bt N/A  %s="%s" N/A attribute N/A attrs N/A attribute N/A N/A bt N/A  %s=%s N/A N/A xssescape attribute N/A quoteattr N/A attrs N/A attribute N/A N/A N/A bt <a N/A bt <img N/A N/A N/A N/A tag N/A self requires_no_close N/A N/A bt  / N/A bt > N/A N/A self result bt N/A N/A N/A N/A self open_tags insert 0 tag N/A handle_endtag N/A N/A self tag attrs N/A N/A N/A bracketed N/A </%s> tag N/A N/A tag N/A self permitted_tags N/A N/A N/A self strip_disallowed N/A N/A N/A self in_disallowed False N/A N/A N/A self result N/A xssescape bracketed N/A N/A N/A tag N/A self open_tags N/A N/A N/A self result bracketed N/A N/A N/A N/A self open_tags remove tag N/A unknown_starttag N/A N/A self tag attributes N/A N/A N/A N/A N/A self handle_starttag tag None attributes N/A unknown_endtag N/A N/A self tag N/A N/A N/A N/A N/A self handle_endtag tag None N/A url_is_acceptable N/A N/A self url N/A N/A N/A 
        Accepts relative, absolute, and mailto urls
         N/A parsed N/A urlparse url N/A N/A N/A N/A N/A parsed N/A 0 N/A self allowed_schemes N/A . N/A parsed N/A 1 N/A N/A N/A parsed N/A 0 N/A self allowed_schemes N/A @ N/A parsed N/A 2 N/A N/A N/A parsed N/A 0 N/A N/A N/A parsed N/A 2 startswith / N/A strip N/A N/A self rawstring escape N/A True N/A N/A 
        Returns the argument stripped of potentially harmful
        HTML or Javascript code

        @type escape: boolean
        @param escape: If True (default) it escapes the potentially harmful
          content, otherwise remove it
         N/A N/A N/A isinstance rawstring str N/A N/A N/A str rawstring N/A tag N/A self requires_no_close N/A N/A rawstring N/A N/A rawstring replace N/A <%s/> tag N/A <%s /> tag N/A N/A escape N/A N/A N/A self strip_disallowed True N/A N/A self result N/A N/A N/A self feed rawstring N/A endtag N/A self open_tags N/A N/A N/A endtag N/A self requires_no_close N/A N/A N/A self result N/A </%s> endtag N/A N/A self result N/A xtags N/A N/A self N/A N/A N/A 
        Returns a printable string informing the user which tags are allowed
         N/A tg N/A x N/A sorted N/A self permitted_tags N/A N/A tg N/A < x N/A N/A x N/A self allowed_attributes N/A N/A y N/A N/A self allowed_attributes N/A x N/A N/A tg N/A  %s="" y N/A tg >  N/A N/A xssescape N/A N/A tg strip N/A N/A sanitize N/A N/A text permitted_tags allowed_attributes escape N/A N/A a b blockquote br/ i li ol ul p cite code pre img/ h1 h2 h3 h4 h5 h6 table tbody thead tfoot tr td div strong span N/A a img blockquote td N/A href title N/A src alt N/A type N/A colspan True N/A N/A N/A N/A isinstance text basestring N/A N/A N/A str text N/A N/A N/A N/A XssCleaner permitted_tags permitted_tags allowed_attributes allowed_attributes strip text escape N/A