Module Expr Str Assign NameStore NameLoad Import alias alias ImportFrom alias ImportFrom alias Import alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad If BoolOpAnd NameLoad UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body ImportFrom alias alias alias alias Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Num Assign NameStore Num ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BoolOpOr BoolOpAnd AttributeLoad NameLoad attr Str Str If UnaryOpNot AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr BoolOpAnd AttributeLoad NameLoad attr Str Str Return BinOpMod Str TupleLoad NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list Assign NameStore NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If NameLoad body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list Assign NameStore Dict NameLoad NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore ListLoad Assign NameStore AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body If CompareEq Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad If CompareEq Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad If CompareGt Call NameLoad NameLoad NameLoad body Raise Call NameLoad NameLoad NameLoad NameLoad NameLoad If CompareGt Call NameLoad NameLoad NameLoad body Raise Call NameLoad NameLoad NameLoad NameLoad NameLoad For NameStore TupleLoad NameLoad NameLoad body Expr Call NameLoad Call NameLoad Str Call NameLoad NameLoad Expr Call NameLoad NameLoad Expr Call NameLoad Call NameLoad Str Num Return Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list Assign NameStore NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad Call AttributeLoad Call NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases body Expr Str Expr Call NameLoad NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Num Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str AugAssignAdd AttributeStore NameLoad attr Num Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Assign NameStore SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad orelse Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Str TryExcept body Assign NameStore Call NameLoad NameLoad NameLoad handlers ExceptHandler body Return Call NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareIn NameLoad NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index NameLoad NameLoad NameLoad orelse Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad orelse Assign NameStore Call NameLoad orelse Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Assign NameStore Str Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler type TupleLoad NameLoad NameLoad body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs NameLoad NameLoad body Return Call NameLoad Call NameLoad NameLoad BinOpMod Str TupleLoad NameLoad NameLoad keyword Call NameLoad Call NameLoad Return Call NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases body Expr Str ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Assign SubscriptStore AttributeLoad NameLoad attr Slice ListLoad Assign NameStore SubscriptStore NameLoad Index Str Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Expr Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Str Dict For TupleStore NameStore NameStore NameLoad body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad If BoolOpAnd NameLoad CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Return Call AttributeLoad NameLoad attr NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list Expr Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Return Call NameLoad Call NameLoad NameLoad NameLoad CompareIn NameLoad AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Return Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler body Assign NameStore Call NameLoad Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list Return Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad attr NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Str keyword NameLoad keyword Num Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If CompareIn NameLoad NameLoad body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Expr Call NameLoad NameLoad Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return Call NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str If CompareIn NameLoad NameLoad body Return Call AttributeLoad NameLoad attr Return NameLoad decorator_list ClassDef bases body Expr Str Expr Call NameLoad NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Delete SubscriptDel NameLoad Index NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareIs NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareIs NameLoad NameLoad body Pass orelse Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body If CompareEq NameLoad Str body Return NameLoad orelse If CompareEq NameLoad Str body Return NameLoad orelse Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If NameLoad body Return Str orelse Return Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad attr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad Str attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad Str attr ListComp Call AttributeLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad attr comprehension NameStore NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return NameLoad decorator_list decorator_list ClassDef bases body Expr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore SubscriptStore NameLoad Index Str Dict Assign NameStore SubscriptStore NameLoad Index Str Dict If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign NameStore Dict Assign NameStore Dict Expr Call NameLoad NameLoad Str NameLoad Expr Call NameLoad NameLoad Str NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list decorator_list Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Dict Assign NameStore Dict Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad If BoolOpAnd CompareNotIn NameLoad NameLoad UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call AttributeLoad Str attr NameLoad AttributeLoad NameLoad attr Assign NameStore ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler body Return Call NameLoad Return Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad For TupleStore NameStore NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad For NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Return Call NameLoad NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore Call NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Lambda arguments args NameParam defaults NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad keyword NameLoad keyword NameLoad keyword ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Assign NameStore Call NameLoad Str Call NameLoad NameLoad Assign NameStore Call NameLoad Str NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad For NameStore ListLoad Str Str body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Pass decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad TupleLoad Str Call NameLoad keyword NameLoad TupleLoad Str Call NameLoad keyword NameLoad Assign NameStore ListLoad TupleLoad Str Call NameLoad keyword NameLoad TupleLoad Str Call NameLoad keyword NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults kwarg body Expr Str If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call NameLoad NameLoad decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad NameLoad Return NameLoad decorator_list Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Expr Call NameLoad NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr AttributeLoad Call NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad Call NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign SubscriptStore AttributeLoad NameLoad attr Index Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad NameLoad body Expr Str Expr Call NameLoad NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Raise Call NameLoad Str If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad orelse If BoolOpAnd Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Str orelse Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list Assign NameStore Num Assign NameStore Num Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return Str orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr ListLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore TupleLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Return NameLoad Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Dict decorator_list Expr Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpMod Str TupleLoad AttributeLoad NameLoad attr orelse Assign NameStore Str Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam defaults body Return Str decorator_list FunctionDef arguments args NameParam defaults body Return Str decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list Assign NameStore Call NameLoad NameLoad decorator_list Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad NameLoad If CompareEq NameLoad Str body Assign NameStore UnaryOpUSub NameLoad Assign NameStore UnaryOpUSub NameLoad orelse If CompareNotEq NameLoad Str body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list decorator_list Assign NameStore Call NameLoad Str Num Num ClassDef bases NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad AttributeLoad NameLoad attr body Return Call NameLoad NameLoad Raise Call NameLoad Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Call NameLoad Num Num Call NameLoad Num Num Call NameLoad Num Num Call NameLoad Num Num Call NameLoad Num Num Call NameLoad Num Num Call NameLoad Num Num Call NameLoad Num Num Call NameLoad Num Num FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Assign NameStore ListComp Call NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad SubscriptLoad NameLoad Slice Num Assign SubscriptStore NameLoad Slice Num ListLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore BinOpFloorDiv BinOpAdd BinOpMult AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Num If CompareGt NameLoad Num body Assign NameStore Str orelse Assign NameStore Str Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad BinOpFloorDiv Call NameLoad NameLoad Num BinOpMod Call NameLoad NameLoad Num decorator_list decorator_list
N/A N/A 
This module implements AMP, the Asynchronous Messaging Protocol.

AMP is a protocol for sending multiple asynchronous request/response pairs over
the same connection.  Requests and responses are both collections of key/value
pairs.

AMP is a very simple protocol which is not an application.  This module is a
"protocol construction kit" of sorts; it attempts to be the simplest wire-level
implementation of Deferreds.  AMP provides the following base-level features:

    - Asynchronous request/response handling (hence the name)

    - Requests and responses are both key/value pairs

    - Binary transfer of all data: all data is length-prefixed.  Your
      application will never need to worry about quoting.

    - Command dispatching (like HTTP Verbs): the protocol is extensible, and
      multiple AMP sub-protocols can be grouped together easily.

The protocol implementation also provides a few additional features which are
not part of the core wire protocol, but are nevertheless very useful:

    - Tight TLS integration, with an included StartTLS command.

    - Handshaking to other protocols: because AMP has well-defined message
      boundaries and maintains all incoming and outgoing requests for you, you
      can start a connection over AMP and then switch to another protocol.
      This makes it ideal for firewall-traversal applications where you may
      have only one forwarded port but multiple applications that want to use
      it.

Using AMP with Twisted is simple.  Each message is a command, with a response.
You begin by defining a command type.  Commands specify their input and output
in terms of the types that they expect to see in the request and response
key-value pairs.  Here's an example of a command that adds two integers, 'a'
and 'b'::

    class Sum(amp.Command):
        arguments = [('a', amp.Integer()),
                     ('b', amp.Integer())]
        response = [('total', amp.Integer())]

Once you have specified a command, you need to make it part of a protocol, and
define a responder for it.  Here's a 'JustSum' protocol that includes a
responder for our 'Sum' command::

    class JustSum(amp.AMP):
        def sum(self, a, b):
            total = a + b
            print 'Did a sum: %d + %d = %d' % (a, b, total)
            return {'total': total}
        Sum.responder(sum)

Later, when you want to actually do a sum, the following expression will return
a L{Deferred} which will fire with the result::

    ClientCreator(reactor, amp.AMP).connectTCP(...).addCallback(
        lambda p: p.callRemote(Sum, a=13, b=81)).addCallback(
            lambda result: result['total'])

Command responders may also return Deferreds, causing the response to be
sent only once the Deferred fires::

    class DelayedSum(amp.AMP):
        def slowSum(self, a, b):
            total = a + b
            result = defer.Deferred()
            reactor.callLater(3, result.callback, {'total': total})
            return result
        Sum.responder(slowSum)

This is transparent to the caller.

You can also define the propagation of specific errors in AMP.  For example,
for the slightly more complicated case of division, we might have to deal with
division by zero::

    class Divide(amp.Command):
        arguments = [('numerator', amp.Integer()),
                     ('denominator', amp.Integer())]
        response = [('result', amp.Float())]
        errors = {ZeroDivisionError: 'ZERO_DIVISION'}

The 'errors' mapping here tells AMP that if a responder to Divide emits a
L{ZeroDivisionError}, then the other side should be informed that an error of
the type 'ZERO_DIVISION' has occurred.  Writing a responder which takes
advantage of this is very simple - just raise your exception normally::

    class JustDivide(amp.AMP):
        def divide(self, numerator, denominator):
            result = numerator / denominator
            print 'Divided: %d / %d = %d' % (numerator, denominator, total)
            return {'result': result}
        Divide.responder(divide)

On the client side, the errors mapping will be used to determine what the
'ZERO_DIVISION' error means, and translated into an asynchronous exception,
which can be handled normally as any L{Deferred} would be::

    def trapZero(result):
        result.trap(ZeroDivisionError)
        print "Divided by zero: returning INF"
        return 1e1000
    ClientCreator(reactor, amp.AMP).connectTCP(...).addCallback(
        lambda p: p.callRemote(Divide, numerator=1234,
                               denominator=0)
        ).addErrback(trapZero)

For a complete, runnable example of both of these commands, see the files in
the Twisted repository::

    doc/core/examples/ampserver.py
    doc/core/examples/ampclient.py

On the wire, AMP is a protocol which uses 2-byte lengths to prefix keys and
values, and empty keys to separate messages::

    <2-byte length><key><2-byte length><value>
    <2-byte length><key><2-byte length><value>
    ...
    <2-byte length><key><2-byte length><value>
    <NUL><NUL>                  # Empty Key == End of Message

And so on.  Because it's tedious to refer to lengths and NULs constantly, the
documentation will refer to packets as if they were newline delimited, like
so::

    C: _command: sum
    C: _ask: ef639e5c892ccb54
    C: a: 13
    C: b: 81

    S: _answer: ef639e5c892ccb54
    S: total: 94

Notes:

In general, the order of keys is arbitrary.  Specific uses of AMP may impose an
ordering requirement, but unless this is specified explicitly, any ordering may
be generated and any ordering must be accepted.  This applies to the
command-related keys I{_command} and I{_ask} as well as any other keys.

Values are limited to the maximum encodable size in a 16-bit length, 65535
bytes.

Keys are limited to the maximum encodable size in a 8-bit length, 255 bytes.
Note that we still use 2-byte lengths to encode keys.  This small redundancy
has several features:

    - If an implementation becomes confused and starts emitting corrupt data,
      or gets keys confused with values, many common errors will be signalled
      immediately instead of delivering obviously corrupt packets.

    - A single NUL will separate every key, and a double NUL separates
      messages.  This provides some redundancy when debugging traffic dumps.

    - NULs will be present at regular intervals along the protocol, providing
      some padding for otherwise braindead C implementations of the protocol,
      so that <stdio.h> string functions will see the NUL and stop.

    - This makes it possible to run an AMP server on a port also used by a
      plain-text protocol, and easily distinguish between non-AMP clients (like
      web browsers) which issue non-NUL as the first byte, and AMP clients,
      which always issue NUL as the first byte.
 N/A __metaclass__ type N/A types warnings cStringIO StringIO struct pack N/A decimal datetime itertools count zope.interface Interface implements twisted.python.compat set twisted.python.util unsignedID twisted.python.reflect accumulateClassDict twisted.python.failure Failure twisted.python log filepath twisted.internet.interfaces IFileDescriptorReceiver twisted.internet.main CONNECTION_LOST twisted.internet.error PeerVerifyError ConnectionLost twisted.internet.error ConnectionClosed twisted.internet.defer Deferred maybeDeferred fail twisted.protocols.basic Int16StringReceiver StatefulStringProtocol N/A N/A twisted.internet ssl N/A N/A N/A ImportError N/A N/A ssl None N/A N/A ssl N/A N/A ssl supported N/A N/A ssl None N/A N/A ssl None N/A twisted.internet.ssl CertificateOptions Certificate DN KeyPair N/A ASK _ask N/A ANSWER _answer N/A COMMAND _command N/A ERROR _error N/A ERROR_CODE _error_code N/A ERROR_DESCRIPTION _error_description N/A UNKNOWN_ERROR_CODE UNKNOWN N/A UNHANDLED_ERROR_CODE UNHANDLED N/A MAX_KEY_LENGTH 255 N/A MAX_VALUE_LENGTH 65535 IArgumentType N/A Interface N/A N/A 
    An L{IArgumentType} can serialize a Python object into an AMP box and
    deserialize information from an AMP box back into a Python object.

    @since: 9.0
     fromBox N/A N/A name strings objects proto N/A N/A N/A 
        Given an argument name and an AMP box containing serialized values,
        extract one or more Python objects and add them to the C{objects}
        dictionary.

        @param name: The name associated with this argument.  Most commonly,
            this is the key which can be used to find a serialized value in
            C{strings} and which should be used as the key in C{objects} to
            associate with a structured Python object.
        @type name: C{str}

        @param strings: The AMP box from which to extract one or more
            values.
        @type strings: C{dict}

        @param objects: The output dictionary to populate with the value for
            this argument.
        @type objects: C{dict}

        @param proto: The protocol instance which received the AMP box being
            interpreted.  Most likely this is an instance of L{AMP}, but
            this is not guaranteed.

        @return: C{None}
         N/A toBox N/A N/A name strings objects proto N/A N/A N/A 
        Given an argument name and a dictionary containing structured Python
        objects, serialize values into one or more strings and add them to
        the C{strings} dictionary.

        @param name: The name associated with this argument.  Most commonly,
            this is the key which can be used to find an object in
            C{objects} and which should be used as the key in C{strings} to
            associate with a C{str} giving the serialized form of that
            object.
        @type name: C{str}

        @param strings: The AMP box into which to insert one or more
            strings.
        @type strings: C{dict}

        @param objects: The input dictionary from which to extract Python
            objects to serialize.
        @type objects: C{dict}

        @param proto: The protocol instance which will send the AMP box once
            it is fully populated.  Most likely this is an instance of
            L{AMP}, but this is not guaranteed.

        @return: C{None}
         N/A N/A IBoxSender N/A Interface N/A N/A 
    A transport which can send L{AmpBox} objects.
     sendBox N/A N/A box N/A N/A N/A 
        Send an L{AmpBox}.

        @raise ProtocolSwitched: if the underlying protocol has been
        switched.

        @raise ConnectionLost: if the underlying connection has already been
        lost.
         N/A unhandledError N/A N/A failure N/A N/A N/A 
        An unhandled error occurred in response to a box.  Log it
        appropriately.

        @param failure: a L{Failure} describing the error that occurred.
         N/A N/A IBoxReceiver N/A Interface N/A N/A 
    An application object which can receive L{AmpBox} objects and dispatch them
    appropriately.
     startReceivingBoxes N/A N/A boxSender N/A N/A N/A 
        The L{ampBoxReceived} method will start being called; boxes may be
        responded to by responding to the given L{IBoxSender}.

        @param boxSender: an L{IBoxSender} provider.
         N/A ampBoxReceived N/A N/A box N/A N/A N/A 
        A box was received from the transport; dispatch it appropriately.
         N/A stopReceivingBoxes N/A N/A reason N/A N/A N/A 
        No further boxes will be received on this connection.

        @type reason: L{Failure}
         N/A N/A IResponderLocator N/A Interface N/A N/A 
    An application object which can look up appropriate responder methods for
    AMP commands.
     locateResponder N/A N/A name N/A N/A N/A 
        Locate a responder method appropriate for the named command.

        @param name: the wire-level name (commandName) of the AMP command to be
        responded to.

        @return: a 1-argument callable that takes an L{AmpBox} with argument
        values for the given command, and returns an L{AmpBox} containing
        argument values for the named command, or a L{Deferred} that fires the
        same.
         N/A N/A AmpError N/A Exception N/A N/A 
    Base class of all Amp-related exceptions.
     N/A ProtocolSwitched N/A Exception N/A N/A 
    Connections which have been switched to other protocols can no longer
    accept traffic at the AMP level.  This is raised when you try to send it.
     N/A OnlyOneTLS N/A AmpError N/A N/A 
    This is an implementation limitation; TLS may only be started once per
    connection.
     N/A NoEmptyBoxes N/A AmpError N/A N/A 
    You can't have empty boxes on the connection.  This is raised when you
    receive or attempt to send one.
     N/A InvalidSignature N/A AmpError N/A N/A 
    You didn't pass all the required arguments.
     N/A TooLong N/A AmpError N/A N/A 
    One of the protocol's length limitations was violated.

    @ivar isKey: true if the string being encoded in a key position, false if
    it was in a value position.

    @ivar isLocal: Was the string encoded locally, or received too long from
    the network?  (It's only physically possible to encode "too long" values on
    the network for keys.)

    @ivar value: The string that was too long.

    @ivar keyName: If the string being encoded was in a value position, what
    key was it being encoded for?
     __init__ N/A N/A self isKey isLocal value keyName N/A None N/A N/A N/A N/A AmpError __init__ self N/A N/A self isKey isKey N/A N/A self isLocal isLocal N/A N/A self value value N/A N/A self keyName keyName N/A __repr__ N/A N/A self N/A N/A N/A hdr N/A N/A N/A self isKey key value N/A N/A N/A self isKey N/A N/A hdr N/A N/A repr N/A self keyName N/A lcl N/A N/A N/A self isLocal local remote N/A N/A %s %s too long: %d N/A lcl hdr N/A len N/A self value N/A N/A BadLocalReturn N/A AmpError N/A N/A 
    A bad value was returned from a local command; we were unable to coerce it.
     __init__ N/A N/A self message enclosed N/A N/A N/A N/A N/A AmpError __init__ self N/A N/A self message message N/A N/A self enclosed enclosed N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A N/A self message N/A N/A N/A self enclosed getBriefTraceback N/A N/A __str__ __repr__ N/A RemoteAmpError N/A AmpError N/A N/A 
    This error indicates that something went wrong on the remote end of the
    connection, and the error was serialized and transmitted to you.
     __init__ N/A N/A self errorCode description fatal local N/A False None N/A N/A Create a remote error with an error code and description.

        @param errorCode: the AMP error code of this error.

        @param description: some text to show to the user.

        @param fatal: a boolean, true if this error should terminate the
        connection.

        @param local: a local Failure, if one exists.
         N/A local N/A N/A localwhat  (local) N/A othertb N/A N/A local getBriefTraceback N/A N/A localwhat N/A othertb N/A N/A N/A Exception __init__ self N/A Code<%s>%s: %s%s N/A errorCode localwhat description othertb N/A N/A self local local N/A N/A self errorCode errorCode N/A N/A self description description N/A N/A self fatal fatal N/A N/A UnknownRemoteError N/A RemoteAmpError N/A N/A 
    This means that an error whose type we can't identify was raised from the
    other side.
     __init__ N/A N/A self description N/A N/A N/A errorCode UNKNOWN_ERROR_CODE N/A N/A N/A RemoteAmpError __init__ self errorCode description N/A N/A MalformedAmpBox N/A AmpError N/A N/A 
    This error indicates that the wire-level protocol was malformed.
     N/A UnhandledCommand N/A AmpError N/A N/A 
    A command received via amp could not be dispatched.
     N/A IncompatibleVersions N/A AmpError N/A N/A 
    It was impossible to negotiate a compatible version of the protocol with
    the other end of the connection.
     N/A N/A PROTOCOL_ERRORS N/A UNHANDLED_ERROR_CODE UnhandledCommand AmpBox N/A dict N/A N/A 
    I am a packet in the AMP protocol, much like a regular str:str dictionary.
     N/A __slots__ N/A copy N/A N/A self N/A N/A N/A 
        Return another AmpBox just like me.
         N/A newBox N/A N/A self __class__ N/A N/A N/A newBox update self N/A newBox N/A serialize N/A N/A self N/A N/A N/A 
        Convert me into a wire-encoded string.

        @return: a str encoded according to the rules described in the module
        docstring.
         N/A i N/A N/A self items N/A N/A N/A i sort N/A L N/A N/A w N/A L append N/A N/A k v i N/A N/A N/A N/A type k unicode N/A N/A N/A TypeError N/A Unicode key not allowed: %r k N/A N/A N/A type v unicode N/A N/A N/A TypeError N/A Unicode value for key %r not allowed: %r N/A k v N/A N/A N/A len k MAX_KEY_LENGTH N/A N/A N/A TooLong True True k None N/A N/A N/A len v MAX_VALUE_LENGTH N/A N/A N/A TooLong False True v k N/A kv N/A k v N/A N/A N/A w N/A pack !H N/A len kv N/A N/A w kv N/A N/A w N/A pack !H 0 N/A N/A N/A join L N/A _sendTo N/A N/A self proto N/A N/A N/A 
        Serialize and send this box to a Amp instance.  By the time it is being
        sent, several keys are required.  I must have exactly ONE of::

            _ask
            _answer
            _error

        If the '_ask' key is set, then the '_command' key must also be
        set.

        @param proto: an AMP instance.
         N/A N/A N/A proto sendBox self N/A __repr__ N/A N/A self N/A N/A N/A N/A AmpBox(%s) N/A N/A N/A dict __repr__ self N/A N/A N/A Box AmpBox QuitBox N/A AmpBox N/A N/A 
    I am an AmpBox that, upon being sent, terminates the connection.
     N/A __slots__ N/A __repr__ N/A N/A self N/A N/A N/A N/A QuitBox(**%s) N/A N/A N/A N/A super QuitBox self __repr__ N/A _sendTo N/A N/A self proto N/A N/A N/A 
        Immediately call loseConnection after sending.
         N/A N/A N/A N/A super QuitBox self _sendTo proto N/A N/A N/A N/A proto transport loseConnection N/A N/A _SwitchBox N/A AmpBox N/A N/A 
    Implementation detail of ProtocolSwitchCommand: I am a AmpBox which sets
    up state for the protocol to switch.
     __init__ N/A N/A self innerProto N/A kw N/A N/A 
        Create a _SwitchBox with the protocol to switch to after being sent.

        @param innerProto: the protocol instance to switch to.
        @type innerProto: an IProtocol provider.
         N/A N/A N/A N/A super _SwitchBox self __init__ kw N/A N/A self innerProto innerProto N/A __repr__ N/A N/A self N/A N/A N/A N/A _SwitchBox(%r, **%s) N/A N/A self innerProto N/A N/A dict __repr__ self N/A _sendTo N/A N/A self proto N/A N/A N/A 
        Send me; I am the last box on the connection.  All further traffic will be
        over the new protocol.
         N/A N/A N/A N/A super _SwitchBox self _sendTo proto N/A N/A N/A proto _lockForSwitch N/A N/A N/A proto _switchTo N/A self innerProto N/A N/A BoxDispatcher N/A N/A N/A 
    A L{BoxDispatcher} dispatches '_ask', '_answer', and '_error' L{AmpBox}es,
    both incoming and outgoing, to their appropriate destinations.

    Outgoing commands are converted into L{Deferred}s and outgoing boxes, and
    associated tracking state to fire those L{Deferred} when '_answer' boxes
    come back.  Incoming '_answer' and '_error' boxes are converted into
    callbacks and errbacks on those L{Deferred}s, respectively.

    Incoming '_ask' boxes are converted into method calls on a supplied method
    locator.

    @ivar _outstandingRequests: a dictionary mapping request IDs to
    L{Deferred}s which were returned for those requests.

    @ivar locator: an object with a L{locateResponder} method that locates a
    responder function that takes a Box and returns a result (either a Box or a
    Deferred which fires one).

    @ivar boxSender: an object which can send boxes, via the L{_sendBox}
    method, such as an L{AMP} instance.
    @type boxSender: L{IBoxSender}
     N/A N/A implements IBoxReceiver N/A _failAllReason None N/A _outstandingRequests None N/A _counter 0 N/A boxSender None __init__ N/A N/A self locator N/A N/A N/A N/A self _outstandingRequests N/A N/A N/A self locator locator N/A startReceivingBoxes N/A N/A self boxSender N/A N/A N/A 
        The given boxSender is going to start calling boxReceived on this
        L{BoxDispatcher}.

        @param boxSender: The L{IBoxSender} to send command responses to.
         N/A N/A self boxSender boxSender N/A stopReceivingBoxes N/A N/A self reason N/A N/A N/A 
        No further boxes will be received here.  Terminate all currently
        oustanding command deferreds with the given reason.
         N/A N/A N/A self failAllOutgoing reason N/A failAllOutgoing N/A N/A self reason N/A N/A N/A 
        Call the errback on all outstanding requests awaiting responses.

        @param reason: the Failure instance to pass to those errbacks.
         N/A N/A self _failAllReason reason N/A OR N/A N/A N/A self _outstandingRequests items N/A N/A self _outstandingRequests None N/A N/A key value OR N/A N/A N/A N/A value errback reason N/A _nextTag N/A N/A self N/A N/A N/A 
        Generate protocol-local serial numbers for _ask keys.

        @return: a string that has not yet been used on this connection.
         N/A N/A self _counter 1 N/A N/A %x N/A N/A self _counter N/A _sendBoxCommand N/A N/A self command box requiresAnswer N/A True N/A N/A 
        Send a command across the wire with the given C{amp.Box}.

        Mutate the given box to give it any additional keys (_command, _ask)
        required for the command and request/response machinery, then send it.

        If requiresAnswer is True, returns a C{Deferred} which fires when a
        response is received. The C{Deferred} is fired with an C{amp.Box} on
        success, or with an C{amp.RemoteAmpError} if an error is received.

        If the Deferred fails and the error is not handled by the caller of
        this method, the failure will be logged and the connection dropped.

        @param command: a str, the name of the command to issue.

        @param box: an AmpBox with the arguments for the command.

        @param requiresAnswer: a boolean.  Defaults to True.  If True, return a
        Deferred which will fire when the other side responds to this command.
        If False, return None and do not ask the other side for acknowledgement.

        @return: a Deferred which fires the AmpBox that holds the response to
        this command, or None, as specified by requiresAnswer.

        @raise ProtocolSwitched: if the protocol has been switched.
         N/A N/A N/A self _failAllReason None N/A N/A N/A fail N/A self _failAllReason N/A N/A box N/A COMMAND command N/A tag N/A N/A self _nextTag N/A requiresAnswer N/A N/A N/A box N/A ASK tag N/A N/A N/A box _sendTo N/A self boxSender N/A requiresAnswer N/A N/A result N/A N/A self _outstandingRequests N/A tag N/A Deferred N/A N/A result None N/A result N/A callRemoteString N/A N/A self command requiresAnswer N/A True kw N/A N/A 
        This is a low-level API, designed only for optimizing simple messages
        for which the overhead of parsing is too great.

        @param command: a str naming the command.

        @param kw: arguments to the amp box.

        @param requiresAnswer: a boolean.  Defaults to True.  If True, return a
        Deferred which will fire when the other side responds to this command.
        If False, return None and do not ask the other side for acknowledgement.

        @return: a Deferred which fires the AmpBox that holds the response to
        this command, or None, as specified by requiresAnswer.
         N/A box N/A Box kw N/A N/A N/A self _sendBoxCommand command box requiresAnswer N/A callRemote N/A N/A self commandType N/A a kw N/A N/A 
        This is the primary high-level API for sending messages via AMP.  Invoke it
        with a command and appropriate arguments to send a message to this
        connection's peer.

        @param commandType: a subclass of Command.
        @type commandType: L{type}

        @param a: Positional (special) parameters taken by the command.
        Positional parameters will typically not be sent over the wire.  The
        only command included with AMP which uses positional parameters is
        L{ProtocolSwitchCommand}, which takes the protocol that will be
        switched to as its first argument.

        @param kw: Keyword arguments taken by the command.  These are the
        arguments declared in the command's 'arguments' attribute.  They will
        be encoded and sent to the peer as arguments for the L{commandType}.

        @return: If L{commandType} has a C{requiresAnswer} attribute set to
        L{False}, then return L{None}.  Otherwise, return a L{Deferred} which
        fires with a dictionary of objects representing the result of this
        call.  Additionally, this L{Deferred} may fail with an exception
        representing a connection failure, with L{UnknownRemoteError} if the
        other end of the connection fails for an unknown reason, or with any
        error specified as a key in L{commandType}'s C{errors} dictionary.
         N/A N/A N/A co N/A commandType a kw N/A N/A N/A N/A N/A fail N/A N/A N/A co _doCommand self N/A unhandledError N/A N/A self failure N/A N/A N/A 
        This is a terminal callback called after application code has had a
        chance to quash any errors.
         N/A N/A N/A N/A self boxSender unhandledError failure N/A _answerReceived N/A N/A self box N/A N/A N/A 
        An AMP box was received that answered a command previously sent with
        L{callRemote}.

        @param box: an AmpBox with a value for its L{ANSWER} key.
         N/A question N/A N/A N/A self _outstandingRequests pop N/A box N/A ANSWER N/A N/A N/A question addErrback N/A self unhandledError N/A N/A N/A question callback box N/A _errorReceived N/A N/A self box N/A N/A N/A 
        An AMP box was received that answered a command previously sent with
        L{callRemote}, with an error.

        @param box: an L{AmpBox} with a value for its L{ERROR}, L{ERROR_CODE},
        and L{ERROR_DESCRIPTION} keys.
         N/A question N/A N/A N/A self _outstandingRequests pop N/A box N/A ERROR N/A N/A N/A question addErrback N/A self unhandledError N/A errorCode N/A box N/A ERROR_CODE N/A description N/A box N/A ERROR_DESCRIPTION N/A N/A errorCode PROTOCOL_ERRORS N/A N/A exc N/A N/A PROTOCOL_ERRORS N/A errorCode errorCode description N/A N/A exc N/A RemoteAmpError errorCode description N/A N/A N/A question errback N/A Failure exc N/A _commandReceived N/A N/A self box N/A N/A N/A 
        @param box: an L{AmpBox} with a value for its L{COMMAND} and L{ASK}
        keys.
         formatAnswer N/A N/A answerBox N/A N/A N/A N/A answerBox N/A ANSWER N/A box N/A ASK N/A answerBox N/A formatError N/A N/A error N/A N/A N/A N/A N/A error check RemoteAmpError N/A N/A code N/A N/A error value errorCode N/A desc N/A N/A error value description N/A N/A N/A error value fatal N/A N/A errorBox N/A QuitBox N/A N/A errorBox N/A AmpBox N/A N/A errorBox N/A QuitBox N/A N/A N/A log err error N/A code UNKNOWN_ERROR_CODE N/A desc Unknown Error N/A N/A errorBox N/A ERROR N/A box N/A ASK N/A N/A errorBox N/A ERROR_DESCRIPTION desc N/A N/A errorBox N/A ERROR_CODE code N/A errorBox N/A N/A deferred N/A N/A self dispatchCommand box N/A N/A ASK box N/A N/A N/A N/A deferred addCallbacks formatAnswer formatError N/A N/A N/A deferred addCallback N/A self _safeEmit N/A N/A N/A deferred addErrback N/A self unhandledError N/A ampBoxReceived N/A N/A self box N/A N/A N/A 
        An AmpBox was received, representing a command, or an answer to a
        previously issued command (either successful or erroneous).  Respond to
        it according to its contents.

        @param box: an AmpBox

        @raise NoEmptyBoxes: when a box is received that does not contain an
        '_answer', '_command' / '_ask', or '_error' key; i.e. one which does not
        fit into the command / response protocol defined by AMP.
         N/A N/A ANSWER box N/A N/A N/A N/A self _answerReceived box N/A N/A N/A ERROR box N/A N/A N/A N/A self _errorReceived box N/A N/A N/A COMMAND box N/A N/A N/A N/A self _commandReceived box N/A N/A N/A NoEmptyBoxes box N/A _safeEmit N/A N/A self aBox N/A N/A N/A 
        Emit a box, ignoring L{ProtocolSwitched} and L{ConnectionLost} errors
        which cannot be usefully handled.
         N/A N/A N/A N/A N/A aBox _sendTo N/A self boxSender N/A N/A N/A N/A ProtocolSwitched ConnectionLost N/A N/A N/A dispatchCommand N/A N/A self box N/A N/A N/A 
        A box with a _command key was received.

        Dispatch it to a local handler call it.

        @param proto: an AMP instance.
        @param box: an AmpBox to be dispatched.
         N/A cmd N/A box N/A COMMAND N/A responder N/A N/A N/A self locator locateResponder cmd N/A N/A responder None N/A N/A N/A fail N/A RemoteAmpError UNHANDLED_ERROR_CODE N/A Unhandled Command: %r N/A cmd False local N/A Failure N/A UnhandledCommand N/A N/A maybeDeferred responder box N/A N/A CommandLocator N/A N/A N/A 
    A L{CommandLocator} is a collection of responders to AMP L{Command}s, with
    the help of the L{Command.responder} decorator.
     __metaclass__ N/A type N/A N/A 
        This metaclass keeps track of all of the Command.responder-decorated
        methods defined since the last CommandLocator subclass was defined.  It
        assumes (usually correctly, but unfortunately not necessarily so) that
        those commands responders were all declared as methods of the class
        being defined.  Note that this list can be incorrect if users use the
        Command.responder decorator outside the context of a CommandLocator
        class declaration.

        Command responders defined on subclasses are given precedence over
        those inherited from a base class.

        The Command.responder decorator explicitly cooperates with this
        metaclass.
         N/A _currentClassCommands N/A __new__ N/A N/A cls name bases attrs N/A N/A N/A commands N/A N/A cls _currentClassCommands N/A N/A N/A N/A cls _currentClassCommands N/A N/A N/A cd N/A attrs N/A _commandDispatch N/A N/A subcls N/A N/A type __new__ cls name bases attrs N/A ancestors N/A list N/A N/A subcls __mro__ N/A 1 N/A N/A N/A ancestors reverse N/A ancestor ancestors N/A N/A N/A N/A cd update N/A getattr ancestor _commandDispatch N/A N/A N/A commandClass responderFunc commands N/A N/A N/A cd N/A N/A commandClass commandName N/A commandClass responderFunc N/A N/A bases N/A N/A subcls lookupFunction N/A CommandLocator lookupFunction N/A locateResponder N/A N/A self name N/A N/A N/A N/A N/A warnings warn Override locateResponder, not lookupFunction. category PendingDeprecationWarning stacklevel 2 N/A N/A N/A self lookupFunction name N/A N/A N/A subcls locateResponder locateResponder N/A subcls N/A N/A N/A N/A implements IResponderLocator _wrapWithSerialization N/A N/A self aCallable command N/A N/A N/A 
        Wrap aCallable with its command's argument de-serialization
        and result serialization logic.

        @param aCallable: a callable with a 'command' attribute, designed to be
        called with keyword arguments.

        @param command: the command class whose serialization to use.

        @return: a 1-arg callable which, when invoked with an AmpBox, will
        deserialize the argument list and invoke appropriate user code for the
        callable's command, returning a Deferred which fires with the result or
        fails with an error.
         doit N/A N/A box N/A N/A N/A kw N/A N/A command parseArguments box self checkKnownErrors N/A N/A error N/A N/A N/A key N/A N/A error trap N/A command allErrors N/A code N/A N/A command allErrors N/A key N/A desc N/A str N/A error value N/A N/A Failure N/A RemoteAmpError code desc N/A key N/A command fatalErrors local error N/A makeResponseFor N/A N/A objects N/A N/A N/A N/A N/A N/A N/A command makeResponse objects self N/A N/A N/A N/A originalFailure N/A Failure N/A N/A BadLocalReturn N/A %r returned %r and %r could not serialize it N/A aCallable objects command originalFailure N/A N/A N/A N/A N/A N/A N/A maybeDeferred aCallable kw addCallback makeResponseFor addErrback checkKnownErrors N/A N/A doit N/A lookupFunction N/A N/A self name N/A N/A N/A 
        Deprecated synonym for L{locateResponder}
         N/A N/A N/A N/A self __class__ lookupFunction N/A CommandLocator lookupFunction N/A N/A N/A N/A CommandLocator locateResponder self name N/A N/A N/A N/A warnings warn Call locateResponder, not lookupFunction. category PendingDeprecationWarning stacklevel 2 N/A N/A N/A self locateResponder name N/A locateResponder N/A N/A self name N/A N/A N/A 
        Locate a callable to invoke when executing the named command.

        @param name: the normalized name (from the wire) of the command.

        @return: a 1-argument function that takes a Box and returns a box or a
        Deferred which fires a Box, for handling the command identified by the
        given name, or None, if no appropriate responder can be found.
         N/A cd N/A self _commandDispatch N/A N/A name cd N/A N/A N/A commandClass responderFunc N/A cd N/A name N/A responderMethod N/A N/A types MethodType responderFunc self N/A self __class__ N/A N/A N/A self _wrapWithSerialization responderMethod commandClass N/A N/A SimpleStringLocator N/A object N/A N/A 
    Implement the L{locateResponder} method to do simple, string-based
    dispatch.
     N/A N/A implements IResponderLocator N/A baseDispatchPrefix amp_ locateResponder N/A N/A self name N/A N/A N/A 
        Locate a callable to invoke when executing the named command.

        @return: a function with the name C{"amp_" + name} on L{self}, or None
        if no such function exists.  This function will then be called with the
        L{AmpBox} itself as an argument.

        @param name: the normalized name (from the wire) of the command.
         N/A fName N/A N/A self baseDispatchPrefix N/A N/A name upper N/A N/A getattr self fName None N/A N/A N/A PYTHON_KEYWORDS N/A and del for is raise assert elif from lambda return break else global not try class except if or while continue exec import pass yield def finally in print _wireNameToPythonIdentifier N/A N/A key N/A N/A N/A 
    (Private) Normalize an argument name from the wire for use with Python
    code.  If the return value is going to be a python keyword it will be
    capitalized.  If it contains any dashes they will be replaced with
    underscores.

    The rationale behind this method is that AMP should be an inherently
    multi-language protocol, so message keys may contain all manner of bizarre
    bytes.  This is not a complete solution; there are still forms of arguments
    that this implementation will be unable to parse.  However, Python
    identifiers share a huge raft of properties with identifiers from many
    other languages, so this is a 'good enough' effort for now.  We deal
    explicitly with dashes because that is the most likely departure: Lisps
    commonly use dashes to separate method names, so protocols initially
    implemented in a lisp amp dialect may use dashes in argument or command
    names.

    @param key: a str, looking something like 'foo-bar-baz' or 'from'

    @return: a str which is a valid python identifier, looking something like
    'foo_bar_baz' or 'From'.
     N/A lkey N/A N/A key replace - _ N/A N/A lkey PYTHON_KEYWORDS N/A N/A N/A N/A lkey title N/A lkey N/A Argument N/A N/A N/A 
    Base-class of all objects that take values from Amp packets and convert
    them into objects for Python functions.

    This implementation of L{IArgumentType} provides several higher-level
    hooks for subclasses to override.  See L{toString} and L{fromString}
    which will be used to define the behavior of L{IArgumentType.toBox} and
    L{IArgumentType.fromBox}, respectively.
     N/A N/A implements IArgumentType N/A optional False __init__ N/A N/A self optional N/A False N/A N/A 
        Create an Argument.

        @param optional: a boolean indicating whether this argument can be
        omitted in the protocol.
         N/A N/A self optional optional N/A retrieve N/A N/A self d name proto N/A N/A N/A 
        Retrieve the given key from the given dictionary, removing it if found.

        @param d: a dictionary.

        @param name: a key in L{d}.

        @param proto: an instance of an AMP.

        @raise KeyError: if I am not optional and no value was found.

        @return: d[name].
         N/A N/A self optional N/A N/A value N/A N/A d get name N/A N/A value None N/A N/A N/A d N/A name N/A N/A value N/A N/A d pop name N/A value N/A fromBox N/A N/A self name strings objects proto N/A N/A N/A 
        Populate an 'out' dictionary with mapping names to Python values
        decoded from an 'in' AmpBox mapping strings to string values.

        @param name: the argument name to retrieve
        @type name: str

        @param strings: The AmpBox to read string(s) from, a mapping of
        argument names to string values.
        @type strings: AmpBox

        @param objects: The dictionary to write object(s) to, a mapping of
        names to Python objects.
        @type objects: dict

        @param proto: an AMP instance.
         N/A st N/A N/A self retrieve strings name proto N/A nk N/A _wireNameToPythonIdentifier name N/A N/A N/A self optional N/A st None N/A N/A N/A objects N/A nk None N/A N/A N/A objects N/A nk N/A N/A self fromStringProto st proto N/A toBox N/A N/A self name strings objects proto N/A N/A N/A 
        Populate an 'out' AmpBox with strings encoded from an 'in' dictionary
        mapping names to Python values.

        @param name: the argument name to retrieve
        @type name: str

        @param strings: The AmpBox to write string(s) to, a mapping of
        argument names to string values.
        @type strings: AmpBox

        @param objects: The dictionary to read object(s) from, a mapping of
        names to Python objects.

        @type objects: dict

        @param proto: the protocol we are converting for.
        @type proto: AMP
         N/A obj N/A N/A self retrieve objects N/A _wireNameToPythonIdentifier name proto N/A N/A N/A self optional N/A obj None N/A N/A N/A N/A N/A strings N/A name N/A N/A self toStringProto obj proto N/A fromStringProto N/A N/A self inString proto N/A N/A N/A 
        Convert a string to a Python value.

        @param inString: the string to convert.

        @param proto: the protocol we are converting for.
        @type proto: AMP

        @return: a Python object.
         N/A N/A N/A self fromString inString N/A toStringProto N/A N/A self inObject proto N/A N/A N/A 
        Convert a Python object to a string.

        @param inObject: the object to convert.

        @param proto: the protocol we are converting for.
        @type proto: AMP
         N/A N/A N/A self toString inObject N/A fromString N/A N/A self inString N/A N/A N/A 
        Convert a string to a Python object.  Subclasses must implement this.

        @param inString: the string to convert.
        @type inString: str

        @return: the decoded value from inString
         N/A toString N/A N/A self inObject N/A N/A N/A 
        Convert a Python object into a string for passing over the network.

        @param inObject: an object of the type that this Argument is intended
        to deal with.

        @return: the wire encoding of inObject
        @rtype: str
         N/A N/A Integer N/A Argument N/A N/A 
    Encode any integer values of any size on the wire as the string
    representation.

    Example: C{123} becomes C{"123"}
     N/A fromString int toString N/A N/A self inObject N/A N/A N/A N/A str N/A int inObject N/A N/A String N/A Argument N/A N/A 
    Don't do any conversion at all; just pass through 'str'.
     toString N/A N/A self inObject N/A N/A N/A inObject N/A fromString N/A N/A self inString N/A N/A N/A inString N/A N/A Float N/A Argument N/A N/A 
    Encode floating-point values on the wire as their repr.
     N/A fromString float N/A toString repr N/A Boolean N/A Argument N/A N/A 
    Encode True or False as "True" or "False" on the wire.
     fromString N/A N/A self inString N/A N/A N/A N/A inString True N/A N/A True N/A N/A N/A inString False N/A N/A False N/A N/A N/A TypeError N/A Bad boolean value: %r N/A inString N/A toString N/A N/A self inObject N/A N/A N/A inObject N/A N/A True N/A N/A False N/A N/A Unicode N/A String N/A N/A 
    Encode a unicode string on the wire as UTF-8.
     toString N/A N/A self inObject N/A N/A N/A N/A N/A String toString self N/A N/A inObject encode utf-8 N/A fromString N/A N/A self inString N/A N/A N/A N/A N/A N/A N/A String fromString self inString decode utf-8 N/A N/A Path N/A Unicode N/A N/A 
    Encode and decode L{filepath.FilePath} instances as paths on the wire.

    This is really intended for use with subprocess communication tools:
    exchanging pathnames on different machines over a network is not generally
    meaningful, but neither is it disallowed; you can use this to communicate
    about NFS paths, for example.
     fromString N/A N/A self inString N/A N/A N/A N/A N/A filepath FilePath N/A N/A Unicode fromString self inString N/A toString N/A N/A self inObject N/A N/A N/A N/A N/A Unicode toString self N/A inObject path N/A N/A ListOf N/A Argument N/A N/A 
    Encode and decode lists of instances of a single other argument type.

    For example, if you want to pass::

        [3, 7, 9, 15]

    You can create an argument like this::

        ListOf(Integer())

    The serialized form of the entire list is subject to the limit imposed by
    L{MAX_VALUE_LENGTH}.  List elements are represented as 16-bit length
    prefixed strings.  The argument type passed to the L{ListOf} initializer is
    responsible for producing the serialized form of each element.

    @ivar elementType: The L{Argument} instance used to encode and decode list
        elements (note, not an arbitrary L{IArgument} implementation:
        arguments must be implemented using only the C{fromString} and
        C{toString} methods, not the C{fromBox} and C{toBox} methods).

    @param optional: a boolean indicating whether this argument can be
        omitted in the protocol.

    @since: 10.0
     __init__ N/A N/A self elementType optional N/A False N/A N/A N/A self elementType elementType N/A N/A N/A Argument __init__ self optional N/A fromString N/A N/A self inString N/A N/A N/A 
        Convert the serialized form of a list of instances of some type back
        into that list.
         N/A strings N/A N/A parser N/A Int16StringReceiver N/A N/A parser stringReceived N/A strings append N/A N/A N/A parser dataReceived inString N/A N/A map N/A N/A self elementType fromString strings N/A toString N/A N/A self inObject N/A N/A N/A 
        Serialize the given list of objects to a single string.
         N/A strings N/A N/A obj inObject N/A N/A serialized N/A N/A N/A self elementType toString obj N/A N/A N/A strings append N/A pack !H N/A len serialized N/A N/A N/A strings append serialized N/A N/A N/A join strings N/A N/A AmpList N/A Argument N/A N/A 
    Convert a list of dictionaries into a list of AMP boxes on the wire.

    For example, if you want to pass::

        [{'a': 7, 'b': u'hello'}, {'a': 9, 'b': u'goodbye'}]

    You might use an AmpList like this in your arguments or response list::

        AmpList([('a', Integer()),
                 ('b', Unicode())])
     __init__ N/A N/A self subargs optional N/A False N/A N/A 
        Create an AmpList.

        @param subargs: a list of 2-tuples of ('name', argument) describing the
        schema of the dictionaries in the sequence of amp boxes.

        @param optional: a boolean indicating whether this argument can be
        omitted in the protocol.
         N/A N/A self subargs subargs N/A N/A N/A Argument __init__ self optional N/A fromStringProto N/A N/A self inString proto N/A N/A N/A boxes N/A parseString inString N/A values N/A N/A _stringsToObjects box N/A self subargs proto N/A box boxes N/A values N/A toStringProto N/A N/A self inObject proto N/A N/A N/A N/A N/A join N/A N/A N/A N/A _objectsToStrings objects N/A self subargs N/A Box proto serialize N/A objects inObject N/A N/A Descriptor N/A Integer N/A N/A 
    Encode and decode file descriptors for exchange over a UNIX domain socket.

    This argument type requires an AMP connection set up over an
    L{IUNIXTransport<twisted.internet.interfaces.IUNIXTransport>} provider (for
    example, the kind of connection created by
    L{IReactorUNIX.connectUNIX<twisted.internet.interfaces.IReactorUNIX.connectUNIX>}
    and L{UNIXClientEndpoint<twisted.internet.endpoints.UNIXClientEndpoint>}).

    There is no correspondence between the integer value of the file descriptor
    on the sending and receiving sides, therefore an alternate approach is taken
    to matching up received descriptors with particular L{Descriptor}
    parameters.  The argument is encoded to an ordinal (unique per connection)
    for inclusion in the AMP command or response box.  The descriptor itself is
    sent using
    L{IUNIXTransport.sendFileDescriptor<twisted.internet.interfaces.IUNIXTransport.sendFileDescriptor>}.
    The receiver uses the order in which file descriptors are received and the
    ordinal value to come up with the received copy of the descriptor.
     fromStringProto N/A N/A self inString proto N/A N/A N/A 
        Take a unique identifier associated with a file descriptor which must
        have been received by now and use it to look up that descriptor in a
        dictionary where they are kept.

        @param inString: The base representation (as a byte string) of an
            ordinal indicating which file descriptor corresponds to this usage
            of this argument.
        @type inString: C{str}

        @param proto: The protocol used to receive this descriptor.  This
            protocol must be connected via a transport providing
            L{IUNIXTransport<twisted.internet.interfaces.IUNIXTransport>}.
        @type proto: L{BinaryBoxProtocol}

        @return: The file descriptor represented by C{inString}.
        @rtype: C{int}
         N/A N/A N/A proto _getDescriptor N/A int inString N/A toStringProto N/A N/A self inObject proto N/A N/A N/A 
        Send C{inObject}, an integer file descriptor, over C{proto}'s connection
        and return a unique identifier which will allow the receiver to
        associate the file descriptor with this argument.

        @param inObject: A file descriptor to duplicate over an AMP connection
            as the value for this argument.
        @type inObject: C{int}

        @param proto: The protocol which will be used to send this descriptor.
            This protocol must be connected via a transport providing
            L{IUNIXTransport<twisted.internet.interfaces.IUNIXTransport>}.

        @return: A byte string which can be used by the receiver to reconstruct
            the file descriptor.
        @type: C{str}
         N/A identifier N/A N/A proto _sendFileDescriptor inObject N/A outString N/A N/A Integer toStringProto self identifier proto N/A outString N/A N/A Command N/A N/A N/A 
    Subclass me to specify an AMP Command.

    @cvar arguments: A list of 2-tuples of (name, Argument-subclass-instance),
    specifying the names and values of the parameters which are required for
    this command.

    @cvar response: A list like L{arguments}, but instead used for the return
    value.

    @cvar errors: A mapping of subclasses of L{Exception} to wire-protocol tags
    for errors represented as L{str}s.  Responders which raise keys from this
    dictionary will have the error translated to the corresponding tag on the
    wire.  Invokers which receive Deferreds from invoking this command with
    L{AMP.callRemote} will potentially receive Failures with keys from this
    mapping as their value.  This mapping is inherited; if you declare a
    command which handles C{FooError} as 'FOO_ERROR', then subclass it and
    specify C{BarError} as 'BAR_ERROR', responders to the subclass may raise
    either C{FooError} or C{BarError}, and invokers must be able to deal with
    either of those exceptions.

    @cvar fatalErrors: like 'errors', but errors in this list will always
    terminate the connection, despite being of a recognizable error type.

    @cvar commandType: The type of Box used to issue commands; useful only for
    protocol-modifying behavior like startTLS or protocol switching.  Defaults
    to a plain vanilla L{Box}.

    @cvar responseType: The type of Box used to respond to this command; only
    useful for protocol-modifying behavior like startTLS or protocol switching.
    Defaults to a plain vanilla L{Box}.

    @ivar requiresAnswer: a boolean; defaults to True.  Set it to False on your
    subclass if you want callRemote to return None.  Note: this is a hint only
    to the client side of the protocol.  The return-type of a command responder
    method must always be a dictionary adhering to the contract specified by
    L{response}, because clients are always free to request a response if they
    want one.
     __metaclass__ N/A type N/A N/A 
        Metaclass hack to establish reverse-mappings for 'errors' and
        'fatalErrors' as class vars.
         __new__ N/A N/A cls name bases attrs N/A N/A N/A reverseErrors N/A attrs N/A reverseErrors N/A N/A er N/A attrs N/A allErrors N/A N/A N/A commandName attrs N/A N/A N/A attrs N/A commandName name N/A newtype N/A N/A type __new__ cls name bases attrs N/A errors N/A N/A fatalErrors N/A N/A N/A accumulateClassDict newtype errors errors N/A N/A accumulateClassDict newtype fatalErrors fatalErrors N/A N/A v k N/A N/A errors iteritems N/A N/A N/A reverseErrors N/A k v N/A N/A er N/A v k N/A N/A v k N/A N/A fatalErrors iteritems N/A N/A N/A reverseErrors N/A k v N/A N/A er N/A v k N/A newtype N/A N/A N/A arguments N/A N/A response N/A N/A extra N/A N/A errors N/A N/A fatalErrors N/A N/A commandType Box N/A responseType Box N/A requiresAnswer True __init__ N/A N/A self N/A kw N/A N/A 
        Create an instance of this command with specified values for its
        parameters.

        @param kw: a dict containing an appropriate value for each name
        specified in the L{arguments} attribute of my class.

        @raise InvalidSignature: if you forgot any required arguments.
         N/A N/A self structured kw N/A givenArgs N/A N/A kw keys N/A forgotten N/A N/A N/A name arg N/A self arguments N/A N/A pythonName N/A _wireNameToPythonIdentifier name N/A N/A N/A pythonName givenArgs N/A N/A arg optional N/A N/A N/A N/A forgotten append pythonName N/A forgotten N/A N/A N/A InvalidSignature N/A forgot %s for %s N/A N/A N/A ,  join forgotten N/A self commandName N/A forgotten N/A N/A makeResponse N/A N/A cls objects proto N/A N/A N/A 
        Serialize a mapping of arguments using this L{Command}'s
        response schema.

        @param objects: a dict with keys matching the names specified in
        self.response, having values of the types that the Argument objects in
        self.response can format.

        @param proto: an L{AMP}.

        @return: an L{AmpBox}.
         N/A N/A N/A responseType N/A N/A cls responseType N/A N/A N/A N/A N/A fail N/A N/A _objectsToStrings objects N/A cls response responseType proto N/A N/A makeResponse N/A classmethod makeResponse makeArguments N/A N/A cls objects proto N/A N/A N/A 
        Serialize a mapping of arguments using this L{Command}'s
        argument schema.

        @param objects: a dict with keys similar to the names specified in
        self.arguments, having values of the types that the Argument objects in
        self.arguments can parse.

        @param proto: an L{AMP}.

        @return: An instance of this L{Command}'s C{commandType}.
         N/A allowedNames N/A set N/A N/A argName ignored N/A cls arguments N/A N/A N/A N/A allowedNames add N/A _wireNameToPythonIdentifier argName N/A intendedArg objects N/A N/A N/A intendedArg allowedNames N/A N/A N/A InvalidSignature N/A %s is not a valid argument N/A intendedArg N/A N/A _objectsToStrings objects N/A cls arguments N/A N/A cls commandType proto N/A N/A makeArguments N/A classmethod makeArguments parseResponse N/A N/A cls box protocol N/A N/A N/A 
        Parse a mapping of serialized arguments using this
        L{Command}'s response schema.

        @param box: A mapping of response-argument names to the
        serialized forms of those arguments.
        @param protocol: The L{AMP} protocol.

        @return: A mapping of response-argument names to the parsed
        forms.
         N/A N/A _stringsToObjects box N/A cls response protocol N/A N/A parseResponse N/A classmethod parseResponse parseArguments N/A N/A cls box protocol N/A N/A N/A 
        Parse a mapping of serialized arguments using this
        L{Command}'s argument schema.

        @param box: A mapping of argument names to the seralized forms
        of those arguments.
        @param protocol: The L{AMP} protocol.

        @return: A mapping of argument names to the parsed forms.
         N/A N/A _stringsToObjects box N/A cls arguments protocol N/A N/A parseArguments N/A classmethod parseArguments responder N/A N/A cls methodfunc N/A N/A N/A 
        Declare a method to be a responder for a particular command.

        This is a decorator.

        Use like so::

            class MyCommand(Command):
                arguments = [('a', ...), ('b', ...)]

            class MyProto(AMP):
                def myFunMethod(self, a, b):
                    ...
                MyCommand.responder(myFunMethod)

        Notes: Although decorator syntax is not used within Twisted, this
        function returns its argument and is therefore safe to use with
        decorator syntax.

        This is not thread safe.  Don't declare AMP subclasses in other
        threads.  Don't declare responders outside the scope of AMP subclasses;
        the behavior is undefined.

        @param methodfunc: A function which will later become a method, which
        has a keyword signature compatible with this command's L{argument} list
        and returns a dictionary with a set of keys compatible with this
        command's L{response} list.

        @return: the methodfunc parameter.
         N/A N/A N/A N/A CommandLocator _currentClassCommands append N/A cls methodfunc N/A methodfunc N/A N/A responder N/A classmethod responder _doCommand N/A N/A self proto N/A N/A N/A 
        Encode and send this Command to the given protocol.

        @param proto: an AMP, representing the connection to send to.

        @return: a Deferred which will fire or error appropriately when the
        other side responds to the command (or error if the connection is lost
        before it is responded to).
         _massageError N/A N/A error N/A N/A N/A N/A N/A error trap RemoteAmpError N/A rje N/A error value N/A errorType N/A N/A N/A self reverseErrors get N/A rje errorCode UnknownRemoteError N/A N/A Failure N/A errorType N/A rje description N/A N/A d N/A N/A proto _sendBoxCommand N/A self commandName N/A N/A self makeArguments N/A self structured proto N/A self requiresAnswer N/A N/A self requiresAnswer N/A N/A N/A N/A d addCallback N/A self parseResponse proto N/A N/A N/A d addErrback _massageError N/A d N/A N/A _NoCertificate N/A N/A N/A 
    This is for peers which don't want to use a local certificate.  Used by
    AMP because AMP's internal language is all about certificates and this
    duck-types in the appropriate place; this API isn't really stable though,
    so it's not exposed anywhere public.

    For clients, it will use ephemeral DH keys, or whatever the default is for
    certificate-less clients in OpenSSL.  For servers, it will generate a
    temporary self-signed certificate with garbage values in the DN and use
    that.
     __init__ N/A N/A self client N/A N/A N/A 
        Create a _NoCertificate which either is or isn't for the client side of
        the connection.

        @param client: True if we are a client and should truly have no
        certificate and be anonymous, False if we are a server and actually
        have to generate a temporary certificate.

        @type client: bool
         N/A N/A self client client N/A options N/A N/A self N/A authorities N/A N/A 
        Behaves like L{twisted.internet.ssl.PrivateCertificate.options}().
         N/A N/A N/A self client N/A N/A sharedDN N/A DN CN TEMPORARY CERTIFICATE N/A key N/A N/A KeyPair generate N/A cr N/A N/A key certificateRequest sharedDN N/A sscrd N/A N/A key signCertificateRequest sharedDN cr N/A N/A N/A dn N/A True 1 N/A cert N/A N/A key newCertificate sscrd N/A N/A N/A cert options authorities N/A options N/A dict N/A authorities N/A N/A N/A N/A options update N/A dict verify True requireCertificate True caCerts N/A N/A auth original N/A auth authorities N/A occo N/A CertificateOptions options N/A occo N/A N/A _TLSBox N/A AmpBox N/A N/A 
    I am an AmpBox that, upon being sent, initiates a TLS connection.
     N/A __slots__ N/A __init__ N/A N/A self N/A N/A N/A N/A ssl None N/A N/A N/A RemoteAmpError TLS_ERROR TLS not available N/A N/A N/A AmpBox __init__ self N/A _keyprop N/A N/A k default N/A N/A N/A N/A property N/A N/A N/A self N/A N/A N/A self get k default N/A N/A certificate N/A _keyprop tls_localCertificate N/A _NoCertificate False N/A verify N/A _keyprop tls_verifyAuthorities None _sendTo N/A N/A self proto N/A N/A N/A 
        Send my encoded value to the protocol, then initiate TLS.
         N/A ab N/A AmpBox self N/A k N/A tls_localCertificate tls_verifyAuthorities N/A N/A N/A N/A ab pop k None N/A N/A N/A ab _sendTo proto N/A N/A N/A proto _startTLS N/A self certificate N/A self verify N/A N/A _LocalArgument N/A String N/A N/A 
    Local arguments are never actually relayed across the wire.  This is just a
    shim so that StartTLS can pretend to have some arguments: if arguments
    acquire documentation properties, replace this with something nicer later.
     fromBox N/A N/A self name strings objects proto N/A N/A N/A N/A N/A StartTLS N/A Command N/A N/A 
    Use, or subclass, me to implement a command that starts TLS.

    Callers of StartTLS may pass several special arguments, which affect the
    TLS negotiation:

        - tls_localCertificate: This is a
        twisted.internet.ssl.PrivateCertificate which will be used to secure
        the side of the connection it is returned on.

        - tls_verifyAuthorities: This is a list of
        twisted.internet.ssl.Certificate objects that will be used as the
        certificate authorities to verify our peer's certificate.

    Each of those special parameters may also be present as a key in the
    response dictionary.
     N/A arguments N/A N/A tls_localCertificate N/A _LocalArgument optional True N/A tls_verifyAuthorities N/A _LocalArgument optional True N/A response N/A N/A tls_localCertificate N/A _LocalArgument optional True N/A tls_verifyAuthorities N/A _LocalArgument optional True N/A responseType _TLSBox __init__ N/A N/A self N/A kw N/A N/A 
        Create a StartTLS command.  (This is private.  Use AMP.callRemote.)

        @param tls_localCertificate: the PrivateCertificate object to use to
        secure the connection.  If it's None, or unspecified, an ephemeral DH
        key is used instead.

        @param tls_verifyAuthorities: a list of Certificate objects which
        represent root certificates to verify our peer with.
         N/A N/A ssl None N/A N/A N/A RuntimeError TLS not available. N/A N/A self certificate N/A N/A kw pop tls_localCertificate N/A _NoCertificate True N/A N/A self authorities N/A N/A kw pop tls_verifyAuthorities None N/A N/A N/A Command __init__ self kw N/A _doCommand N/A N/A self proto N/A N/A N/A 
        When a StartTLS command is sent, prepare to start TLS, but don't actually
        do it; wait for the acknowledgement, then initiate the TLS handshake.
         N/A d N/A N/A Command _doCommand self proto N/A N/A N/A proto _prepareTLS N/A self certificate N/A self authorities actuallystart N/A N/A response N/A N/A N/A N/A N/A proto _startTLS N/A self certificate N/A self authorities N/A response N/A N/A N/A N/A d addCallback actuallystart N/A d N/A N/A ProtocolSwitchCommand N/A Command N/A N/A 
    Use this command to switch from something Amp-derived to a different
    protocol mid-connection.  This can be useful to use amp as the
    connection-startup negotiation phase.  Since TLS is a different layer
    entirely, you can use Amp to negotiate the security parameters of your
    connection, then switch to a different protocol, and the connection will
    remain secured.
     __init__ N/A N/A self _protoToSwitchToFactory N/A kw N/A N/A 
        Create a ProtocolSwitchCommand.

        @param _protoToSwitchToFactory: a ProtocolFactory which will generate
        the Protocol to switch to.

        @param kw: Keyword arguments, encoded and handled normally as
        L{Command} would.
         N/A N/A self protoToSwitchToFactory _protoToSwitchToFactory N/A N/A N/A N/A super ProtocolSwitchCommand self __init__ kw N/A makeResponse N/A N/A cls innerProto proto N/A N/A N/A N/A _SwitchBox innerProto N/A N/A makeResponse N/A classmethod makeResponse _doCommand N/A N/A self proto N/A N/A N/A 
        When we emit a ProtocolSwitchCommand, lock the protocol, but don't actually
        switch to the new protocol unless an acknowledgement is received.  If
        an error is received, switch back.
         N/A d N/A N/A N/A super ProtocolSwitchCommand self _doCommand proto N/A N/A N/A proto _lockForSwitch switchNow N/A N/A ign N/A N/A N/A innerProto N/A N/A N/A self protoToSwitchToFactory buildProtocol N/A N/A N/A proto transport getPeer N/A N/A N/A proto _switchTo innerProto N/A self protoToSwitchToFactory N/A ign N/A handle N/A N/A ign N/A N/A N/A N/A N/A proto _unlockFromSwitch N/A N/A N/A N/A self protoToSwitchToFactory clientConnectionFailed None N/A Failure CONNECTION_LOST N/A ign N/A N/A N/A N/A d addCallbacks switchNow handle N/A N/A _DescriptorExchanger N/A object N/A N/A 
    L{_DescriptorExchanger} is a mixin for L{BinaryBoxProtocol} which adds
    support for receiving file descriptors, a feature offered by
    L{IUNIXTransport<twisted.internet.interfaces.IUNIXTransport>}.

    @ivar _descriptors: Temporary storage for all file descriptors received.
        Values in this dictionary are the file descriptors (as integers).  Keys
        in this dictionary are ordinals giving the order in which each
        descriptor was received.  The ordering information is used to allow
        L{Descriptor} to determine which is the correct descriptor for any
        particular usage of that argument type.
    @type _descriptors: C{dict}

    @ivar _sendingDescriptorCounter: A no-argument callable which returns the
        ordinals, starting from 0.  This is used to construct values for
        C{_sendFileDescriptor}.

    @ivar _receivingDescriptorCounter: A no-argument callable which returns the
        ordinals, starting from 0.  This is used to construct values for
        C{fileDescriptorReceived}.
     N/A N/A implements IFileDescriptorReceiver __init__ N/A N/A self N/A N/A N/A N/A self _descriptors N/A N/A N/A self _getDescriptor N/A N/A self _descriptors pop N/A N/A self _sendingDescriptorCounter N/A N/A count next N/A N/A self _receivingDescriptorCounter N/A N/A count next N/A _sendFileDescriptor N/A N/A self descriptor N/A N/A N/A 
        Assign and return the next ordinal to the given descriptor after sending
        the descriptor over this protocol's transport.
         N/A N/A N/A N/A self transport sendFileDescriptor descriptor N/A N/A N/A self _sendingDescriptorCounter N/A fileDescriptorReceived N/A N/A self descriptor N/A N/A N/A 
        Collect received file descriptors to be claimed later by L{Descriptor}.

        @param descriptor: The received file descriptor.
        @type descriptor: C{int}
         N/A N/A N/A self _descriptors N/A N/A N/A self _receivingDescriptorCounter descriptor N/A N/A BinaryBoxProtocol N/A StatefulStringProtocol Int16StringReceiver _DescriptorExchanger N/A N/A 
    A protocol for receiving L{AmpBox}es - key/value pairs - via length-prefixed
    strings.  A box is composed of:

        - any number of key-value pairs, described by:
            - a 2-byte network-endian packed key length (of which the first
              byte must be null, and the second must be non-null: i.e. the
              value of the length must be 1-255)
            - a key, comprised of that many bytes
            - a 2-byte network-endian unsigned value length (up to the maximum
              of 65535)
            - a value, comprised of that many bytes
        - 2 null bytes

    In other words, an even number of strings prefixed with packed unsigned
    16-bit integers, and then a 0-length string to indicate the end of the box.

    This protocol also implements 2 extra private bits of functionality related
    to the byte boundaries between messages; it can start TLS between two given
    boxes or switch to an entirely different protocol.  However, due to some
    tricky elements of the implementation, the public interface to this
    functionality is L{ProtocolSwitchCommand} and L{StartTLS}.

    @ivar _keyLengthLimitExceeded: A flag which is only true when the
        connection is being closed because a key length prefix which was longer
        than allowed by the protocol was received.

    @ivar boxReceiver: an L{IBoxReceiver} provider, whose L{ampBoxReceived}
    method will be invoked for each L{AmpBox} that is received.
     N/A N/A implements IBoxSender N/A _justStartedTLS False N/A _startingTLSBuffer None N/A _locked False N/A _currentKey None N/A _currentBox None N/A _keyLengthLimitExceeded False N/A hostCertificate None N/A noPeerCertificate False N/A innerProtocol None N/A innerProtocolClientFactory None __init__ N/A N/A self boxReceiver N/A N/A N/A N/A N/A _DescriptorExchanger __init__ self N/A N/A self boxReceiver boxReceiver N/A _switchTo N/A N/A self newProto clientFactory N/A None N/A N/A 
        Switch this BinaryBoxProtocol's transport to a new protocol.  You need
        to do this 'simultaneously' on both ends of a connection; the easiest
        way to do this is to use a subclass of ProtocolSwitchCommand.

        @param newProto: the new protocol instance to switch to.

        @param clientFactory: the ClientFactory to send the
        L{clientConnectionLost} notification to.
         N/A newProtoData N/A self recvd N/A N/A self recvd N/A N/A self innerProtocol newProto N/A N/A self innerProtocolClientFactory clientFactory N/A N/A N/A newProto makeConnection N/A self transport N/A newProtoData N/A N/A N/A N/A newProto dataReceived newProtoData N/A sendBox N/A N/A self box N/A N/A N/A 
        Send a amp.Box to my peer.

        Note: transport.write is never called outside of this method.

        @param box: an AmpBox.

        @raise ProtocolSwitched: if the protocol has previously been switched.

        @raise ConnectionLost: if the connection has previously been lost.
         N/A N/A self _locked N/A N/A N/A ProtocolSwitched This connection has switched: no AMP traffic allowed. N/A N/A N/A self transport None N/A N/A N/A ConnectionLost N/A N/A N/A self _startingTLSBuffer None N/A N/A N/A N/A N/A self _startingTLSBuffer append box N/A N/A N/A N/A N/A self transport write N/A N/A box serialize N/A makeConnection N/A N/A self transport N/A N/A N/A 
        Notify L{boxReceiver} that it is about to receive boxes from this
        protocol by invoking L{startReceivingBoxes}.
         N/A N/A self transport transport N/A N/A N/A N/A self boxReceiver startReceivingBoxes self N/A N/A N/A self connectionMade N/A dataReceived N/A N/A self data N/A N/A N/A 
        Either parse incoming data as L{AmpBox}es or relay it to our nested
        protocol.
         N/A N/A self _justStartedTLS N/A N/A N/A self _justStartedTLS False N/A N/A N/A self innerProtocol None N/A N/A N/A N/A N/A self innerProtocol dataReceived data N/A N/A N/A N/A Int16StringReceiver dataReceived self data N/A connectionLost N/A N/A self reason N/A N/A N/A 
        The connection was lost; notify any nested protocol.
         N/A N/A N/A self innerProtocol None N/A N/A N/A N/A N/A self innerProtocol connectionLost reason N/A N/A N/A self innerProtocolClientFactory None N/A N/A N/A N/A N/A self innerProtocolClientFactory clientConnectionLost None reason N/A N/A self _keyLengthLimitExceeded N/A N/A failReason N/A Failure N/A TooLong True False None None N/A N/A N/A N/A N/A reason check ConnectionClosed N/A self _justStartedTLS N/A N/A failReason N/A PeerVerifyError Peer rejected our certificate for an unknown reason. N/A N/A failReason reason N/A N/A N/A N/A self boxReceiver stopReceivingBoxes failReason N/A N/A _MAX_KEY_LENGTH 255 N/A _MAX_VALUE_LENGTH 65535 N/A MAX_LENGTH _MAX_KEY_LENGTH proto_init N/A N/A self string N/A N/A N/A 
        String received in the 'init' state.
         N/A N/A self _currentBox N/A AmpBox N/A N/A N/A self proto_key string N/A proto_key N/A N/A self string N/A N/A N/A 
        String received in the 'key' state.  If the key is empty, a complete
        box has been received.
         N/A string N/A N/A N/A self _currentKey string N/A N/A self MAX_LENGTH N/A self _MAX_VALUE_LENGTH N/A value N/A N/A N/A N/A N/A self boxReceiver ampBoxReceived N/A self _currentBox N/A N/A self _currentBox None N/A init N/A proto_value N/A N/A self string N/A N/A N/A 
        String received in the 'value' state.
         N/A N/A N/A self _currentBox N/A N/A self _currentKey string N/A N/A self _currentKey None N/A N/A self MAX_LENGTH N/A self _MAX_KEY_LENGTH N/A key N/A lengthLimitExceeded N/A N/A self length N/A N/A N/A 
        The key length limit was exceeded.  Disconnect the transport and make
        sure a meaningful exception is reported.
         N/A N/A self _keyLengthLimitExceeded True N/A N/A N/A N/A self transport loseConnection N/A _lockForSwitch N/A N/A self N/A N/A N/A 
        Lock this binary protocol so that no further boxes may be sent.  This
        is used when sending a request to switch underlying protocols.  You
        probably want to subclass ProtocolSwitchCommand rather than calling
        this directly.
         N/A N/A self _locked True N/A _unlockFromSwitch N/A N/A self N/A N/A N/A 
        Unlock this locked binary protocol so that further boxes may be sent
        again.  This is used after an attempt to switch protocols has failed
        for some reason.
         N/A N/A N/A self innerProtocol None N/A N/A N/A ProtocolSwitched Protocol already switched.  Cannot unlock. N/A N/A self _locked False N/A _prepareTLS N/A N/A self certificate verifyAuthorities N/A N/A N/A 
        Used by StartTLSCommand to put us into the state where we don't
        actually send things that get sent, instead we buffer them.  see
        L{_sendBox}.
         N/A N/A self _startingTLSBuffer N/A N/A N/A N/A self hostCertificate None N/A N/A N/A OnlyOneTLS N/A Previously authenticated connection between %s and %s is trying to re-establish as %s N/A N/A self hostCertificate N/A self peerCertificate N/A certificate verifyAuthorities N/A _startTLS N/A N/A self certificate verifyAuthorities N/A N/A N/A 
        Used by TLSBox to initiate the SSL handshake.

        @param certificate: a L{twisted.internet.ssl.PrivateCertificate} for
        use locally.

        @param verifyAuthorities: L{twisted.internet.ssl.Certificate} instances
        representing certificate authorities which will verify our peer.
         N/A N/A self hostCertificate certificate N/A N/A self _justStartedTLS True N/A N/A verifyAuthorities None N/A N/A verifyAuthorities N/A N/A N/A N/A N/A self transport startTLS N/A N/A certificate options verifyAuthorities N/A stlsb N/A self _startingTLSBuffer N/A N/A stlsb None N/A N/A N/A self _startingTLSBuffer None N/A box stlsb N/A N/A N/A N/A self sendBox box N/A _getPeerCertificate N/A N/A self N/A N/A N/A N/A self noPeerCertificate N/A N/A None N/A N/A N/A Certificate peerFromTransport N/A self transport N/A N/A peerCertificate N/A property _getPeerCertificate unhandledError N/A N/A self failure N/A N/A N/A 
        The buck stops here.  This error was completely unhandled, time to
        terminate the connection.
         N/A N/A N/A log err failure Amp server or network failure unhandled by client application.  Dropping connection!  To avoid, add errbacks to ALL remote commands! N/A N/A N/A self transport None N/A N/A N/A N/A N/A self transport loseConnection N/A _defaultStartTLSResponder N/A N/A self N/A N/A N/A 
        The default TLS responder doesn't specify any certificate or anything.

        From a security perspective, it's little better than a plain-text
        connection - but it is still a *bit* better, so it's included for
        convenience.

        You probably want to override this by providing your own StartTLS.responder.
         N/A N/A N/A N/A N/A N/A StartTLS responder _defaultStartTLSResponder N/A AMP N/A BinaryBoxProtocol BoxDispatcher CommandLocator SimpleStringLocator N/A N/A 
    This protocol is an AMP connection.  See the module docstring for protocol
    details.
     N/A _ampInitialized False __init__ N/A N/A self boxReceiver locator N/A None None N/A N/A N/A self _ampInitialized True N/A N/A boxReceiver None N/A N/A boxReceiver self N/A N/A locator None N/A N/A locator self N/A N/A N/A BoxDispatcher __init__ self locator N/A N/A N/A BinaryBoxProtocol __init__ self boxReceiver N/A locateResponder N/A N/A self name N/A N/A N/A 
        Unify the implementations of L{CommandLocator} and
        L{SimpleStringLocator} to perform both kinds of dispatch, preferring
        L{CommandLocator}.
         N/A firstResponder N/A N/A CommandLocator locateResponder self name N/A N/A firstResponder None N/A N/A firstResponder N/A secondResponder N/A N/A SimpleStringLocator locateResponder self name N/A secondResponder N/A __repr__ N/A N/A self N/A N/A N/A 
        A verbose string representation which gives us information about this
        AMP connection.
         N/A N/A N/A self innerProtocol None N/A N/A innerRepr N/A  inner %r N/A N/A self innerProtocol N/A N/A innerRepr N/A N/A <%s%s at 0x%x> N/A N/A N/A self __class__ __name__ innerRepr N/A unsignedID self N/A makeConnection N/A N/A self transport N/A N/A N/A 
        Emit a helpful log message when the connection is made.
         N/A N/A N/A self _ampInitialized N/A N/A N/A N/A AMP __init__ self N/A N/A self _transportPeer N/A N/A transport getPeer N/A N/A self _transportHost N/A N/A transport getHost N/A N/A N/A log msg N/A %s connection established (HOST:%s PEER:%s) N/A N/A N/A self __class__ __name__ N/A self _transportHost N/A self _transportPeer N/A N/A N/A BinaryBoxProtocol makeConnection self transport N/A connectionLost N/A N/A self reason N/A N/A N/A 
        Emit a helpful log message when the connection is lost.
         N/A N/A N/A log msg N/A %s connection lost (HOST:%s PEER:%s) N/A N/A N/A self __class__ __name__ N/A self _transportHost N/A self _transportPeer N/A N/A N/A BinaryBoxProtocol connectionLost self reason N/A N/A self transport None N/A N/A _ParserHelper N/A N/A N/A 
    A box receiver which records all boxes received.
     __init__ N/A N/A self N/A N/A N/A N/A self boxes N/A N/A getPeer N/A N/A self N/A N/A N/A string N/A getHost N/A N/A self N/A N/A N/A string N/A N/A disconnecting False startReceivingBoxes N/A N/A self sender N/A N/A N/A 
        No initialization is required.
         N/A ampBoxReceived N/A N/A self box N/A N/A N/A N/A N/A N/A self boxes append box N/A parse N/A N/A cls fileObj N/A N/A N/A 
        Parse some amp data stored in a file.

        @param fileObj: a file-like object.

        @return: a list of AmpBoxes encoded in the given file.
         N/A parserHelper N/A cls N/A bbp N/A BinaryBoxProtocol boxReceiver parserHelper N/A N/A N/A bbp makeConnection parserHelper N/A N/A N/A bbp dataReceived N/A N/A fileObj read N/A N/A parserHelper boxes N/A N/A parse N/A classmethod parse parseString N/A N/A cls data N/A N/A N/A 
        Parse some amp data stored in a string.

        @param data: a str holding some amp-encoded data.

        @return: a list of AmpBoxes encoded in the given string.
         N/A N/A N/A cls parse N/A StringIO data N/A N/A parseString N/A classmethod parseString N/A N/A parse N/A _ParserHelper parse N/A parseString N/A _ParserHelper parseString _stringsToObjects N/A N/A strings arglist proto N/A N/A N/A 
    Convert an AmpBox to a dictionary of python objects, converting through a
    given arglist.

    @param strings: an AmpBox (or dict of strings)

    @param arglist: a list of 2-tuples of strings and Argument objects, as
    described in L{Command.arguments}.

    @param proto: an L{AMP} instance.

    @return: the converted dictionary mapping names to argument objects.
     N/A objects N/A N/A myStrings N/A N/A strings copy N/A N/A argname argparser arglist N/A N/A N/A N/A argparser fromBox argname myStrings objects proto N/A objects N/A _objectsToStrings N/A N/A objects arglist strings proto N/A N/A N/A 
    Convert a dictionary of python objects to an AmpBox, converting through a
    given arglist.

    @param objects: a dict mapping names to python objects

    @param arglist: a list of 2-tuples of strings and Argument objects, as
    described in L{Command.arguments}.

    @param strings: [OUT PARAMETER] An object providing the L{dict}
    interface which will be populated with serialized data.

    @param proto: an L{AMP} instance.

    @return: The converted dictionary mapping names to encoded argument
    strings (identical to C{strings}).
     N/A myObjects N/A N/A objects copy N/A N/A argname argparser arglist N/A N/A N/A N/A argparser toBox argname strings myObjects proto N/A strings N/A _FixedOffsetTZInfo N/A N/A datetime tzinfo N/A N/A 
    Represents a fixed timezone offset (without daylight saving time).

    @ivar name: A C{str} giving the name of this timezone; the name just
        includes how much time this offset represents.

    @ivar offset: A C{datetime.timedelta} giving the amount of time this
        timezone is offset.
     __init__ N/A N/A self sign hours minutes N/A N/A N/A N/A self name N/A %s%02i:%02i N/A sign hours minutes N/A N/A sign - N/A N/A hours N/A hours N/A minutes N/A minutes N/A N/A N/A sign + N/A N/A N/A ValueError N/A invalid sign for timezone %r N/A sign N/A N/A self offset N/A N/A datetime timedelta hours hours minutes minutes N/A utcoffset N/A N/A self dt N/A N/A N/A 
        Return this timezone's offset from UTC.
         N/A N/A self offset N/A dst N/A N/A self dt N/A N/A N/A 
        Return a zero C{datetime.timedelta} for the daylight saving time offset,
        since there is never one.
         N/A N/A N/A datetime timedelta 0 N/A tzname N/A N/A self dt N/A N/A N/A 
        Return a string describing this timezone.
         N/A N/A self name N/A N/A N/A utc N/A _FixedOffsetTZInfo + 0 0 Decimal N/A Argument N/A N/A 
    Encodes C{decimal.Decimal} instances.

    There are several ways in which a decimal value might be encoded.

    Special values are encoded as special strings::

      - Positive infinity is encoded as C{"Infinity"}
      - Negative infinity is encoded as C{"-Infinity"}
      - Quiet not-a-number is encoded as either C{"NaN"} or C{"-NaN"}
      - Signalling not-a-number is encoded as either C{"sNaN"} or C{"-sNaN"}

    Normal values are encoded using the base ten string representation, using
    engineering notation to indicate magnitude without precision, and "normal"
    digits to indicate precision.  For example::

      - C{"1"} represents the value I{1} with precision to one place.
      - C{"-1"} represents the value I{-1} with precision to one place.
      - C{"1.0"} represents the value I{1} with precision to two places.
      - C{"10"} represents the value I{10} with precision to two places.
      - C{"1E+2"} represents the value I{10} with precision to one place.
      - C{"1E-1"} represents the value I{0.1} with precision to one place.
      - C{"1.5E+2"} represents the value I{15} with precision to two places.

    U{http://speleotrove.com/decimal/} should be considered the authoritative
    specification for the format.
     N/A fromString N/A decimal Decimal toString N/A N/A self inObject N/A N/A N/A 
        Serialize a C{decimal.Decimal} instance to the specified wire format.
         N/A N/A isinstance inObject N/A decimal Decimal N/A N/A N/A str inObject N/A N/A ValueError amp.Decimal can only encode instances of decimal.Decimal N/A N/A DateTime N/A Argument N/A N/A 
    Encodes C{datetime.datetime} instances.

    Wire format: '%04i-%02i-%02iT%02i:%02i:%02i.%06i%s%02i:%02i'. Fields in
    order are: year, month, day, hour, minute, second, microsecond, timezone
    direction (+ or -), timezone hour, timezone minute. Encoded string is
    always exactly 32 characters long. This format is compatible with ISO 8601,
    but that does not mean all ISO 8601 dates can be accepted.

    Also, note that the datetime module's notion of a "timezone" can be
    complex, but the wire format includes only a fixed offset, so the
    conversion is not lossless. A lossless transmission of a C{datetime} instance
    is not feasible since the receiving end would require a Python interpreter.

    @ivar _positions: A sequence of slices giving the positions of various
        interesting parts of the wire format.
     N/A _positions N/A N/A slice 0 4 N/A slice 5 7 N/A slice 8 10 N/A slice 11 13 N/A slice 14 16 N/A slice 17 19 N/A slice 20 26 N/A slice 27 29 N/A slice 30 32 fromString N/A N/A self s N/A N/A N/A 
        Parse a string containing a date and time in the wire format into a
        C{datetime.datetime} instance.
         N/A N/A N/A len s 32 N/A N/A N/A ValueError N/A invalid date format %r N/A s N/A values N/A N/A int N/A s N/A p N/A p N/A self _positions N/A sign N/A s N/A 26 N/A timezone N/A _FixedOffsetTZInfo sign N/A values N/A 7 N/A N/A values N/A 7 N/A timezone N/A N/A N/A datetime datetime values N/A toString N/A N/A self i N/A N/A N/A 
        Serialize a C{datetime.datetime} instance to a string in the specified
        wire format.
         N/A offset N/A N/A i utcoffset N/A N/A offset None N/A N/A N/A ValueError amp.DateTime cannot serialize naive datetime instances.  You may find amp.utc useful. N/A minutesOffset N/A N/A N/A N/A offset days 86400 N/A offset seconds 60 N/A N/A minutesOffset 0 N/A N/A sign + N/A N/A sign - N/A N/A %04i-%02i-%02iT%02i:%02i:%02i.%06i%s%02i:%02i N/A N/A i year N/A i month N/A i day N/A i hour N/A i minute N/A i second N/A i microsecond sign N/A N/A abs minutesOffset 60 N/A N/A abs minutesOffset 60 N/A N/A