Module Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Import alias Import alias Import alias Import alias Import alias TryExcept body Import alias identifier handlers ExceptHandler body Import alias identifier Import alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias TryExcept body Import alias handlers ExceptHandler type NameLoad body TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Print Str Import alias If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr Str body Assign AttributeStore AttributeLoad NameLoad attr attr Num Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Num Str Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad body If CompareGt NameLoad Num body Raise Call NameLoad Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Raise Call NameLoad BinOpAdd Str Call NameLoad NameLoad If BoolOpAnd CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Str Num CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Str Num body Raise Call NameLoad BinOpAdd BinOpAdd BinOpAdd Str SubscriptLoad AttributeLoad NameLoad attr Index Str Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Return BinOpAdd ListComp TupleLoad TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str comprehension NameStore AttributeLoad NameLoad attr ListComp TupleLoad TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str comprehension NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad BinOpAdd Str Call NameLoad NameLoad ExceptHandler type AttributeLoad NameLoad attr name NameStore body Raise Call NameLoad BinOpAdd Str Call NameLoad NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Str attr BinOpMult ListLoad Str Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str Dict Str Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str Dict Str Str BinOpMod Str NameLoad Str AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str Str Assign NameStore Dict 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 Str Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore NameLoad Assign NameStore Str Assign NameStore Str Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore TupleLoad Str Str Str Str Str Str Str Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad Num body Expr Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad attr If CompareEq NameLoad Str body Assign NameStore Str orelse If CompareEq NameLoad Str body Expr CompareEq NameLoad Str Return TupleLoad NameLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad Num body Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad NameLoad NameLoad If BoolOpAnd UnaryOpNot NameLoad NameLoad body Assign AttributeStore NameLoad attr BinOpAdd Str NameLoad Assign AttributeStore NameLoad attr Str orelse Assign AttributeStore NameLoad attr Str Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareGt NameLoad Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad If CompareEq Call AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr ListLoad Assign NameStore NameLoad orelse If CompareEq Call AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr ListLoad Assign NameStore NameLoad orelse TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body If AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore NameLoad orelse Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad Str attr Call NameLoad Call AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Str attr Assign AttributeStore NameLoad attr Num orelse Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For NameStore TupleLoad Str Str Str body Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr For NameStore TupleLoad Str Str Str body Assign SubscriptStore NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr Str orelse If CompareIn AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore BinOpAdd Str AttributeLoad NameLoad attr For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad Break orelse Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Index Num body Return TupleLoad Str Num Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict TryExcept body Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad If BoolOpAnd AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Num If AttributeLoad NameLoad attr body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Raise AttributeLoad NameLoad attr Return NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Return TupleLoad Str Num BinOpAdd Str Call NameLoad NameLoad ExceptHandler type NameLoad name NameStore body If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Return TupleLoad Str Num BinOpAdd Str Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If CompareGt NameLoad NameLoad body If AttributeLoad NameLoad attr body Raise Call NameLoad Str Raise Call NameLoad Str TryExcept body TryFinally body Assign TupleStore NameStore AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad finalbody Assign AttributeStore NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Return TupleLoad Str Num BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body If AttributeLoad NameLoad attr body Raise Call NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body TryExcept body Raise Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num body Raise Call NameLoad Str NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num If NameLoad body Assign NameStore SubscriptLoad NameLoad Slice Num orelse Assign NameStore Str If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad If BoolOpAnd CompareEq NameLoad Str Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Str If CompareIn NameLoad TupleLoad Str Str body If CompareIs NameLoad NameLoad body Assign NameStore Num orelse If CompareGt NameLoad Num body Raise Call NameLoad Str NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Num orelse If CompareGt NameLoad Num body Raise Call NameLoad Str NameLoad If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameLoad orelse If BoolOpOr CompareEq NameLoad Str Call AttributeLoad NameLoad attr NameLoad body If CompareNotEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign TupleStore NameStore NameStore TupleLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Num orelse If CompareGt NameLoad Num body Raise Call NameLoad Str NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str NameLoad orelse If CompareEq NameLoad Str body If CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Num orelse If CompareGt NameLoad Num body Raise Call NameLoad Str NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str NameLoad orelse If BoolOpOr CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad body If CompareIn NameLoad NameLoad body Raise Call NameLoad Str NameLoad Assign NameStore AttributeLoad NameLoad attr If CompareIn NameLoad TupleLoad Str Str Str Str Str body If BoolOpAnd CompareEq NameLoad Str UnaryOpNot NameLoad body Raise Call NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Str NameLoad If CompareEq NameLoad Str body If CompareEq NameLoad AttributeLoad NameLoad attr body If CompareNotEq NameLoad Str body Raise Call NameLoad Str NameLoad Raise Call NameLoad Str NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad If BoolOpAnd CompareEq NameLoad Str Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Str NameLoad If CompareIn NameLoad NameLoad body Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad If CompareIn SubscriptLoad NameLoad Slice Num NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return TupleLoad Str Num SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str body If CompareGt AttributeLoad NameLoad attr Num body Raise Call NameLoad Str AttributeLoad NameLoad attr Return TupleLoad Str Num SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Str Assign NameStore ListLoad Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice Num If CompareNotEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Continue Assign TupleStore NameStore NameStore NameLoad If CompareIn NameLoad NameLoad body If CompareEq NameLoad Str body Raise Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Str body If UnaryOpNot NameLoad body Raise Call NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Pass orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Str NameLoad orelse If CompareEq NameLoad Str body If CompareGt AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If CompareEq NameLoad Str body If UnaryOpNot NameLoad body For NameStore Call AttributeLoad NameLoad attr Str body If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num For TupleStore NameStore NameStore NameStore NameStore NameStore NameLoad body If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpAdd NameLoad Num If CompareEq NameLoad Str body Break If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad NameLoad Assign NameStore Str Continue orelse If CompareEq NameLoad Str body Break orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr TryExcept body If CompareGt Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str Num body Break handlers ExceptHandler type NameLoad body Pass orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad body Break orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad body Break orelse If CompareEq NameLoad Str body If CompareEq AttributeLoad NameLoad attr Str body TryExcept body If Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad body Break handlers ExceptHandler type AttributeLoad NameLoad attr body Raise Call NameLoad Str NameLoad orelse If CompareEq NameLoad Str body If CompareEq AttributeLoad NameLoad attr Str body TryExcept body If Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad body Break handlers ExceptHandler type AttributeLoad NameLoad attr body Raise Call NameLoad Str NameLoad orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr If Call NameLoad Call AttributeLoad NameLoad attr NameLoad body Break orelse If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Str NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Dict Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore NameLoad If UnaryOpNot NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareEq NameLoad Str body Return TupleLoad NameLoad Num SubscriptLoad NameLoad Index NameLoad orelse Return TupleLoad NameLoad Num SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr BinOpAdd AttributeLoad NameLoad attr Num If CompareGt AttributeLoad NameLoad attr BinOpMult NameLoad Num body Raise Call NameLoad BinOpMod Str BinOpMult NameLoad Num If CompareGt AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Return Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num keyword NameLoad handlers ExceptHandler type NameLoad body If CompareGt AttributeLoad NameLoad attr Num body Raise Pass orelse If CompareGt AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListLoad Str Str Str Str Assign NameStore Num Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Str If CompareNotEq NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Assign NameStore NameLoad If CompareGt Call NameLoad NameLoad Num body If CompareEq SubscriptLoad NameLoad Index Num Str body For NameStore NameLoad body If CompareEq SubscriptLoad NameLoad Index Num NameLoad body Assign NameStore NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Str NameLoad Break For NameStore Call AttributeLoad NameLoad attr NameLoad body AugAssignAdd NameStore SubscriptLoad NameLoad Slice NameLoad Call AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If CompareEq NameLoad Str body AugAssignAdd NameStore Str orelse If CompareEq NameLoad Str body AugAssignAdd NameStore Str orelse If CompareEq NameLoad Str body AugAssignAdd NameStore Str orelse Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr orelse If BoolOpAnd CompareIn NameLoad Str NameLoad body Raise Call NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If NameLoad body If CompareEq NameLoad NameLoad body Raise Call NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Slice Num Num Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad SubscriptLoad NameLoad Index Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr AugAssignAdd NameStore SubscriptLoad NameLoad Slice NameLoad If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Slice Num If CompareNotEq Call AttributeLoad NameLoad attr Str Num body If CompareGt Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd Call AttributeLoad NameLoad attr Str Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore Call AttributeLoad NameLoad attr Str body If BoolOpOr UnaryOpNot NameLoad CompareGt Call NameLoad NameLoad Num body Return NameLoad Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad Num body Raise Call NameLoad Str If BoolOpAnd CompareEq Call NameLoad NameLoad Num CompareLt AttributeLoad NameLoad attr Num body Return Call NameLoad SubscriptLoad NameLoad Index Num If CompareGt AttributeLoad NameLoad attr Num body TryExcept body Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr NameLoad Str Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body If CompareGt AttributeLoad NameLoad attr Num body Raise Call NameLoad NameLoad Assign NameStore ListLoad If CompareGt Call NameLoad NameLoad Num body Raise Call NameLoad Str If CompareEq Call NameLoad NameLoad Num body If BoolOpAnd CompareGt AttributeLoad NameLoad attr Num CompareEq Call NameLoad NameLoad Num CompareNotEq SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num body Raise Call NameLoad Str Return Call NameLoad SubscriptLoad NameLoad Index Num If CompareEq Call NameLoad NameLoad Num body Return Call NameLoad SubscriptLoad NameLoad Index Num If NameLoad body Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad Str NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Return Call NameLoad SubscriptLoad NameLoad Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str If NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Assign NameStore ListComp Call AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num attr NameLoad comprehension NameStore NameLoad If Call NameLoad SubscriptLoad NameLoad Index Num NameLoad body Return NameLoad Return ListComp Call AttributeLoad NameLoad attr Str comprehension NameStore NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Return ListLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str If AttributeLoad NameLoad attr body Assign NameStore NameLoad If CompareGt AttributeLoad NameLoad attr Num body If CompareGt Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad If CompareEq Call NameLoad NameLoad Num body Raise Call NameLoad Str NameLoad orelse Assign NameStore BinOpMult NameLoad Num Expr Call AttributeLoad NameLoad attr Return ListComp NameLoad comprehension NameStore SubscriptLoad NameLoad Slice NameLoad comprehension NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str If UnaryOpNot NameLoad body Return ListLoad If CompareGt AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad NameLoad orelse Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If BoolOpAnd CompareEq NameLoad Str CompareIs NameLoad NameLoad body Return ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore NameLoad If CompareGt AttributeLoad NameLoad attr Num body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad NameLoad body Assign NameStore BinOpMod Str NameLoad Raise Call NameLoad NameLoad AttributeLoad NameLoad attr orelse If CompareEq Call NameLoad NameLoad Num body Raise Call NameLoad Str AttributeLoad NameLoad attr handlers ExceptHandler body Raise Call NameLoad Str AttributeLoad NameLoad attr orelse Assign NameStore BinOpMult NameLoad Num Assign NameStore AttributeLoad NameLoad attr Return ListComp NameLoad comprehension NameStore SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Slice NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Str decorator_list Assign NameStore Dict TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Slice Num If UnaryOpNot Call NameLoad Lambda arguments args NameParam NameParam defaults BoolOpAnd NameLoad CompareLtLt Num Call NameLoad NameLoad Num Call AttributeLoad NameLoad attr Str NameLoad body Return ListLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad ListLoad If NameLoad body Return NameLoad Assign NameStore TupleLoad NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Assign NameStore SubscriptLoad NameLoad Index Num orelse Assign NameStore AttributeLoad NameLoad attr If CompareLt AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If BoolOpAnd CompareLt AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareGt AttributeLoad NameLoad attr Num body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr NameLoad body If CompareEq NameLoad NameLoad body Assign NameStore NameLoad If BoolOpOr CompareEq SubscriptLoad NameLoad Index Num Str CompareIn TupleLoad NameLoad SubscriptLoad NameLoad Index Num NameLoad body Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ListLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad ListLoad If CompareGt AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr BinOpSub AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd UnaryOpNot NameLoad NameLoad body If UnaryOpNot NameLoad body Assign NameStore Dict orelse If CompareGtE Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad If CompareIn NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str TryExcept body For NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad If Call NameLoad AttributeLoad NameLoad attr NameLoad body If Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad orelse If CompareLt NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body For NameStore ListComp Call AttributeLoad NameLoad attr NameLoad keyword NameLoad comprehension NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad If Call NameLoad AttributeLoad NameLoad attr NameLoad body If Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad orelse If CompareLt NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Import alias Assign NameStore Call AttributeLoad Str attr GeneratorExp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr Str body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If CompareEq AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str body Assign AttributeStore NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Assign AttributeStore NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr If CompareEq AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str body Assign AttributeStore NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Return decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Assign AttributeStore NameLoad attr NameLoad If CompareLt Call NameLoad NameLoad Num body Return Str Assign NameStore SubscriptLoad NameLoad Index Num If Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareLt NameLoad Num body Return AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Slice Num NameLoad Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str BinOpAdd Str NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr keyword Str body If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad orelse If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Slice Num NameLoad Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr Str body Return Call AttributeLoad NameLoad attr NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str NameLoad kwarg body Expr Str If CompareEq NameLoad Str body If UnaryOpNot NameLoad body Raise Call NameLoad Str Import alias If UnaryOpNot NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index NameLoad If BoolOpAnd CompareEq NameLoad Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore BinOpMod Str TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad BinOpMod Str TupleLoad NameLoad NameLoad If CompareEq NameLoad Str body For NameStore TupleLoad Str Str Str Str Str Str body Assign NameStore SubscriptLoad Call NameLoad Index NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Str Str NameLoad For TupleStore NameStore NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr body If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Str Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Str NameLoad Return Call AttributeLoad Str attr NameLoad orelse If CompareEq NameLoad Str body If NameLoad body Return Call NameLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword ListLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad orelse Return Call NameLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword ListLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad orelse Raise Call NameLoad Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Return BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Return BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Str body Return BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Return BinOpMod Str NameLoad orelse If CompareEq NameLoad Str body Return BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Raise Call NameLoad BinOpAdd Str NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return TupleLoad Str NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str Num If CompareEq SubscriptLoad NameLoad Index Num Str body Assign SubscriptStore NameLoad Index Num Str If CompareEq Call NameLoad NameLoad Num body Return Call NameLoad NameLoad orelse Return TupleLoad Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr CompareIs NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad body Return NameLoad Return BinOpAdd BinOpAdd Str Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Str attr Str Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Num If CompareLt Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad Return TupleLoad Call AttributeLoad SubscriptLoad NameLoad Index Num attr SubscriptLoad NameLoad Index Num NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareEq NameLoad NameLoad Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If UnaryOpNot NameLoad body Return NameLoad Assign TupleStore NameStore NameStore NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Slice Num Num If UnaryOpNot NameLoad body Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr If NameLoad body Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd BinOpMult UnaryOpUSub Call NameLoad NameLoad Num Num Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign TupleStore NameStore NameStore TupleLoad ListLoad Str For NameStore NameLoad body If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad orelse AugAssignAdd NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot NameLoad body Return NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Slice Num If NameLoad body Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Slice NameLoad NameLoad ListLoad NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr NameLoad Break orelse Return NameLoad Return BinOpAdd Str NameLoad decorator_list If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Call NameLoad NameLoad decorator_list orelse FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Import alias alias Return Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call AttributeLoad NameLoad attr If CompareEq NameLoad Str body Import alias TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Str ListLoad Str Str handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Print Call NameLoad NameLoad Print NameLoad Expr Call AttributeLoad NameLoad attr Num Assign NameStore NameLoad For TupleStore NameStore NameStore NameLoad body If CompareIn NameLoad TupleLoad Str Str body Assign NameStore NameLoad orelse If CompareIn NameLoad TupleLoad Str Str body Print NameLoad If CompareEq Call NameLoad NameLoad Num body Print NameLoad Expr Call NameLoad orelse If CompareEq Call NameLoad NameLoad Num body TryExcept body Assign NameStore Call NameLoad keyword Str keyword Str keyword Str keyword Call AttributeLoad NameLoad attr Print Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num handlers ExceptHandler type NameLoad name NameStore body Print TupleLoad Str NameLoad ExceptHandler type NameLoad name NameStore body Print TupleLoad Str NameLoad orelse If CompareEq Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore NameStore NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr keyword NameLoad Print TupleLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Print AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad NameLoad attr body For NameStore AttributeLoad NameLoad attr body Print NameLoad orelse If CompareEq Call NameLoad NameLoad Num body Assign TupleStore NameStore NameStore NameStore SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Print TupleLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Print AttributeLoad AttributeLoad NameLoad attr attr orelse Print NameLoad
N/A N/A SPF (Sender Policy Framework) implementation.

Copyright (c) 2003 Terence Way <terry@wayforward.net>
Portions Copyright(c) 2004,2005,2006,2007,2008,2011,2012 Stuart Gathman <stuart@bmsi.com>
Portions Copyright(c) 2005,2006,2007,2008,2011,2012,2013 Scott Kitterman <scott@kitterman.com>
Portions Copyright(c) 2013 Stuart Gathman <stuart@gathman.org>

This module is free software, and you may redistribute it and/or modify
it under the same terms as Python itself, so long as this copyright message
and disclaimer are retained in their original form.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

For more information about SPF, a tool against email forgery, see
    http://www.openspf.net/

For news, bugfixes, etc. visit the home page for this implementation at
    http://cheeseshop.python.org/pypi/pyspf/
    http://sourceforge.net/projects/pymilter/
    http://www.wayforward.net/spf/
 N/A __author__ Terence Way, Stuart Gathman, Scott Kitterman N/A __email__ pyspf@openspf.org N/A __version__ 2.0.8: Jul 22, 2013 N/A MODULE spf N/A USAGE To check an incoming mail request:
    % python spf.py [-v] {ip} {sender} {helo}
    % python spf.py 69.55.226.139 tway@optsw.com mx1.wayforward.net

To test an SPF record:
    % python spf.py [-v] "v=spf1..." {ip} {sender} {helo}
    % python spf.py "v=spf1 +mx +ip4:10.0.0.1 -all" 10.0.0.1 tway@foo.com a    

To fetch an SPF record:
    % python spf.py {domain}
    % python spf.py wayforward.net

To test this script (and to output this usage message):
    % python spf.py
 N/A re N/A sys N/A socket N/A struct N/A time N/A N/A N/A urllib.parse urllibparse N/A N/A N/A N/A urllib urllibparse N/A sys functools reduce N/A N/A email.message Message N/A N/A N/A ImportError N/A email.Message Message N/A N/A N/A ipaddress N/A N/A N/A ImportError N/A N/A N/A N/A ipaddr ipaddress N/A N/A N/A ImportError N/A N/A ipaddr module required: http://code.google.com/p/ipaddr-py/ N/A DNS N/A N/A N/A hasattr N/A DNS Type SPF N/A N/A N/A N/A DNS Type SPF 99 N/A N/A N/A N/A DNS Type typemap N/A 99 SPF N/A N/A N/A N/A DNS Lib RRunpacker getSPFdata N/A N/A N/A DNS Lib RRunpacker getTXTdata DNSLookup N/A N/A name qtype strict timeout N/A True 30 N/A N/A N/A N/A req N/A N/A DNS DnsRequest name qtype qtype timeout timeout N/A resp N/A N/A req req N/A N/A N/A N/A resp header N/A tc True N/A N/A N/A strict 1 N/A N/A N/A AmbiguityWarning DNS: Truncated UDP Reply, SPF records should fit in a UDP packet, retrying TCP N/A N/A N/A req N/A N/A DNS DnsRequest name qtype qtype protocol tcp timeout timeout N/A resp N/A N/A req req N/A N/A N/A N/A DNS DNSError N/A x N/A N/A N/A TempError N/A DNS: TCP Fallback error:  N/A str x N/A N/A N/A N/A N/A resp header N/A rcode 0 N/A N/A N/A resp header N/A rcode 3 N/A N/A N/A IOError N/A N/A N/A Error:  N/A N/A resp header N/A status   RCODE:  N/A str N/A N/A resp header N/A rcode N/A N/A N/A N/A N/A N/A a N/A name N/A a N/A typename N/A a N/A data N/A a N/A resp answers N/A N/A N/A N/A a N/A name N/A a N/A typename N/A a N/A data N/A a N/A resp additional N/A N/A N/A IOError N/A x N/A N/A N/A TempError N/A DNS  N/A str x N/A N/A N/A DNS DNSError N/A x N/A N/A N/A TempError N/A DNS  N/A str x N/A N/A RE_SPF N/A N/A re compile ^v=spf1$|^v=spf1  N/A re IGNORECASE N/A RE_MODIFIER N/A N/A re compile ^([a-z][a-z0-9_\-\.]*)= N/A re IGNORECASE N/A PAT_CHAR %(%|_|-|(\{[^\}]*\})) N/A RE_CHAR N/A N/A re compile PAT_CHAR N/A RE_ARGS N/A N/A re compile ([0-9]*)(r?)([^0-9a-zA-Z]*) N/A RE_DUAL_CIDR N/A N/A re compile //(0|[1-9]\d*)$ N/A RE_CIDR N/A N/A re compile /(0|[1-9]\d*)$ N/A PAT_IP4 N/A N/A \. join N/A N/A (?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]) 4 N/A RE_IP4 N/A N/A re compile N/A PAT_IP4 $ N/A RE_TOPLAB N/A N/A re compile N/A \.(?:[0-9a-z]*[a-z][0-9a-z]*|[0-9a-z]+-[0-9a-z-]*[0-9a-z])\.?$|%s PAT_CHAR N/A re IGNORECASE N/A RE_DOT_ATOM N/A N/A re compile N/A %(atext)s+([.]%(atext)s+)*$ N/A atext [0-9a-z!#$%&'*+/=?^_`{}|~-] N/A re IGNORECASE N/A RE_IP6 N/A N/A re compile N/A (?:%(hex4)s:){6}%(ls32)s$|::(?:%(hex4)s:){5}%(ls32)s$|(?:%(hex4)s)?::(?:%(hex4)s:){4}%(ls32)s$|(?:(?:%(hex4)s:){0,1}%(hex4)s)?::(?:%(hex4)s:){3}%(ls32)s$|(?:(?:%(hex4)s:){0,2}%(hex4)s)?::(?:%(hex4)s:){2}%(ls32)s$|(?:(?:%(hex4)s:){0,3}%(hex4)s)?::%(hex4)s:%(ls32)s$|(?:(?:%(hex4)s:){0,4}%(hex4)s)?::%(ls32)s$|(?:(?:%(hex4)s:){0,5}%(hex4)s)?::%(hex4)s$|(?:(?:%(hex4)s:){0,6}%(hex4)s)?::$ N/A ls32 hex4 N/A (?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|%s) PAT_IP4 [0-9a-f]{1,4} N/A re IGNORECASE N/A JOINERS N/A l s . . N/A RESULTS N/A + - ? ~ pass fail permerror error neutral softfail none local trusted ambiguous unknown pass fail neutral softfail pass fail permerror temperror neutral softfail none local trusted ambiguous permerror N/A EXPLANATIONS N/A pass fail permerror temperror softfail neutral none local trusted ambiguous sender SPF authorized SPF fail - not authorized permanent error in processing temporary DNS error in processing domain owner discourages use of this host access neither permitted nor denied No SPF result due to local policy No SPF check - trusted-forwarder.org No error, but results may vary N/A DELEGATE None N/A DEFAULT_SPF v=spf1 a/24 mx/24 ptr N/A TRUSTED_FORWARDERS v=spf1 ?include:spf.trusted-forwarder.org -all N/A MAX_LOOKUP 10 N/A MAX_MX 10 N/A MAX_PTR 10 N/A MAX_CNAME 10 N/A MAX_RECURSION 20 N/A MAX_PER_LOOKUP_TIME 30 N/A ALL_MECHANISMS N/A a mx ptr exists include ip4 ip6 all N/A COMMON_MISTAKES N/A prt ip ipv4 ipv6 all. ptr ip4 ip4 ip6 all AmbiguityWarning N/A Exception N/A N/A SPF Warning - ambiguous results __init__ N/A N/A self msg mech ext N/A None None N/A N/A N/A N/A Exception __init__ self msg mech N/A N/A self msg msg N/A N/A self mech mech N/A N/A self ext ext N/A __str__ N/A N/A self N/A N/A N/A N/A self mech N/A N/A N/A %s: %s N/A N/A self msg N/A self mech N/A N/A self msg N/A N/A TempError N/A Exception N/A N/A Temporary SPF error __init__ N/A N/A self msg mech ext N/A None None N/A N/A N/A N/A Exception __init__ self msg mech N/A N/A self msg msg N/A N/A self mech mech N/A N/A self ext ext N/A __str__ N/A N/A self N/A N/A N/A N/A self mech N/A N/A N/A %s: %s  N/A N/A self msg N/A self mech N/A N/A self msg N/A N/A PermError N/A Exception N/A N/A Permanent SPF error __init__ N/A N/A self msg mech ext N/A None None N/A N/A N/A N/A Exception __init__ self msg mech N/A N/A self msg msg N/A N/A self mech mech N/A N/A self ext ext N/A __str__ N/A N/A self N/A N/A N/A N/A self mech N/A N/A N/A %s: %s N/A N/A self msg N/A self mech N/A N/A self msg N/A N/A check2 N/A N/A i s h local receiver timeout verbose querytime N/A None None MAX_PER_LOOKUP_TIME False 0 N/A N/A Test an incoming MAIL FROM:<s>, from a client with ip address i.
    h is the HELO/EHLO domain name.  This is the RFC4408 compliant pySPF2.0
    interface.  The interface returns an SPF result and explanation only.
    SMTP response codes are not returned since RFC 4408 does not specify
    receiver policy.  Applications updated for RFC 4408 should use this
    interface.  The maximum time, in seconds, this function is allowed to run
    before a TempError is returned is controlled by querytime.  When set to 0
    (default) the timeout parameter (default 30 seconds) controls the time
    allowed for each DNS lookup.

    Returns (result, explanation) where result in
    ['pass', 'permerror', 'fail', 'temperror', 'softfail', 'none', 'neutral' ].

    Example:
    #>>> check2(i='61.51.192.42', s='liukebing@bcc.com', h='bmsi.com')

     N/A N/A res _ exp N/A N/A N/A query i i s s h h local local receiver receiver timeout timeout verbose verbose querytime querytime check N/A N/A res exp N/A check N/A N/A i s h local receiver verbose N/A None None False N/A N/A Test an incoming MAIL FROM:<s>, from a client with ip address i.
    h is the HELO/EHLO domain name.  This is the pre-RFC SPF Classic interface.
    Applications written for pySPF 1.6/1.7 can use this interface to allow
    pySPF2 to be a drop in replacement for older versions.  With the exception
    of result codes, performance in RFC 4408 compliant.

    Returns (result, code, explanation) where result in
    ['pass', 'unknown', 'fail', 'error', 'softfail', 'none', 'neutral' ].

    Example:
    #>>> check(i='61.51.192.42', s='liukebing@bcc.com', h='bmsi.com')

     N/A N/A res code exp N/A N/A N/A query i i s s h h local local receiver receiver verbose verbose check N/A N/A res permerror N/A N/A res unknown N/A N/A N/A res tempfail N/A N/A N/A res error N/A N/A res code exp N/A query N/A object N/A N/A A query object keeps the relevant information about a single SPF
    query:

    i: ip address of SMTP client in dotted notation
    s: sender declared in MAIL FROM:<>
    l: local part of sender s
    d: current domain, initially domain part of sender s
    h: EHLO/HELO domain
    v: 'in-addr' for IPv4 clients and 'ip6' for IPv6 clients
    t: current timestamp
    p: SMTP client domain name
    o: domain part of sender s
    r: receiver
    c: pretty ip address (different from i for IPv6)

    This is also, by design, the same variables used in SPF macro
    expansion.

    Also keeps cache: DNS cache.  
     __init__ N/A N/A self i s h local receiver strict timeout verbose querytime N/A None None True MAX_PER_LOOKUP_TIME False 0 N/A N/A N/A N/A self s N/A self h N/A s h N/A N/A N/A s h N/A N/A N/A self s N/A postmaster@ h N/A N/A self ident helo N/A N/A N/A self ident mailfrom N/A N/A N/A self l N/A self o N/A split_email s h N/A N/A self t N/A str N/A int N/A N/A time time N/A N/A self d N/A self o N/A N/A self p None N/A receiver N/A N/A N/A self r receiver N/A N/A N/A self r unknown N/A N/A self cache N/A N/A N/A self defexps N/A dict EXPLANATIONS N/A N/A self exps N/A dict EXPLANATIONS N/A N/A self libspf_local local N/A N/A self lookups 0 N/A N/A self strict strict N/A N/A self timeout timeout N/A N/A self querytime querytime N/A N/A querytime 0 N/A N/A N/A self timeout querytime N/A N/A self timer 0 N/A i N/A N/A N/A N/A self set_ip i N/A N/A self default_modifier True N/A N/A self verbose verbose N/A N/A self authserv None N/A log N/A N/A self mech d spf N/A N/A N/A N/A %s: %s "%s" N/A mech d spf N/A set_ip N/A N/A self i N/A N/A N/A Set connect ip, and ip6 or ip4 mode. N/A N/A self iplist False N/A N/A N/A N/A i lower list N/A N/A N/A self iplist N/A N/A ip6 False N/A N/A N/A N/A N/A i lower list6 N/A N/A N/A self iplist N/A N/A ip6 True N/A N/A N/A N/A N/A self ipaddr N/A N/A ipaddress ip_address i N/A N/A N/A AttributeError N/A N/A N/A self ipaddr N/A N/A ipaddress IPAddress i N/A N/A N/A N/A self ipaddr version 6 N/A N/A N/A N/A self ipaddr ipv4_mapped N/A N/A N/A self ipaddr N/A N/A ipaddress IPv4Address N/A N/A self ipaddr ipv4_mapped N/A ip6 False N/A N/A ip6 True N/A N/A ip6 False N/A N/A self c N/A str N/A self ipaddr N/A ip6 N/A N/A N/A self A AAAA N/A N/A self v ip6 N/A N/A self i N/A N/A . join N/A list N/A N/A N/A N/A N/A N/A self ipaddr exploded replace : upper N/A N/A self cidrmax 128 N/A N/A N/A self A A N/A N/A self v in-addr N/A N/A self i N/A N/A self ipaddr exploded N/A N/A self cidrmax 32 N/A set_default_explanation N/A N/A self exp N/A N/A N/A exps N/A self exps N/A defexps N/A self defexps N/A i N/A softfail fail permerror N/A N/A N/A exps N/A i exp N/A N/A defexps N/A i exp N/A set_explanation N/A N/A self exp N/A N/A N/A exps N/A self exps N/A i N/A softfail fail permerror N/A N/A N/A exps N/A i exp N/A getp N/A N/A self N/A N/A N/A N/A N/A self p N/A N/A p N/A N/A self validated_ptrs N/A N/A p N/A N/A N/A self p unknown N/A N/A N/A N/A self d p N/A N/A N/A self p N/A self d N/A N/A sfx N/A . N/A self d N/A d p N/A N/A N/A N/A d endswith sfx N/A N/A N/A self p d N/A N/A N/A N/A self p N/A p N/A 0 N/A N/A self p N/A best_guess N/A N/A self spf N/A DEFAULT_SPF N/A N/A Return a best guess based on a default SPF record.
    >>> q = query('1.2.3.4','','SUPERVISION1',receiver='example.com')
    >>> q.best_guess()[0]
    'none'
         N/A N/A N/A N/A RE_TOPLAB split N/A self d N/A -1 N/A N/A N/A none 250 N/A N/A N/A self check spf N/A check N/A N/A self spf N/A None N/A N/A 
    Returns (result, mta-status-code, explanation) where result
    in ['fail', 'softfail', 'neutral' 'permerror', 'pass', 'temperror', 'none']

    Examples:
    >>> q = query(s='strong-bad@email.example.com',
    ...           h='mx.example.org', i='192.0.2.3')
    >>> q.check(spf='v=spf1 ?all')
    ('neutral', 250, 'access neither permitted nor denied')

    >>> q.check(spf='v=spf1 redirect=controlledmail.com exp=_exp.controlledmail.com')
    ('fail', 550, 'SPF fail - not authorized')
    
    >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 ?all moo')
    ('permerror', 550, 'SPF Permanent Error: Unknown mechanism found: moo')

    >>> q.check(spf='v=spf1 =a ?all moo')
    ('permerror', 550, 'SPF Permanent Error: Unknown qualifier, RFC 4408 para 4.6.1, found in: =a')

    >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 ~all')
    ('pass', 250, 'sender SPF authorized')

    >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 -all moo=')
    ('pass', 250, 'sender SPF authorized')

    >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 -all match.sub-domains_9=yes')
    ('pass', 250, 'sender SPF authorized')

    >>> q.strict = False
    >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 -all moo')
    ('permerror', 550, 'SPF Permanent Error: Unknown mechanism found: moo')
    >>> q.perm_error.ext
    ('pass', 250, 'sender SPF authorized')

    >>> q.strict = True
    >>> q.check(spf='v=spf1 ip4:192.1.0.0/16 moo -all')
    ('permerror', 550, 'SPF Permanent Error: Unknown mechanism found: moo')

    >>> q.check(spf='v=spf1 ip4:192.1.0.0/16 ~all')
    ('softfail', 250, 'domain owner discourages use of this host')

    >>> q.check(spf='v=spf1 -ip4:192.1.0.0/6 ~all')
    ('fail', 550, 'SPF fail - not authorized')

    # Assumes DNS available
    >>> q.check()
    ('none', 250, '')

    >>> q.check(spf='v=spf1 ip4:1.2.3.4 -a:example.net -all')
    ('fail', 550, 'SPF fail - not authorized')
    >>> q.libspf_local='ip4:192.0.2.3 a:example.org'
    >>> q.check(spf='v=spf1 ip4:1.2.3.4 -a:example.net -all')
    ('pass', 250, 'sender SPF authorized')

    >>> q.check(spf='v=spf1 ip4:1.2.3.4 -all exp=_exp.controlledmail.com')
    ('fail', 550, 'Controlledmail.com does not send mail from itself.')
    
    >>> q.check(spf='v=spf1 ip4:1.2.3.4 ?all exp=_exp.controlledmail.com')
    ('neutral', 250, 'access neither permitted nor denied')
         N/A N/A self mech N/A N/A N/A self perm_error None N/A N/A self mechanism None N/A N/A self options N/A N/A N/A N/A N/A self lookups 0 N/A N/A self timer 0 N/A N/A spf N/A N/A spf N/A N/A self dns_spf N/A self d N/A N/A self verbose N/A N/A N/A N/A self log top N/A self d spf N/A N/A N/A self libspf_local spf N/A N/A spf N/A insert_libspf_local_policy spf N/A self libspf_local N/A rc N/A N/A self check1 spf N/A self d 0 N/A N/A self perm_error N/A N/A N/A N/A self perm_error ext rc N/A N/A self perm_error N/A rc N/A N/A N/A TempError N/A x N/A N/A N/A self prob N/A x msg N/A N/A x mech N/A N/A N/A N/A N/A self mech append N/A x mech N/A N/A temperror 451 N/A SPF Temporary Error:  N/A str x N/A N/A PermError N/A x N/A N/A N/A N/A self perm_error N/A N/A N/A self perm_error x N/A N/A self prob N/A x msg N/A N/A x mech N/A N/A N/A N/A N/A self mech append N/A x mech N/A N/A permerror 550 N/A SPF Permanent Error:  N/A str x N/A check1 N/A N/A self spf domain recursion N/A N/A N/A N/A recursion MAX_RECURSION N/A N/A N/A self strict N/A N/A N/A AssertionError Too many levels of recursion N/A N/A PermError Too many levels of recursion N/A N/A N/A N/A N/A N/A tmp N/A self d N/A N/A self d domain N/A N/A N/A self check0 spf recursion N/A N/A N/A self d tmp N/A N/A N/A AmbiguityWarning N/A x N/A N/A N/A self prob N/A x msg N/A N/A x mech N/A N/A N/A N/A N/A self mech append N/A x mech N/A N/A ambiguous 0 N/A SPF Ambiguity Warning: %s x N/A note_error N/A N/A self N/A msg N/A N/A N/A self strict N/A N/A N/A PermError msg N/A N/A N/A self perm_error N/A N/A N/A N/A N/A PermError msg N/A N/A N/A PermError N/A x N/A N/A N/A self perm_error x N/A N/A self perm_error N/A expand_domain N/A N/A self arg N/A N/A N/A validate and expand domain-spec N/A N/A N/A N/A RE_TOPLAB split arg N/A -1 N/A N/A N/A PermError Invalid domain found (use FQDN) arg N/A N/A N/A self expand arg N/A validate_mechanism N/A N/A self mech N/A N/A N/A Parse and validate a mechanism.
    Returns mech,m,arg,cidrlength,result

    Examples:
    >>> q = query(s='strong-bad@email.example.com.',
    ...           h='mx.example.org', i='192.0.2.3')
    >>> q.validate_mechanism('A')
    ('A', 'a', 'email.example.com', 32, 'pass')

    >>> q = query(s='strong-bad@email.example.com',
    ...           h='mx.example.org', i='192.0.2.3')
    >>> q.validate_mechanism('A//64')
    ('A//64', 'a', 'email.example.com', 32, 'pass')

    >>> q.validate_mechanism('A/24//64')
    ('A/24//64', 'a', 'email.example.com', 24, 'pass')
    
    >>> q.validate_mechanism('?mx:%{d}/27')
    ('?mx:%{d}/27', 'mx', 'email.example.com', 27, 'neutral')

    >>> try: q.validate_mechanism('ip4:1.2.3.4/247')
    ... except PermError as x: print(x)
    Invalid IP4 CIDR length: ip4:1.2.3.4/247
    
    >>> try: q.validate_mechanism('ip4:1.2.3.4/33')
    ... except PermError as x: print(x)
    Invalid IP4 CIDR length: ip4:1.2.3.4/33

    >>> try: q.validate_mechanism('a:example.com:8080')
    ... except PermError as x: print(x)
    Invalid domain found (use FQDN): example.com:8080
    
    >>> try: q.validate_mechanism('ip4:1.2.3.444/24')
    ... except PermError as x: print(x)
    Invalid IP4 address: ip4:1.2.3.444/24
    
    >>> try: q.validate_mechanism('ip4:1.2.03.4/24')
    ... except PermError as x: print(x)
    Invalid IP4 address: ip4:1.2.03.4/24
    
    >>> try: q.validate_mechanism('-all:3030')
    ... except PermError as x: print(x)
    Invalid all mechanism format - only qualifier allowed with all: -all:3030

    >>> q.validate_mechanism('-mx:%%%_/.Clara.de/27')
    ('-mx:%%%_/.Clara.de/27', 'mx', '% /.Clara.de', 27, 'fail')

    >>> q.validate_mechanism('~exists:%{i}.%{s1}.100/86400.rate.%{d}')
    ('~exists:%{i}.%{s1}.100/86400.rate.%{d}', 'exists', '192.0.2.3.com.100/86400.rate.email.example.com', 32, 'softfail')

    >>> q.validate_mechanism('a:mail.example.com.')
    ('a:mail.example.com.', 'a', 'mail.example.com', 32, 'pass')

    >>> try: q.validate_mechanism('a:mail.example.com,')
    ... except PermError as x: print(x)
    Do not separate mechnisms with commas: a:mail.example.com,

    >>> q = query(s='strong-bad@email.example.com',
    ...           h='mx.example.org', i='2001:db8:1234::face:b007')    
    >>> q.validate_mechanism('A//64')
    ('A//64', 'a', 'email.example.com', 64, 'pass')

    >>> q.validate_mechanism('A/16')
    ('A/16', 'a', 'email.example.com', 128, 'pass')

    >>> q.validate_mechanism('A/16//48')
    ('A/16//48', 'a', 'email.example.com', 48, 'pass')

     N/A N/A N/A mech endswith , N/A N/A N/A N/A self note_error Do not separate mechnisms with commas mech N/A mech N/A mech N/A -1 N/A N/A m arg cidrlength cidr6length N/A parse_mechanism mech N/A self d N/A m N/A N/A result N/A N/A RESULTS get N/A m N/A 0 N/A result N/A N/A m N/A m N/A 1 N/A N/A result pass N/A N/A m COMMON_MISTAKES N/A N/A N/A N/A self note_error Unknown mechanism found mech N/A m N/A COMMON_MISTAKES N/A m N/A N/A N/A m a N/A N/A RE_IP4 match arg N/A N/A x N/A N/A self note_error Use the ip4 mechanism for ip4 addresses mech N/A m ip4 N/A N/A m N/A a mx N/A N/A N/A cidrlength None N/A N/A cidrlength 32 N/A N/A N/A cidrlength 32 N/A N/A N/A PermError Invalid IP4 CIDR length mech N/A N/A cidr6length None N/A N/A cidr6length 128 N/A N/A N/A cidr6length 128 N/A N/A N/A PermError Invalid IP6 CIDR length mech N/A N/A N/A self v ip6 N/A N/A cidrlength cidr6length N/A N/A N/A N/A m ip4 N/A N/A RE_IP4 match m N/A N/A N/A m ip4 N/A N/A N/A N/A self note_error Missing IP4 mech N/A N/A m arg N/A ip4 m N/A N/A cidr6length None N/A N/A N/A PermError Dual CIDR not allowed mech N/A N/A cidrlength None N/A N/A cidrlength 32 N/A N/A N/A cidrlength 32 N/A N/A N/A PermError Invalid IP4 CIDR length mech N/A N/A N/A N/A RE_IP4 match arg N/A N/A N/A PermError Invalid IP4 address mech N/A N/A N/A m ip6 N/A N/A N/A cidr6length None N/A N/A N/A PermError Dual CIDR not allowed mech N/A N/A cidrlength None N/A N/A cidrlength 128 N/A N/A N/A cidrlength 128 N/A N/A N/A PermError Invalid IP6 CIDR length mech N/A N/A N/A N/A RE_IP6 match arg N/A N/A N/A PermError Invalid IP6 address mech N/A N/A N/A N/A cidrlength None N/A cidr6length None N/A N/A N/A m ALL_MECHANISMS N/A N/A N/A PermError CIDR not allowed mech N/A cidrlength N/A self cidrmax N/A N/A m N/A a mx ptr exists include N/A N/A N/A N/A m exists N/A arg N/A N/A N/A PermError implicit exists not allowed mech N/A arg N/A N/A self expand_domain arg N/A N/A arg N/A N/A N/A PermError empty domain: mech N/A N/A m include N/A N/A N/A arg N/A self d N/A N/A N/A mech include N/A N/A N/A PermError include has trivial recursion mech N/A N/A PermError include mechanism missing domain mech N/A N/A mech m arg cidrlength result N/A N/A N/A m all N/A N/A mech count : N/A N/A N/A N/A self note_error Invalid all mechanism format - only qualifier allowed with all mech N/A N/A m ALL_MECHANISMS N/A N/A N/A mech m arg cidrlength result N/A N/A N/A m N/A 1 ALL_MECHANISMS N/A N/A x N/A N/A self note_error Unknown qualifier, RFC 4408 para 4.6.1, found in mech N/A N/A x N/A N/A self note_error Unknown mechanism found mech N/A N/A mech m arg cidrlength x N/A check0 N/A N/A self spf recursion N/A N/A N/A Test this query information against SPF text.

        Returns (result, mta-status-code, explanation) where
        result in ['fail', 'unknown', 'pass', 'none']
         N/A N/A spf N/A N/A N/A none 250 N/A EXPLANATIONS N/A none N/A spf N/A N/A spf split N/A N/A N/A N/A N/A spf N/A 0 lower v=spf1 N/A N/A N/A N/A self strict 1 N/A N/A N/A AmbiguityWarning Invalid SPF record in N/A self d N/A N/A none 250 N/A EXPLANATIONS N/A none N/A spf N/A spf N/A 1 N/A exps N/A self exps N/A redirect None N/A default neutral N/A mechs N/A N/A modifiers N/A N/A mech spf N/A N/A m N/A N/A N/A RE_MODIFIER split mech N/A 1 N/A N/A N/A len m 2 N/A N/A N/A N/A mechs append N/A N/A self validate_mechanism mech N/A N/A N/A mod arg m N/A N/A mod modifiers N/A N/A N/A mod redirect N/A N/A N/A PermError redirect= MUST appear at most once mech N/A N/A N/A self note_error N/A %s= MUST appear at most once mod mech N/A N/A N/A modifiers append mod N/A N/A mod exp N/A N/A N/A arg N/A N/A N/A PermError exp has empty domain-spec: arg N/A arg N/A N/A self expand_domain arg N/A arg N/A N/A N/A N/A exp N/A N/A self get_explanation arg N/A N/A exp N/A recursion N/A N/A N/A N/A self set_explanation exp N/A N/A N/A N/A N/A N/A N/A mod redirect N/A N/A N/A N/A self check_lookups N/A redirect N/A N/A self expand_domain arg N/A N/A redirect N/A N/A N/A PermError redirect has empty domain: arg N/A N/A N/A mod default N/A N/A N/A N/A self strict 1 N/A N/A N/A AmbiguityWarning The default= modifier is obsolete. N/A N/A N/A N/A self strict N/A self default_modifier N/A N/A arg N/A N/A self expand arg N/A default N/A N/A RESULTS get arg default N/A N/A N/A mod op N/A N/A N/A recursion N/A N/A v N/A N/A arg split . N/A N/A v N/A N/A N/A N/A self options N/A v True N/A N/A N/A N/A self expand N/A m N/A 1 N/A N/A mech m arg cidrlength result mechs N/A N/A N/A m include N/A N/A N/A N/A self check_lookups N/A d N/A N/A self dns_spf arg N/A N/A self verbose N/A N/A N/A N/A self log include arg d N/A N/A res code txt N/A N/A self check1 d arg N/A recursion 1 N/A N/A res pass N/A N/A N/A N/A res none N/A N/A N/A N/A self note_error N/A No valid SPF record for included domain: %s arg mech N/A res neutral N/A N/A N/A N/A m all N/A N/A N/A N/A N/A m exists N/A N/A N/A N/A self check_lookups N/A N/A N/A N/A N/A len N/A N/A self dns_a arg A 0 N/A N/A N/A N/A N/A AmbiguityWarning N/A N/A N/A N/A N/A m a N/A N/A N/A N/A self check_lookups N/A N/A N/A self cidrmatch N/A N/A self dns_a arg N/A self A cidrlength N/A N/A N/A N/A N/A m mx N/A N/A N/A N/A self check_lookups N/A N/A N/A self cidrmatch N/A N/A self dns_mx arg cidrlength N/A N/A N/A N/A N/A m ip4 N/A N/A N/A N/A self v in-addr N/A N/A N/A N/A N/A N/A self cidrmatch N/A arg cidrlength N/A N/A N/A N/A N/A N/A socket error N/A N/A N/A PermError syntax error mech N/A N/A N/A m ip6 N/A N/A N/A N/A self v ip6 N/A N/A N/A N/A N/A N/A self cidrmatch N/A arg cidrlength N/A N/A N/A N/A N/A N/A socket error N/A N/A N/A PermError syntax error mech N/A N/A N/A m ptr N/A N/A N/A N/A self check_lookups N/A N/A domainmatch N/A N/A self validated_ptrs arg N/A N/A N/A N/A redirect N/A N/A redirect_record N/A N/A self dns_spf redirect N/A N/A redirect_record N/A N/A N/A PermError redirect domain has no SPF record redirect N/A N/A self verbose N/A N/A N/A N/A self log redirect redirect redirect_record N/A N/A recursion N/A N/A N/A self exps N/A dict N/A self defexps N/A N/A self options N/A N/A N/A N/A self check1 redirect_record redirect recursion N/A result default N/A mech None N/A N/A recursion N/A N/A N/A self mechanism mech N/A N/A result fail N/A N/A N/A result 550 N/A exps N/A result N/A N/A N/A result 250 N/A exps N/A result N/A check_lookups N/A N/A self N/A N/A N/A N/A self lookups N/A N/A self lookups 1 N/A N/A N/A self lookups N/A MAX_LOOKUP 4 N/A N/A N/A PermError N/A More than %d DNS lookups N/A MAX_LOOKUP 4 N/A N/A N/A self lookups MAX_LOOKUP N/A N/A N/A N/A self note_error Too many DNS lookups N/A get_explanation N/A N/A self spec N/A N/A N/A Expand an explanation. N/A spec N/A N/A N/A N/A a N/A N/A self dns_txt spec N/A N/A N/A len a 1 N/A N/A N/A str N/A N/A self expand N/A to_ascii N/A a N/A 0 stripdot False N/A N/A N/A PermError N/A N/A N/A N/A self strict 1 N/A N/A N/A N/A N/A N/A N/A self strict 1 N/A N/A N/A PermError Empty domain-spec on exp= N/A None N/A expand N/A N/A self str stripdot N/A True N/A N/A Do SPF RFC macro expansion.

        Examples:
        >>> q = query(s='strong-bad@email.example.com',
        ...           h='mx.example.org', i='192.0.2.3')
        >>> q.p = 'mx.example.org'
        >>> q.r = 'example.net'

        >>> q.expand('%{d}')
        'email.example.com'

        >>> q.expand('%{d4}')
        'email.example.com'

        >>> q.expand('%{d3}')
        'email.example.com'

        >>> q.expand('%{d2}')
        'example.com'

        >>> q.expand('%{d1}')
        'com'

        >>> q.expand('%{p}')
        'mx.example.org'

        >>> q.expand('%{p2}')
        'example.org'

        >>> q.expand('%{dr}')
        'com.example.email'
    
        >>> q.expand('%{d2r}')
        'example.email'

        >>> q.expand('%{l}')
        'strong-bad'

        >>> q.expand('%{l-}')
        'strong.bad'

        >>> q.expand('%{lr}')
        'strong-bad'

        >>> q.expand('%{lr-}')
        'bad.strong'

        >>> q.expand('%{l1r-}')
        'strong'

        >>> q.expand('%{c}',stripdot=False)
        '192.0.2.3'

        >>> q.expand('%{r}',stripdot=False)
        'example.net'

        >>> q.expand('%{ir}.%{v}._spf.%{d2}')
        '3.2.0.192.in-addr._spf.example.com'

        >>> q.expand('%{lr-}.lp._spf.%{d2}')
        'bad.strong.lp._spf.example.com'

        >>> q.expand('%{lr-}.lp.%{ir}.%{v}._spf.%{d2}')
        'bad.strong.lp.3.2.0.192.in-addr._spf.example.com'

        >>> q.expand('%{ir}.%{v}.%{l1r-}.lp._spf.%{d2}')
        '3.2.0.192.in-addr.strong.lp._spf.example.com'

        >>> try: q.expand('%(ir).%{v}.%{l1r-}.lp._spf.%{d2}')
        ... except PermError as x: print(x)
        invalid-macro-char : %(ir)

        >>> q.expand('%{p2}.trusted-domains.example.net')
        'example.org.trusted-domains.example.net'

        >>> q.expand('%{p2}.trusted-domains.example.net.')
        'example.org.trusted-domains.example.net'

        >>> q = query(s='@email.example.com',
        ...           h='mx.example.org', i='192.0.2.3')
        >>> q.p = 'mx.example.org'
        >>> q.expand('%{l}')
        'postmaster'

         N/A macro_delimiters N/A { % - _ N/A end 0 N/A result N/A macro_count N/A N/A str count % N/A N/A macro_count 0 N/A N/A labels N/A N/A str split . N/A label labels N/A N/A is_macro False N/A N/A N/A len label 1 N/A N/A N/A N/A label N/A 0 % N/A N/A delimit macro_delimiters N/A N/A N/A N/A label N/A 1 delimit N/A N/A is_macro True N/A N/A is_macro N/A N/A N/A PermError invalid-macro-char  label N/A N/A i N/A N/A RE_CHAR finditer str N/A N/A result N/A str N/A end N/A N/A i start N/A macro N/A str N/A N/A N/A i start N/A N/A i end N/A N/A macro %% N/A N/A result % N/A N/A N/A macro %_ N/A N/A result N/A N/A N/A macro %- N/A N/A result %20 N/A N/A letter N/A N/A N/A macro N/A 2 lower N/A N/A letter p N/A N/A N/A N/A self getp N/A N/A N/A N/A letter crt stripdot N/A N/A N/A PermError c,r,t macros allowed in exp= text only macro N/A expansion N/A getattr self letter self N/A expansion N/A N/A N/A expansion self N/A N/A N/A PermError Unknown Macro Encountered macro N/A e N/A expand_one expansion N/A macro N/A 3 -1 N/A N/A JOINERS get letter N/A N/A letter N/A macro N/A 2 N/A N/A e N/A N/A urllibparse quote e N/A result e N/A end N/A N/A i end N/A result N/A str N/A end N/A N/A stripdot N/A N/A result endswith . N/A N/A result N/A result N/A -1 N/A N/A N/A N/A result count . 0 N/A N/A N/A N/A len result 253 N/A N/A result N/A result N/A N/A N/A N/A result index . 1 N/A result N/A dns_spf N/A N/A self domain N/A N/A N/A Get the SPF record recorded in DNS for a specific domain
        name.  Returns None if not found, or if more than one record
        is found.
         N/A label N/A N/A domain split . N/A N/A N/A N/A label N/A N/A len label 63 N/A N/A None N/A a N/A t N/A t N/A N/A self dns_txt domain N/A N/A RE_SPF match t N/A N/A N/A len a 1 N/A N/A N/A PermError Two or more type TXT spf records found. N/A N/A N/A N/A len a 1 N/A N/A self strict 2 N/A N/A N/A to_ascii N/A a N/A 0 N/A N/A N/A self strict 1 N/A N/A N/A N/A b N/A t N/A t N/A N/A self dns_txt domain SPF N/A N/A RE_SPF match t N/A N/A N/A TempError N/A x N/A N/A N/A N/A self strict 1 N/A N/A N/A TempError x N/A b N/A N/A N/A N/A len b 1 N/A N/A N/A PermError Two or more type SPF spf records found. N/A N/A N/A len b 1 N/A N/A N/A N/A N/A self strict 1 N/A N/A len a 1 N/A N/A a N/A 0 N/A b N/A 0 N/A N/A N/A AmbiguityWarning v=spf1 records of both type TXT and SPF (type 99) present, but not identical N/A N/A to_ascii N/A b N/A 0 N/A N/A N/A len a 1 N/A N/A N/A to_ascii N/A a N/A 0 N/A DELEGATE N/A N/A a N/A t N/A t N/A N/A self dns_txt N/A N/A domain ._spf. DELEGATE N/A N/A RE_SPF match t N/A N/A N/A len a 1 N/A N/A N/A to_ascii N/A a N/A 0 N/A None N/A dns_txt N/A N/A self domainname rr N/A TXT N/A N/A Get a list of TXT records for a domain name. N/A domainname N/A N/A N/A N/A dns_list N/A N/A self dns domainname rr N/A dns_list N/A N/A a N/A N/A N/A N/A N/A a N/A 0 N/A 0 join a N/A a dns_list N/A N/A isinstance N/A a N/A 0 bytes N/A N/A a N/A N/A N/A N/A s encode utf-8 N/A s a N/A N/A N/A UnicodeError N/A N/A N/A PermError N/A Non-ascii characters found in %s record for %s N/A rr domainname N/A N/A N/A dns_mx N/A N/A self domainname N/A N/A N/A Get a list of IP addresses for all MX exchanges for a
        domain name.
         N/A mxnames N/A N/A self dns domainname MX N/A N/A self strict N/A N/A max MAX_MX N/A N/A N/A self strict 1 N/A N/A N/A N/A len mxnames MAX_MX N/A N/A N/A AmbiguityWarning N/A More than %d MX records returned MAX_MX N/A N/A N/A len mxnames 0 N/A N/A N/A AmbiguityWarning No MX records found for mx mechanism domainname N/A N/A max N/A MAX_MX 4 N/A N/A N/A mxnames sort N/A N/A a N/A mx N/A mxnames N/A max N/A a N/A N/A self dns_a N/A mx N/A 1 N/A self A N/A dns_a N/A N/A self domainname A N/A A N/A N/A Get a list of IP addresses for a domainname.
         N/A N/A domainname N/A N/A N/A N/A N/A N/A self strict 1 N/A N/A alist N/A N/A self dns domainname A N/A N/A N/A len alist 0 N/A N/A N/A AmbiguityWarning N/A No %s records found for A domainname N/A N/A alist N/A r N/A N/A self dns domainname A N/A N/A N/A A AAAA N/A bytes str N/A N/A N/A N/A N/A ipaddress Bytes ip N/A ip r N/A r N/A validated_ptrs N/A N/A self N/A N/A N/A Figure out the validated PTR domain names for the connect IP. N/A N/A self strict N/A N/A max MAX_PTR N/A N/A N/A self strict 1 N/A N/A N/A N/A ptrnames N/A N/A self dns_ptr N/A self i N/A N/A N/A len ptrnames max N/A N/A warning N/A More than %d PTR records returned max N/A N/A AmbiguityWarning warning N/A self c N/A N/A N/A N/A len ptrnames 0 N/A N/A N/A AmbiguityWarning No PTR records found for ptr mechanism N/A self c N/A N/A N/A N/A N/A AmbiguityWarning No PTR records found for ptr mechanism N/A self c N/A N/A max N/A MAX_PTR 4 N/A cidrlength N/A self cidrmax N/A N/A p N/A p N/A N/A N/A self dns_ptr N/A self i N/A max N/A N/A self cidrmatch N/A N/A self dns_a p N/A self A cidrlength N/A dns_ptr N/A N/A self i N/A N/A N/A Get a list of domain names for an IP address. N/A N/A N/A self dns N/A %s.%s.arpa N/A N/A reverse_dots i N/A self v PTR N/A N/A SAFE2CACHE N/A N/A MX A N/A MX MX N/A CNAME A N/A A A N/A AAAA AAAA N/A PTR PTR N/A TXT TXT N/A SPF SPF None None None None None None None None dns N/A N/A self name qtype cnames N/A None N/A N/A DNS query.

        If the result is in cache, return that.  Otherwise pull the
        result from DNS, and cache ALL answers, so additional info
        is available for further queries later.

        CNAMEs are followed.

        If there is no data, [] is returned.

        pre: qtype in ['A', 'AAAA', 'MX', 'PTR', 'TXT', 'SPF']
        post: isinstance(__return__, types.ListType)
         N/A N/A N/A name endswith . N/A N/A name N/A name N/A -1 N/A N/A N/A reduce N/A N/A N/A x y N/A N/A x N/A 0 N/A len y 64 N/A N/A name split . True N/A N/A N/A N/A result N/A N/A N/A self cache get N/A name qtype N/A N/A result N/A N/A result N/A cnamek N/A name CNAME N/A cname N/A N/A N/A self cache get cnamek N/A cname N/A N/A cname N/A cname N/A 0 N/A N/A safe2cache N/A query SAFE2CACHE N/A N/A N/A self querytime 0 N/A N/A N/A TempError DNS Error: exceeded max query lookup time N/A N/A N/A N/A self querytime N/A self timeout N/A N/A self querytime 0 N/A N/A timeout N/A self querytime N/A N/A timeout N/A self timeout N/A timethen N/A N/A time time N/A N/A k v N/A DNSLookup name qtype N/A self strict timeout N/A N/A N/A k cnamek N/A N/A cname v N/A N/A N/A N/A k N/A 1 CNAME N/A N/A qtype N/A k N/A 1 safe2cache N/A N/A N/A N/A N/A N/A N/A self cache setdefault k N/A append v N/A result N/A N/A N/A self cache get N/A name qtype N/A N/A N/A N/A self querytime 0 N/A N/A N/A self querytime N/A N/A self querytime N/A N/A N/A time time timethen N/A N/A N/A result cname N/A N/A N/A cnames N/A N/A cnames N/A N/A N/A N/A N/A len cnames MAX_CNAME N/A N/A N/A PermError N/A Length of CNAME chain exceeds %d MAX_CNAME N/A N/A cnames N/A name cname N/A N/A cname cnames N/A N/A N/A PermError CNAME loop N/A result N/A N/A self dns cname qtype cnames cnames N/A result N/A N/A N/A N/A self cache N/A N/A name qtype result N/A result N/A cidrmatch N/A N/A self ipaddrs n N/A N/A N/A Match connect IP against a CIDR network of other IP addresses.

        Examples:
        >>> c = query(s='strong-bad@email.example.com',
        ...           h='mx.example.org', i='192.0.2.3')
        >>> c.p = 'mx.example.org'
        >>> c.r = 'example.com'

        >>> c.cidrmatch(['192.0.2.3'],32)
        True
        >>> c.cidrmatch(['192.0.2.2'],32)
        False
        >>> c.cidrmatch(['192.0.2.2'],31)
        True

        >>> six = query(s='strong-bad@email.example.com',
        ...           h='mx.example.org', i='2001:0db8:0:0:0:0:0:0001')
        >>> six.p = 'mx.example.org'
        >>> six.r = 'example.com'

        >>> six.cidrmatch(['2001:0DB8::'],127)
        True
        >>> six.cidrmatch(['2001:0DB8::'],128)
        False
        >>> six.cidrmatch(['2001:0DB8:0:0:0:0:0:0001'],128)
        True
         N/A N/A N/A netwrk N/A N/A N/A ipaddress ip_network ip N/A ip ipaddrs N/A N/A network N/A N/A netwrk supernet new_prefix n N/A N/A isinstance N/A self iplist bool N/A N/A N/A N/A network __contains__ N/A self ipaddr N/A N/A True N/A N/A N/A n N/A self cidrmax N/A N/A N/A N/A N/A self iplist append network N/A N/A N/A N/A N/A self iplist append N/A network ip N/A N/A N/A AttributeError N/A N/A netwrk N/A N/A N/A ipaddress IPNetwork ip strict False N/A ip ipaddrs N/A N/A network N/A N/A netwrk supernet new_prefix n N/A N/A isinstance N/A self iplist bool N/A N/A N/A N/A network __contains__ N/A self ipaddr N/A N/A True N/A N/A N/A n N/A self cidrmax N/A N/A N/A N/A N/A self iplist append network N/A N/A N/A N/A N/A self iplist append N/A network ip N/A False N/A parse_header_ar N/A N/A self val N/A N/A N/A Set SPF values from RFC 5451 Authentication Results header.
        
        Useful when SPF has already been run on a trusted gateway machine.

        Expects the entire header as an input.

        Examples:
        >>> q = query('192.0.2.3','strong-bad@email.example.com','mx.example.org')
        >>> q.mechanism = 'unknown'
        >>> p = q.parse_header_ar('''Authentication-Results: bmsi.com; spf=neutral \n     (abuse@kitterman.com: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) \n     smtp.mailfrom=email.example.com \n    (sender=strong-bad@email.example.com; helo=mx.example.org; client-ip=192.0.2.3; receiver=abuse@kitterman.com; mechanism=?all)''')
        >>> q.get_header(q.result, header_type='authres', aid='bmsi.com')
        'Authentication-Results: bmsi.com; spf=neutral (unknown: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) smtp.mailfrom=email.example.com (sender=email.example.com; helo=mx.example.org; client-ip=192.0.2.3; receiver=unknown; mechanism=unknown)'
        >>> p = q.parse_header_ar('''Authentication-Results: bmsi.com; spf=None (mail.bmsi.com: test; client-ip=163.247.46.150) smtp.mailfrom=admin@squiebras.cl (helo=mail.squiebras.cl; receiver=mail.bmsi.com;\n mechanism=mx/24)''')
        >>> q.get_header(q.result, header_type='authres', aid='bmsi.com')
        'Authentication-Results: bmsi.com; spf=none (unknown: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) smtp.mailfrom=admin@squiebras.cl (sender=admin@squiebras.cl; helo=mx.example.org; client-ip=192.0.2.3; receiver=unknown; mechanism=unknown)'
         N/A authres N/A val N/A N/A join N/A N/A N/A s strip N/A s N/A N/A val split N/A arobj N/A N/A N/A authres AuthenticationResultsHeader parse val N/A resobj N/A arobj results N/A N/A N/A N/A resobj method spf N/A N/A N/A self authserv N/A arobj authserv_id N/A N/A self result N/A resobj result N/A N/A N/A N/A N/A resobj properties N/A 0 name mailfrom N/A N/A N/A self d N/A N/A N/A resobj properties N/A 0 value N/A N/A self s N/A N/A N/A resobj properties N/A 0 value N/A N/A N/A N/A N/A resobj properties N/A 0 name helo N/A N/A N/A self h N/A N/A N/A resobj properties N/A 0 value N/A N/A parse_header_spf N/A N/A self val N/A N/A N/A Set SPF values from Received-SPF header.
        
        Useful when SPF has already been run on a trusted gateway machine.

        Examples:
        >>> q = query('0.0.0.0','','')
        >>> p = q.parse_header_spf('''Pass (test) client-ip=70.98.79.77;
        ... envelope-from="evelyn@subjectsthum.com"; helo=mail.subjectsthum.com;
        ... receiver=mail.bmsi.com; mechanism=a; identity=mailfrom''')
        >>> q.get_header(q.result)
        'Pass (test) client-ip=70.98.79.77; envelope-from="evelyn@subjectsthum.com"; helo=mail.subjectsthum.com; receiver=mail.bmsi.com; mechanism=a; identity=mailfrom'
        >>> o = q.parse_header_spf('''None (mail.bmsi.com: test)
        ... client-ip=163.247.46.150; envelope-from="admin@squiebras.cl";
        ... helo=mail.squiebras.cl; receiver=mail.bmsi.com; mechanism=mx/24;
        ... x-bestguess=pass; x-helo-spf=neutral; identity=mailfrom''')
        >>> q.get_header(q.result,**o)
        'None (mail.bmsi.com: test) client-ip=163.247.46.150; envelope-from="admin@squiebras.cl"; helo=mail.squiebras.cl; receiver=mail.bmsi.com; mechanism=mx/24; x-bestguess=pass; x-helo-spf=neutral; identity=mailfrom'
        >>> o['bestguess']
        'pass'
         N/A a N/A N/A val split None 1 N/A N/A self result N/A N/A N/A a N/A 0 lower N/A N/A self mechanism None N/A N/A N/A len a 2 N/A N/A none N/A val N/A a N/A 1 N/A N/A N/A val startswith ( N/A N/A pos N/A N/A val find ) N/A N/A pos 0 N/A N/A N/A self result N/A N/A self comment N/A val N/A 1 pos N/A val N/A val N/A N/A pos 1 N/A msg N/A Message N/A N/A N/A msg add_header Received-SPF N/A ;  val N/A p N/A N/A N/A k v N/A N/A msg get_params header Received-SPF N/A N/A N/A k client-ip N/A N/A N/A N/A self set_ip v N/A N/A N/A k envelope-from N/A N/A N/A self s v N/A N/A N/A k helo N/A N/A N/A self h v N/A N/A N/A k receiver N/A N/A N/A self r v N/A N/A N/A k problem N/A N/A N/A self mech v N/A N/A N/A k mechanism N/A N/A N/A self mechanism v N/A N/A N/A k identity N/A N/A N/A self ident v N/A N/A N/A N/A k startswith x- N/A N/A N/A p N/A N/A k N/A 2 v N/A N/A N/A self l N/A self o N/A split_email N/A self s N/A self h N/A p N/A parse_header N/A N/A self val N/A N/A N/A Set SPF values from Received-SPF or RFC 5451 Authentication Results header.
        
        Useful when SPF has already been run on a trusted gateway machine. Auto
        detects the header type and parses it. Use parse_header_spf or parse_header_ar
        for each type if required.

        Examples:
        >>> q = query('0.0.0.0','','')
        >>> p = q.parse_header('''Pass (test) client-ip=70.98.79.77;
        ... envelope-from="evelyn@subjectsthum.com"; helo=mail.subjectsthum.com;
        ... receiver=mail.bmsi.com; mechanism=a; identity=mailfrom''')
        >>> q.get_header(q.result)
        'Pass (test) client-ip=70.98.79.77; envelope-from="evelyn@subjectsthum.com"; helo=mail.subjectsthum.com; receiver=mail.bmsi.com; mechanism=a; identity=mailfrom'
        >>> r = q.parse_header('''None (mail.bmsi.com: test)
        ... client-ip=163.247.46.150; envelope-from="admin@squiebras.cl";
        ... helo=mail.squiebras.cl; receiver=mail.bmsi.com; mechanism=mx/24;
        ... x-bestguess=pass; x-helo-spf=neutral; identity=mailfrom''')
        >>> q.get_header(q.result,**r)
        'None (mail.bmsi.com: test) client-ip=163.247.46.150; envelope-from="admin@squiebras.cl"; helo=mail.squiebras.cl; receiver=mail.bmsi.com; mechanism=mx/24; x-bestguess=pass; x-helo-spf=neutral; identity=mailfrom'
        >>> r['bestguess']
        'pass'
        >>> q = query('192.0.2.3','strong-bad@email.example.com','mx.example.org')
        >>> q.mechanism = 'unknown'
        >>> p = q.parse_header_ar('''Authentication-Results: bmsi.com; spf=neutral \n     (abuse@kitterman.com: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) \n     smtp.mailfrom=email.example.com \n     (sender=strong-bad@email.example.com; helo=mx.example.org; client-ip=192.0.2.3; receiver=abuse@kitterman.com; mechanism=?all)''')
        >>> q.get_header(q.result, header_type='authres', aid='bmsi.com')
        'Authentication-Results: bmsi.com; spf=neutral (unknown: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) smtp.mailfrom=email.example.com (sender=email.example.com; helo=mx.example.org; client-ip=192.0.2.3; receiver=unknown; mechanism=unknown)'
        >>> p = q.parse_header_ar('''Authentication-Results: bmsi.com; spf=None (mail.bmsi.com: test; client-ip=163.247.46.150) smtp.mailfrom=admin@squiebras.cl (helo=mail.squiebras.cl; receiver=mail.bmsi.com; mechanism=mx/24)''')
        >>> q.get_header(q.result, header_type='authres', aid='bmsi.com')
        'Authentication-Results: bmsi.com; spf=none (unknown: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) smtp.mailfrom=admin@squiebras.cl (sender=admin@squiebras.cl; helo=mx.example.org; client-ip=192.0.2.3; receiver=unknown; mechanism=unknown)'
         N/A N/A N/A val startswith Authentication-Results: N/A N/A N/A N/A self parse_header_ar val N/A N/A N/A N/A self parse_header_spf val N/A get_header N/A N/A self res receiver header_type aid N/A None spf None kv N/A N/A 
        Generate Received-SPF or Authentication Results header based on the
         last lookup.

        >>> q = query(s='strong-bad@email.example.com', h='mx.example.org',
        ...           i='192.0.2.3')
        >>> q.r='abuse@kitterman.com'
        >>> q.check(spf='v=spf1 ?all')
        ('neutral', 250, 'access neither permitted nor denied')
        >>> q.get_header('neutral')
        'Neutral (abuse@kitterman.com: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) client-ip=192.0.2.3; envelope-from="strong-bad@email.example.com"; helo=mx.example.org; receiver=abuse@kitterman.com; mechanism=?all; identity=mailfrom'

        >>> q.check(spf='v=spf1 redirect=controlledmail.com exp=_exp.controlledmail.com')
        ('fail', 550, 'SPF fail - not authorized')
        >>> q.get_header('fail')
        'Fail (abuse@kitterman.com: domain of email.example.com does not designate 192.0.2.3 as permitted sender) client-ip=192.0.2.3; envelope-from="strong-bad@email.example.com"; helo=mx.example.org; receiver=abuse@kitterman.com; mechanism=-all; identity=mailfrom'
    
        >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 ?all moo')
        ('permerror', 550, 'SPF Permanent Error: Unknown mechanism found: moo')
        >>> q.get_header('permerror')
        'PermError (abuse@kitterman.com: permanent error in processing domain of email.example.com: Unknown mechanism found) client-ip=192.0.2.3; envelope-from="strong-bad@email.example.com"; helo=mx.example.org; receiver=abuse@kitterman.com; problem=moo; identity=mailfrom'

        >>> q.check(spf='v=spf1 ip4:192.0.0.0/8 ~all')
        ('pass', 250, 'sender SPF authorized')
        >>> q.get_header('pass')
        'Pass (abuse@kitterman.com: domain of email.example.com designates 192.0.2.3 as permitted sender) client-ip=192.0.2.3; envelope-from="strong-bad@email.example.com"; helo=mx.example.org; receiver=abuse@kitterman.com; mechanism="ip4:192.0.0.0/8"; identity=mailfrom'

        >>> q.check(spf='v=spf1 ?all')
        ('neutral', 250, 'access neither permitted nor denied')
        >>> q.get_header('neutral', header_type = 'authres', aid='bmsi.com')
        'Authentication-Results: bmsi.com; spf=neutral (abuse@kitterman.com: 192.0.2.3 is neither permitted nor denied by domain of email.example.com) smtp.mailfrom=email.example.com (sender=strong-bad@email.example.com; helo=mx.example.org; client-ip=192.0.2.3; receiver=abuse@kitterman.com; mechanism=?all)'

        >>> p = query(s='strong-bad@email.example.com', h='mx.example.org',
        ...           i='192.0.2.3')
        >>> p.r='abuse@kitterman.com'
        >>> p.check(spf='v=spf1 redirect=controlledmail.com exp=_exp.controlledmail.com')
        ('fail', 550, 'SPF fail - not authorized')
        >>> p.ident = 'helo'
        >>> p.get_header('fail', header_type = 'authres', aid='bmsi.com')
        'Authentication-Results: bmsi.com; spf=fail (abuse@kitterman.com: domain of email.example.com does not designate 192.0.2.3 as permitted sender) smtp.helo=mx.example.org (sender=strong-bad@email.example.com; client-ip=192.0.2.3; receiver=abuse@kitterman.com; mechanism=-all)'

        >>> q.check(spf='v=spf1 ?all')
        ('neutral', 250, 'access neither permitted nor denied')
        >>> try: q.get_header('neutral', header_type = 'dkim')
        ... except SyntaxError as x: print(x)
        Unknown results header type: dkim
         N/A N/A header_type authres N/A N/A N/A aid N/A N/A N/A SyntaxError authserv-id missing for Authentication Results header type, see RFC5451 2.3 N/A authres N/A N/A receiver N/A N/A receiver N/A self r N/A client_ip N/A self c N/A helo N/A quote_value N/A self h N/A resmap N/A pass neutral fail softfail none temperror permerror Pass Neutral Fail SoftFail None TempError PermError N/A identity N/A self ident N/A N/A identity helo N/A N/A envelope_from None N/A N/A envelope_from N/A quote_value N/A self s N/A tag N/A resmap N/A res N/A N/A N/A res permerror N/A self mech N/A N/A problem N/A quote_value N/A N/A join N/A self mech N/A N/A problem None N/A mechanism N/A quote_value N/A self mechanism N/A N/A hasattr self comment N/A N/A comment N/A self comment N/A N/A comment N/A %s: %s N/A receiver N/A N/A self get_header_comment res N/A res N/A N/A %s (%s) N/A tag comment N/A N/A header_type spf N/A N/A k N/A client_ip envelope_from helo receiver problem mechanism N/A N/A v N/A N/A locals N/A k N/A v N/A N/A N/A N/A res append N/A %s=%s; N/A N/A N/A k replace _ - v N/A N/A k v N/A sorted N/A list N/A N/A kv items N/A N/A v N/A N/A N/A N/A res append N/A x-%s=%s; N/A N/A N/A k replace _ - N/A quote_value v N/A N/A N/A res append N/A %s=%s N/A identity identity N/A N/A N/A join res N/A N/A N/A header_type authres N/A N/A envelope_from N/A N/A N/A str N/A N/A authres AuthenticationResultsHeader authserv_id aid results N/A N/A N/A authres SPFAuthenticationResult result tag result_comment comment smtp_mailfrom N/A self d smtp_mailfrom_comment N/A N/A sender={0}; helo={1}; client-ip={2}; receiver={3}; mechanism={4} format N/A self s N/A self h N/A self c N/A self r mechanism N/A N/A N/A str N/A N/A authres AuthenticationResultsHeader authserv_id aid results N/A N/A N/A authres SPFAuthenticationResult result tag result_comment comment smtp_helo N/A self h smtp_helo_comment N/A N/A sender={0}; client-ip={1}; receiver={2}; mechanism={3} format N/A self s N/A self c N/A self r mechanism N/A N/A N/A SyntaxError N/A N/A Unknown results header type: {0} format header_type N/A get_header_comment N/A N/A self res N/A N/A N/A Return comment for Received-SPF header.   N/A sender N/A self o N/A N/A res pass N/A N/A N/A domain of %s designates %s as permitted sender N/A sender N/A self c N/A N/A N/A res softfail N/A N/A N/A transitioning domain of %s does not designate %s as permitted sender N/A sender N/A self c N/A N/A N/A res neutral N/A N/A N/A %s is neither permitted nor denied by domain of %s N/A N/A self c sender N/A N/A N/A res none N/A N/A N/A %s is neither permitted nor denied by domain of %s N/A N/A self c sender N/A N/A N/A res permerror N/A N/A N/A permanent error in processing domain of %s: %s N/A sender N/A self prob N/A N/A N/A res temperror N/A N/A N/A temporary error in processing during lookup of %s sender N/A N/A N/A res fail N/A N/A N/A domain of %s does not designate %s as permitted sender N/A sender N/A self c N/A N/A ValueError N/A invalid SPF result for header comment:  res N/A N/A split_email N/A N/A s h N/A N/A N/A Given a sender email s and a HELO domain h, create a valid tuple
    (l, d) local-part and domain-part.

    Examples:
    >>> split_email('', 'wayforward.net')
    ('postmaster', 'wayforward.net')

    >>> split_email('foo.com', 'wayforward.net')
    ('postmaster', 'foo.com')

    >>> split_email('terry@wayforward.net', 'optsw.com')
    ('terry', 'wayforward.net')
     N/A N/A s N/A N/A N/A postmaster h N/A N/A parts N/A N/A s split @ 1 N/A N/A N/A parts N/A 0 N/A N/A N/A parts N/A 0 postmaster N/A N/A N/A len parts 2 N/A N/A N/A tuple parts N/A N/A N/A postmaster s N/A quote_value N/A N/A s N/A N/A N/A Quote the value for a key-value pair in Received-SPF header field
    if needed.  No quoting needed for a dot-atom value.

    Examples:
    >>> quote_value('foo@bar.com')
    '"foo@bar.com"'
    
    >>> quote_value('mail.example.com')
    'mail.example.com'

    >>> quote_value('A:1.2.3.4')
    '"A:1.2.3.4"'

    >>> quote_value('abc"def')
    '"abc\\"def"'

    >>> quote_value(r'abc\def')
    '"abc\\\\def"'

    >>> quote_value('abc..def')
    '"abc..def"'

    >>> quote_value('')
    '""'

    >>> quote_value(None)
     N/A N/A N/A s None N/A N/A RE_DOT_ATOM match s N/A N/A s N/A N/A N/A " N/A N/A N/A N/A N/A N/A s replace \ \\ replace " \" replace \x00 " N/A parse_mechanism N/A N/A str d N/A N/A N/A Breaks A, MX, IP4, and PTR mechanisms into a (name, domain,
    cidr,cidr6) tuple.  The domain portion defaults to d if not present,
    the cidr defaults to 32 if not present.

    Examples:
    >>> parse_mechanism('a', 'foo.com')
    ('a', 'foo.com', None, None)

    >>> parse_mechanism('exists','foo.com')
    ('exists', None, None, None)

    >>> parse_mechanism('a:bar.com', 'foo.com')
    ('a', 'bar.com', None, None)

    >>> parse_mechanism('a/24', 'foo.com')
    ('a', 'foo.com', 24, None)

    >>> parse_mechanism('A:foo:bar.com/16//48', 'foo.com')
    ('a', 'foo:bar.com', 16, 48)

    >>> parse_mechanism('-exists:%{i}.%{s1}.100/86400.rate.%{d}','foo.com')
    ('-exists', '%{i}.%{s1}.100/86400.rate.%{d}', None, None)

    >>> parse_mechanism('mx:%%%_/.Claranet.de/27','foo.com')
    ('mx', '%%%_/.Claranet.de', 27, None)

    >>> parse_mechanism('mx:%{d}//97','foo.com')
    ('mx', '%{d}', None, 97)

    >>> parse_mechanism('iP4:192.0.0.0/8','foo.com')
    ('ip4', '192.0.0.0', 8, None)
     N/A a N/A N/A RE_DUAL_CIDR split str N/A N/A N/A len a 3 N/A N/A N/A str cidr6 N/A N/A a N/A 0 N/A int N/A a N/A 1 N/A N/A cidr6 None N/A a N/A N/A RE_CIDR split str N/A N/A N/A len a 3 N/A N/A N/A str cidr N/A N/A a N/A 0 N/A int N/A a N/A 1 N/A N/A cidr None N/A a N/A N/A str split : 1 N/A N/A N/A len a 2 N/A N/A str N/A N/A str lower N/A N/A str exists N/A N/A d None N/A N/A str d cidr cidr6 N/A N/A N/A N/A N/A a N/A 0 lower N/A a N/A 1 cidr cidr6 N/A reverse_dots N/A N/A name N/A N/A N/A Reverse dotted IP addresses or domain names.

    Example:
    >>> reverse_dots('192.168.0.145')
    '145.0.168.192'

    >>> reverse_dots('email.example.com')
    'com.example.email'
     N/A a N/A N/A name split . N/A N/A N/A a reverse N/A N/A N/A . join a N/A domainmatch N/A N/A ptrs domainsuffix N/A N/A N/A grep for a given domain suffix against a list of validated PTR
    domain names.

    Examples:
    >>> domainmatch(['FOO.COM'], 'foo.com')
    1

    >>> domainmatch(['moo.foo.com'], 'FOO.COM')
    1

    >>> domainmatch(['moo.bar.com'], 'foo.com')
    0

     N/A domainsuffix N/A N/A domainsuffix lower N/A ptr ptrs N/A N/A ptr N/A N/A ptr lower N/A N/A N/A ptr domainsuffix N/A N/A ptr endswith N/A . domainsuffix N/A N/A True N/A False N/A expand_one N/A N/A expansion str joiner N/A N/A N/A N/A str N/A N/A expansion N/A N/A ln reverse delimiters N/A N/A N/A RE_ARGS split str N/A 1 4 N/A N/A delimiters N/A N/A delimiters . N/A expansion N/A split expansion delimiters joiner N/A reverse N/A N/A N/A N/A expansion reverse N/A ln N/A N/A expansion N/A expansion N/A N/A N/A N/A N/A int ln 2 1 N/A N/A N/A join expansion N/A split N/A N/A str delimiters joiner N/A None N/A N/A Split a string into pieces by a set of delimiter characters.  The
    resulting list is delimited by joiner, or the original delimiter if
    joiner is not specified.

    Examples:
    >>> split('192.168.0.45', '.')
    ['192', '.', '168', '.', '0', '.', '45']

    >>> split('terry@wayforward.net', '@.')
    ['terry', '@', 'wayforward', '.', 'net']

    >>> split('terry@wayforward.net', '@.', '.')
    ['terry', '.', 'wayforward', '.', 'net']
     N/A N/A result element N/A N/A N/A c str N/A N/A N/A c delimiters N/A N/A N/A N/A result append element N/A element N/A joiner N/A N/A N/A N/A result append joiner N/A N/A N/A N/A result append c N/A N/A element c N/A N/A N/A result append element N/A result N/A insert_libspf_local_policy N/A N/A spftxt local N/A None N/A N/A Returns spftxt with local inserted just before last non-fail
    mechanism.  This is how the libspf{2} libraries handle "local-policy".
    
    Examples:
    >>> insert_libspf_local_policy('v=spf1 -all')
    'v=spf1 -all'
    >>> insert_libspf_local_policy('v=spf1 -all','mx')
    'v=spf1 -all'
    >>> insert_libspf_local_policy('v=spf1','a mx ptr')
    'v=spf1 a mx ptr'
    >>> insert_libspf_local_policy('v=spf1 mx -all','a ptr')
    'v=spf1 mx a ptr -all'
    >>> insert_libspf_local_policy('v=spf1 mx -include:foo.co +all','a ptr')
    'v=spf1 mx a ptr -include:foo.co +all'

    # FIXME: is this right?  If so, "last non-fail" is a bogus description.
    >>> insert_libspf_local_policy('v=spf1 mx ?include:foo.co +all','a ptr')
    'v=spf1 mx a ptr ?include:foo.co +all'
    >>> spf='v=spf1 ip4:1.2.3.4 -a:example.net -all'
    >>> local='ip4:192.0.2.3 a:example.org'
    >>> insert_libspf_local_policy(spf,local)
    'v=spf1 ip4:1.2.3.4 ip4:192.0.2.3 a:example.org -a:example.net -all'
     N/A N/A local N/A N/A spftxt N/A spf N/A N/A N/A spftxt split N/A 1 N/A spf N/A N/A N/A N/A spf reverse N/A mech spf N/A N/A N/A N/A N/A RESULTS get N/A mech N/A 0 N/A N/A where N/A N/A spf index mech N/A N/A spf N/A where where N/A local N/A N/A N/A spf reverse N/A local N/A N/A join spf N/A N/A N/A spftxt N/A N/A v=spf1  local N/A N/A N/A N/A N/A sys version_info N/A 0 2 N/A to_ascii N/A N/A s N/A N/A N/A Raise PermError if arg is not 7-bit ascii. N/A N/A N/A N/A N/A s encode ascii N/A N/A N/A UnicodeError N/A N/A N/A PermError Non-ascii characters found N/A repr s N/A N/A to_ascii N/A N/A s N/A N/A N/A Raise PermError if arg is not 7-bit ascii. N/A N/A N/A N/A N/A s decode ascii N/A N/A N/A UnicodeError N/A N/A N/A PermError Non-ascii characters found N/A repr s N/A _test N/A N/A N/A N/A N/A doctest spf N/A N/A N/A doctest testmod spf N/A N/A N/A N/A DNS DiscoverNameServers N/A N/A __name__ __main__ N/A N/A getopt N/A N/A N/A N/A opts argv N/A N/A getopt getopt N/A N/A sys argv N/A 1 hv N/A help verbose N/A N/A N/A N/A getopt GetoptError N/A err N/A N/A N/A str err N/A USAGE N/A N/A N/A sys exit 2 N/A verbose False N/A N/A o a opts N/A N/A N/A o N/A -v --verbose N/A N/A verbose True N/A N/A N/A o N/A -h --help N/A N/A USAGE N/A N/A N/A len argv 0 N/A N/A USAGE N/A N/A _test N/A N/A N/A N/A len argv 1 N/A N/A N/A N/A q N/A query i 127.0.0.1 s localhost h unknown receiver N/A N/A socket gethostname N/A N/A N/A q dns_spf N/A argv N/A 0 N/A N/A N/A TempError N/A x N/A N/A N/A Temporary DNS error:  x N/A N/A PermError N/A x N/A N/A N/A PermError:  x N/A N/A N/A N/A len argv 3 N/A N/A N/A i s h argv N/A q N/A query i i s s h h receiver N/A N/A socket gethostname verbose verbose N/A N/A N/A N/A q check N/A q mechanism N/A N/A N/A q perm_error N/A N/A q perm_error ext N/A N/A N/A N/A q perm_error ext N/A N/A q iplist N/A N/A ip N/A q iplist N/A N/A ip N/A N/A N/A N/A len argv 4 N/A N/A N/A i s h N/A argv N/A 1 N/A q N/A query i i s s h h receiver N/A N/A socket gethostname strict False verbose verbose N/A N/A N/A N/A q check N/A argv N/A 0 N/A q mechanism N/A N/A N/A q perm_error N/A N/A q perm_error ext N/A N/A N/A N/A q perm_error ext N/A N/A USAGE