Module Assign NameStore Str Import alias Import alias Import alias Import alias Import alias Import alias TryExcept body Import alias Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Import alias identifier Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad NameLoad body Expr Str If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Str Str Str Str Str Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return SubscriptLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad CompareLt BinOpSub NameLoad AttributeLoad NameLoad attr Num body Return Call AttributeLoad NameLoad attr Str Num Str NameLoad AugAssignAdd AttributeStore NameLoad attr Num Assign NameStore NameLoad TryFinally body TryExcept body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num handlers ExceptHandler type NameLoad name NameStore body Return Call AttributeLoad NameLoad attr Str Num Str NameLoad If NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad orelse Assign NameStore NameLoad orelse Assign NameStore Str AugAssignAdd AttributeStore NameLoad attr BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad TryExcept body If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad name NameStore body If BoolOpAnd Call NameLoad NameLoad Str CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Str orelse Expr Call AttributeLoad NameLoad attr Str keyword Str Return Call AttributeLoad NameLoad attr Str Call NameLoad NameLoad Str NameLoad Assign NameStore NameLoad FunctionDef arguments args defaults body Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list If UnaryOpNot NameLoad body Return NameLoad orelse Return Call NameLoad finalbody If UnaryOpNot NameLoad body AugAssignAdd AttributeStore NameLoad attr BinOpSub Call AttributeLoad NameLoad attr NameLoad AugAssignAdd AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore Num TryFinally body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body If BoolOpAnd Call NameLoad NameLoad Str CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad keyword Str orelse Expr Call AttributeLoad NameLoad attr Str keyword Str Return TupleLoad Str Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str NameLoad If CompareEq NameLoad Num body Expr Call AttributeLoad NameLoad attr Str keyword Str Return TupleLoad Str Call NameLoad NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Str keyword Str Return TupleLoad Str Call NameLoad NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Num keyword Str Return TupleLoad Str Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareEq NameLoad Str body Assign NameStore NameLoad orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr keyword Str orelse Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad keyword Str Return TupleLoad NameLoad Call NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Num keyword Str Return TupleLoad Str Call NameLoad NameLoad NameLoad finalbody AugAssignAdd AttributeStore NameLoad attr BinOpSub Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body AugAssignAdd AttributeStore NameLoad attr Num Expr Call AttributeLoad NameLoad attr keyword NameLoad AugAssignAdd AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If NameLoad body Return TupleLoad NameLoad NameLoad NameLoad FunctionDef arguments args defaults body Return TupleLoad NameLoad NameLoad NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr decorator_list Return Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad BinOpMult BinOpMult BinOpMult Num Num Num Num body Expr Str Assign NameStore Dict Str Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr ListLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Return Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If CompareGtE Call NameLoad NameLoad Num body Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num orelse Assign NameStore Str Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr If CompareGt Call NameLoad SubscriptLoad NameLoad Index Num Num body Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num handlers ExceptHandler type NameLoad body Assign NameStore NameLoad If CompareIs NameLoad NameLoad body TryExcept body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareGt Call NameLoad NameLoad Num body Assign NameStore BinOpMod Str NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr keyword Num If NameLoad body Assign NameStore Str orelse Assign NameStore Str Return BinOpMod Str TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults Str body Expr Str Assign NameStore BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad body If CompareNotEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpSub NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults BinOpMult BinOpMult Num Num Num body Expr Str Assert CompareGt Call NameLoad NameLoad Num Str Assert UnaryOpNot CompareIn Str NameLoad Str Assert UnaryOpNot CompareIn Str NameLoad Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr orelse Return Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareGt AttributeLoad NameLoad attr Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad AugAssignAdd AttributeStore NameLoad attr Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpMult Num NameLoad Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Assign NameStore Num AugAssignAdd NameStore NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str orelse Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier Assign NameStore Call NameLoad BinOpMult Call AttributeLoad NameLoad attr Num If BoolOpAnd CompareIsNot NameLoad NameLoad CompareLtE NameLoad NameLoad body Assign NameStore BinOpAdd NameLoad Num Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Str For NameStore Call NameLoad Num body Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad For NameStore Call NameLoad Num Num body Expr Call AttributeLoad NameLoad attr BinOpSub BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num BinOpMult Num NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert CompareIn Str NameLoad Assert CompareIn Str NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpSub Call NameLoad Call NameLoad NameLoad Call NameLoad Call NameLoad AttributeLoad NameLoad attr If BoolOpAnd CompareIsNot NameLoad NameLoad CompareGt BinOpAdd AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad AugAssignAdd AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore BinOpAdd Call NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr If CompareLt NameLoad Num body AugAssignAdd NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num orelse AugAssignAdd NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If BoolOpAnd CompareIsNot NameLoad NameLoad CompareGt BinOpAdd AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad AugAssignAdd AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Str NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assert CompareGtE Call NameLoad AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num If CompareLt SubscriptLoad NameLoad Index Num Call NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num SubscriptLoad NameLoad Index Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd BoolOpOr CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad CompareIsNot NameLoad NameLoad body AugAssignAdd AttributeStore NameLoad attr Num If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str orelse Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad CompareIsNot NameLoad NameLoad body AugAssignAdd AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr BinOpMod Str Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Num orelse Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr BinOpMod Str Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Slice Num Num Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad AttributeLoad NameLoad attr orelse Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpAnd CompareIs AttributeLoad NameLoad attr NameLoad CompareIsNot NameLoad NameLoad body AugAssignAdd AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad AttributeLoad NameLoad attr orelse Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr While CompareGt NameLoad Num body AugAssignSub NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call AttributeLoad NameLoad attr Num Str body Break Assign NameStore NameLoad While CompareGt NameLoad Num body AugAssignSub NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num If UnaryOpNot Call AttributeLoad NameLoad attr body Break If BoolOpAnd CompareGt NameLoad Num CompareEq NameLoad Str body AugAssignSub NameStore Num If CompareLt NameLoad Num body Raise Call NameLoad Str AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Assign NameStore NameLoad ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If BoolOpAnd UnaryOpNot NameLoad CompareIsNot NameLoad NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore NameLoad TryFinally body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return finalbody Expr Call AttributeLoad NameLoad attr NameLoad If Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Num AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameLoad Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Raise NameLoad orelse Raise Call AttributeLoad NameLoad attr Str decorator_list
N/A N/A __author__ czerwin@scalyr.com N/A httplib N/A platform N/A re N/A socket N/A sys N/A time N/A N/A N/A ssl N/A __has_ssl__ True N/A N/A N/A Exception N/A N/A __has_ssl__ False N/A ssl None N/A scalyr_agent.json_lib json_lib N/A scalyr_agent.scalyr_logging scalyr_logging N/A scalyr_agent.util scalyr_util scalyr_agent.connection ConnectionFactory cStringIO StringIO N/A log N/A N/A scalyr_logging getLogger __name__ ScalyrClientSession N/A object N/A N/A Encapsulates the connection between the agent and the Scalyr servers.

    It is a session in that we generally only have one connection open to the Scalyr servers at any given time.
    The session aspect is important because we must ensure that the timestamps we include in the AddEventRequests
    are monotonically increasing within a session.
     __init__ N/A N/A self server api_key agent_version quiet request_deadline ca_file use_requests_lib N/A False 60.0 None False N/A N/A Initializes the connection.

        This does not actually try to connect to the server.
        @param server: The URL for the server to send requests to, such as https://agent.scalyr.com
        @param api_key: The write logs key to use to authenticate all requests from this agent to scalyr.
            It both authenticates the requests and identifies which account it belongs to.
        @param agent_version: The agent version number, which is included in request headers sent to the server.
        @param quiet: If True, will not log non-error information.
        @param request_deadline: The maximum time to wait for all requests in seconds.
        @param ca_file: The path to the file containing the certificates for the trusted certificate authority roots.
            This is used for the SSL connections to verify the connection is to Scalyr.

        @type server: str
        @type api_key: str
        @type agent_version: str
        @type quiet: bool
        @type request_deadline: float
        @type ca_file: str
         N/A N/A quiet N/A N/A N/A N/A log info N/A Using "%s" as address for scalyr servers server N/A N/A self __full_address server N/A parsed_server N/A N/A re match ^(http://|https://|)([^:]*)(:\d+|)$ N/A N/A server lower N/A N/A parsed_server None N/A N/A N/A Exception N/A Could not parse server address "%s" server N/A N/A self __connection None N/A N/A self __use_requests use_requests_lib N/A N/A self __api_key api_key N/A N/A self __session_id N/A N/A scalyr_util create_unique_id N/A N/A self __quiet quiet N/A N/A quiet N/A N/A N/A N/A log info N/A Using session_id=%s %s N/A N/A self __session_id N/A N/A scalyr_util get_pid_tid N/A N/A self __last_success None N/A N/A self __agent_version agent_version N/A N/A self __last_connection_close None N/A N/A self __standard_headers N/A Connection Accept User-Agent Keep-Alive application/json N/A N/A ScalyrClientSession __get_user_agent agent_version N/A N/A self __request_deadline request_deadline N/A N/A self total_requests_sent 0 N/A N/A self total_requests_failed 0 N/A N/A self total_request_bytes_sent 0 N/A N/A self total_response_bytes_received 0 N/A N/A self total_request_latency_secs 0 N/A N/A self total_connections_created 0 N/A N/A self __ca_file ca_file N/A ping N/A N/A self N/A N/A N/A Ping the Scalyr server by sending a test message to add zero events.

        If the returned message is 'success', then it has been verified that the agent can connect to the
        configured Scalyr server and that the api key is correct.

        @return:  The status message returned by the server.
        @rtype:
         N/A N/A N/A N/A self send N/A N/A self add_events_request N/A 0 N/A __send_request N/A N/A self request_path body body_func is_post block_on_response N/A None None True True N/A N/A Sends a request either using POST or GET to Scalyr at the specified request path.  It may be either
        a POST or GET.

        Parses, returns response.

        @param request_path: The path of the URL to post to.
        @param [body]: The body string to send.  May be None if body_func is specified.  Ignored if not POST.
        @param [body_func]:  A function that will be invoked to retrieve the body to send in the post.  Ignored if not
            POST.
        @param [is_post]:  True if this request should be sent using a POST, otherwise GET.
        @param [block_on_response]:  True if this request should block, waiting for the response.  If False, it will
            not block, but instead return a function, that will invoked, will block.

        @type request_path: str
        @type body: str|None
        @type body_func: func|None
        @type is_post: bool
        @type block_on_response: bool

        @return: If block_on_response is True, a tuple containing the status message in the response
            (such as 'success'), the number of bytes sent, and the full response.  If block_on_response is False,
            then returns a function, that will invoked, will block and return the tuple.
        @rtype: (str, int, str) or Function
         N/A current_time N/A N/A time time N/A N/A N/A N/A self __last_connection_close None N/A N/A current_time N/A self __last_connection_close 30 N/A N/A N/A N/A self __wrap_response_if_necessary client/connectionClosed 0 block_on_response N/A N/A self total_requests_sent 1 N/A was_sent False N/A N/A N/A N/A N/A N/A N/A self __connection None N/A N/A N/A self __connection N/A N/A ConnectionFactory connection N/A self __full_address N/A self __request_deadline N/A self __ca_file N/A self __standard_headers N/A self __use_requests quiet N/A self __quiet N/A N/A self total_connections_created 1 N/A N/A N/A Exception N/A e N/A N/A N/A N/A self __wrap_response_if_necessary client/connectionFailed 0 block_on_response N/A is_post N/A N/A N/A body None N/A N/A body_str N/A body_func N/A N/A body_str body N/A N/A body_str N/A N/A self total_request_bytes_sent N/A N/A len body_str N/A len request_path N/A N/A N/A is_post N/A N/A N/A N/A log log N/A scalyr_logging DEBUG_LEVEL_5 Sending POST %s with body "%s" request_path body_str N/A N/A N/A N/A self __connection post request_path body body_str N/A N/A N/A N/A log log N/A scalyr_logging DEBUG_LEVEL_5 Sending GET %s request_path N/A N/A N/A N/A self __connection get request_path N/A N/A N/A Exception N/A error N/A N/A N/A N/A hasattr error errno N/A N/A error errno None N/A N/A N/A N/A log error Failed to connect to "%s" due to errno=%d.  Exception was %s.  Closing connection, will re-attempt N/A self __full_address N/A error errno N/A str error error_code client/requestFailed N/A N/A N/A N/A log exception Failed to send request due to exception.  Closing connection, will re-attempt error_code requestFailed N/A N/A N/A self __wrap_response_if_necessary requestFailed N/A len body_str block_on_response N/A was_sent True receive_response N/A N/A N/A N/A N/A N/A N/A self __receive_response body_str current_time N/A N/A N/A block_on_response N/A N/A receive_response N/A N/A N/A receive_response N/A N/A N/A was_sent N/A N/A N/A self total_request_latency_secs N/A N/A N/A time time current_time N/A N/A self total_requests_failed 1 N/A N/A N/A self close current_time current_time N/A __receive_response N/A N/A self body_str send_time N/A N/A N/A Receives a response for a request previously sent using __send_request.

        @param body_str: The body of the request that was sent.
        @param send_time: The time of day when the request was sent.

        @type body_str: str
        @type send_time: float
        @return:  The tuple containing the status message in the response  (such as 'success'), the number of bytes
            sent, and the full response.
        @rtype: (str, int, str)
         N/A response N/A was_success False N/A bytes_received 0 N/A N/A N/A N/A N/A status_code N/A N/A N/A self __connection status_code N/A response N/A N/A N/A self __connection response N/A bytes_received N/A len response N/A N/A N/A Exception N/A error N/A N/A N/A N/A hasattr error errno N/A N/A error errno None N/A N/A N/A N/A log error Failed to receive response to "%s" due to errno=%d.  Exception was %s.  Closing connection, will re-attempt N/A self __full_address N/A error errno N/A str error error_code client/requestFailed N/A N/A N/A N/A log exception Failed to receive response due to exception.  Closing connection, will re-attempt error_code requestFailed N/A N/A requestFailed N/A len body_str response N/A N/A N/A log log N/A scalyr_logging DEBUG_LEVEL_5 Response was received with body "%s" response N/A N/A status_code 429 N/A N/A N/A N/A log error Received "too busy" response from server.  Will re-attempt error_code serverTooBusy N/A N/A serverTooBusy N/A len body_str response N/A N/A N/A len response 0 N/A N/A N/A N/A log error Received empty response, server may have reset connection.  Will re-attempt error_code emptyResponse N/A N/A emptyResponse N/A len body_str response N/A N/A N/A response_as_json N/A N/A json_lib parse response N/A N/A N/A Exception N/A N/A N/A N/A log error Failed to parse response of '%s' due to exception.  Closing connection, will re-attempt N/A N/A scalyr_util remove_newlines_and_truncate response 1000 error_code parseResponseFailed N/A N/A parseResponseFailed N/A len body_str response N/A N/A self __last_success send_time N/A N/A status response_as_json N/A N/A status N/A response_as_json N/A status N/A N/A status success N/A N/A was_success True N/A N/A N/A status error/client/badParam N/A N/A N/A N/A log error Request to '%s' failed due to a bad parameter value.  This may be caused by an invalid write logs api key in the configuration N/A self __full_address error_code error/client/badParam N/A N/A N/A N/A log error Request to '%s' failed due to an error.  Returned error code was '%s' N/A self __full_address status error_code error/client/badParam N/A N/A status N/A len body_str response N/A N/A N/A N/A log error No status message provided in response.  Unknown error.  Response was '%s' N/A N/A scalyr_util remove_newlines_and_truncate response 1000 error_code unknownError N/A N/A unknownError N/A len body_str response N/A N/A N/A self total_request_latency_secs N/A N/A N/A time time send_time N/A N/A was_success N/A N/A N/A self total_requests_failed 1 N/A N/A N/A self close current_time send_time N/A N/A self total_response_bytes_received bytes_received N/A __wrap_response_if_necessary N/A N/A self status_message bytes_sent response block_on_response N/A N/A N/A Wraps the response as appropriate based on whether or not the caller is expecting to block on the
        response or not.

        If the caller requested to not block on the response, then they are expecting a function to be returned
        that, when invoked, will block and return the result.  If the caller did requested to block on the response,
        then the response should be returned directly.

        This is used to cover cases where there was an error and we do not have to block on the response from
        the server.  Instead, we already have the response to return.  However, we still need to return the
        right type of object to the caller.

        @param status_message: The status message for the response.
        @param bytes_sent: The number of bytes that were sent.
        @param response: The response to return.
        @param block_on_response: Whether or not the caller requested to block, waiting for the response.  This controls
            whether or not a function is returned or just the response tuple directly.

        @type status_message: str
        @type bytes_sent: int
        @type response: str
        @type block_on_response: bool

        @return: Either a func or a response tuple (status message, num of bytes sent, response body) depending on
            the value of ``block_on_response``.
        @rtype: func or (str, int, str)
         N/A block_on_response N/A N/A N/A status_message bytes_sent response wrap N/A N/A N/A N/A N/A N/A status_message bytes_sent response N/A N/A wrap N/A send N/A N/A self add_events_request block_on_response N/A True N/A N/A Sends an AddEventsRequest to Scalyr.

        The AddEventsRequest should have been retrieved using the 'add_events_request' method on this object.

        @param add_events_request: The request containing any log lines/events to copy to the server.
        @param block_on_response:  If True, this method will block, waiting for the response from the server.
            Otherwise, it will not block.  Instead, a function will be returned, that when invoked, will block.
        @type add_events_request: AddEventsRequest
        @type block_on_response: bool

        @return: If block_on_response is True, a tuple containing the status message in the response
            (such as 'success'), the number of bytes sent, and the full response.  If block_on_response is False,
            then returns a function, that will invoked, will block and return the tuple.
        @rtype: (str, int, str) or Function
         N/A current_time N/A N/A time time generate_body N/A N/A N/A N/A N/A N/A N/A add_events_request set_client_time current_time N/A N/A N/A add_events_request get_payload N/A N/A N/A N/A self __send_request /addEvents body_func generate_body block_on_response block_on_response N/A close N/A N/A self current_time N/A None N/A N/A Closes the underlying connection to the Scalyr server.

        @param current_time: If not None, the time to use for the current time.  Used for testing purposes.
        @type current_time: float or None
         N/A N/A N/A self __connection None N/A N/A N/A current_time None N/A N/A current_time N/A N/A time time N/A N/A N/A N/A self __connection close N/A N/A self __connection None N/A N/A self __last_connection_close current_time N/A add_events_request N/A N/A self session_info max_size N/A None N/A N/A N/A 1 1024 1024 1024 N/A N/A Creates and returns a new AddEventRequest that can be later sent by this session.

        The caller is expected to add events to this request and then submit it for transmission using
        the 'send' method.

        @param session_info: The session info for this session, which is basically any attributes that should
            be added to all events uploaded by this agent, such as server attributes from the config file.
        @param max_size: The maximum number of bytes to send in this request.

        @type session_info: dict
        @type max_size: int

        @return:  The request that can be populated.
        @rtype: AddEventsRequest
         N/A body N/A token session threads N/A self __api_key N/A self __session_id N/A N/A N/A session_info None N/A N/A N/A body N/A sessionInfo session_info N/A N/A AddEventsRequest body max_size max_size N/A __get_user_agent N/A N/A agent_version N/A N/A N/A Determine the user agent to report in the request headers.

        We construct an agent that gives Scalyr some information about the platform the customer is running on,
        the Python version, and a few other tidbits.  This is used to make decisions about support issues.

        @param agent_version: The agent version number.
        @type agent_version: str

        @return: The user agent string.
        @rtype: str
         N/A python_version N/A sys version_info N/A N/A N/A len python_version 5 N/A N/A python_version_str N/A python-%s.%s.%s N/A N/A python_version N/A 0 N/A python_version N/A 1 N/A python_version N/A 2 N/A N/A python_version_str python-unknown N/A platform_value None N/A N/A N/A distribution N/A N/A platform dist N/A N/A N/A len N/A distribution N/A 0 0 N/A N/A platform_value N/A Linux-%s-%s N/A N/A distribution N/A 0 N/A distribution N/A 1 N/A N/A N/A Exception N/A N/A platform_value None N/A N/A platform_value None N/A N/A N/A N/A mac_ver N/A N/A N/A platform mac_ver N/A 0 N/A N/A N/A len mac_ver 0 N/A N/A platform_value N/A MacOS-%s mac_ver N/A N/A N/A Exception N/A N/A platform_value None N/A N/A platform_value None N/A N/A platform_value N/A N/A platform platform terse 1 N/A __has_ssl__ N/A N/A ssl_str ssllib N/A N/A ssl_str nossllib N/A N/A %s;%s;agent-%s;%s; N/A platform_value python_version_str agent_version ssl_str N/A staticmethod perform_agent_version_check N/A N/A self track N/A stable N/A N/A Query the Scalyr API to determine if a newer version is available
         N/A url_path N/A /ajax?method=performAgentVersionCheck&installedVersion=%s&track=%s N/A N/A self __agent_version track N/A N/A N/A self __send_request url_path is_post False N/A N/A EventSequencer N/A object N/A N/A Responsible for keeping track of sequences for an AddEventsRequest

    This abstraction keeps track of previously seen sequence_ids and numbers
    And adds the appropriate fields to an event based on provided sequence ids
    and values.

    This is a standalone class so that various test objects can also use the same
    logic
     __init__ N/A N/A self N/A N/A N/A N/A self __previous_sequence_id None N/A N/A self __previous_sequence_number None N/A reset N/A N/A self N/A N/A N/A Resets the sequence tracking N/A N/A self __previous_sequence_id None N/A N/A self __previous_sequence_number None N/A get_memento N/A N/A self N/A N/A N/A returns internal state of the sequencer as a tuple
        Callers can use this method to set and restore the internal state of the sequencer
         N/A N/A N/A self __previous_sequence_id N/A self __previous_sequence_number N/A restore_from_memento N/A N/A self memento N/A N/A N/A Restores the state of the EventSequencer with the values from a previous
        call to get_memento
         N/A N/A self __previous_sequence_id N/A memento N/A 0 N/A N/A self __previous_sequence_number N/A memento N/A 1 N/A add_sequence_fields N/A N/A self event sequence_id sequence_number N/A N/A N/A 
        If sequence_id and sequence_number are non-None then this method will automatically add the following
        fields:

        'si' set to the value of sequence_id if it is different from the previously seen sequence_id
        'sn' set to the value of sequence_number if we haven't previously seen a sequence number
        'sd' set to the delta of the sequence_number and the previously seen sequence_number

        The 'sn' and 'sd' fields are mutually exclusive.  Only one or the other will be used

        @param event: The event to update
        @param sequence_id: The sequence id
        @param sequence_number: The sequence number

        @type event: Event
        @type sequence_id: long
        @type sequence_number: long
         N/A N/A N/A sequence_id None N/A sequence_number None N/A N/A N/A sequence_id N/A self __previous_sequence_id N/A N/A N/A N/A event set_sequence_id sequence_id N/A N/A self __previous_sequence_id sequence_id N/A N/A self __previous_sequence_number None N/A N/A N/A self __previous_sequence_number None N/A N/A N/A N/A event set_sequence_number sequence_number N/A N/A N/A N/A event set_sequence_number_delta N/A sequence_number N/A self __previous_sequence_number N/A N/A self __previous_sequence_number sequence_number N/A N/A AddEventsRequest N/A object N/A N/A Used to construct an AddEventsRequest to eventually send.

    This abstraction has three key features.  First, it uses a generally more efficient scheme to build
    up the string to eventually use as the body for an add_events request.  Secondly, it does not require all events
    at construction time.  Instead, you can incrementally add more events before the request is actually sent.  This
    leads to better memory utilization when combined with an abstraction that is incrementally reading events from disk.
    It will also prevent you from exceeding the maximum request size.  Third, you may undo the effect of adding events
    to the request before it is sent.  This is useful to rollback the request state to a previous state if some
    problem occurs.
     __init__ N/A N/A self base_body max_size N/A N/A N/A 1 1024 1024 N/A N/A Initializes the instance.

        @param base_body: A JsonObject or dict containing the information to send as the body of the add_events
            request, with the exception of the events field. The events and client_timestamp fields must not be
            included because they will be added later. Note, base_body must have some fields set, such as 'ts' which is
            required by the server.
        @param max_size: The maximum number of bytes this request can consume when it is serialized to JSON.
         N/A N/A N/A len base_body 0 The base_body object must have some fields defined. N/A N/A N/A events base_body The base_body object cannot already have 'events' set. N/A N/A N/A client_time base_body The base_body object cannot already have 'client_time' set. N/A string_buffer N/A StringIO N/A N/A N/A json_lib serialize base_body output string_buffer use_fast_encoding True N/A N/A _rewind_past_close_curly string_buffer N/A N/A N/A string_buffer write , events: [ N/A N/A self __post_fix_buffer N/A PostFixBuffer ], threads: THREADS, client_time: TIMESTAMP } N/A N/A N/A N/A self __post_fix_buffer set_client_timestamp N/A N/A time time N/A N/A self __buffer string_buffer N/A N/A self __max_size max_size N/A N/A self __events_added 0 N/A N/A self __body None N/A N/A self __event_sequencer N/A EventSequencer N/A N/A self __timing_data N/A dict N/A current_size N/A N/A self N/A N/A N/A 
        @return: The number of bytes that will be used to send the current request.  This include both the bytes
            from the events and the post fix.
        @rtype: int
         N/A N/A N/A self __buffer None N/A N/A N/A N/A N/A N/A self __buffer tell N/A N/A self __post_fix_buffer length N/A N/A N/A len N/A self __body N/A property add_thread N/A N/A self thread_id thread_name N/A N/A N/A Registers the specified thread for this AddEvents request.

        Any thread id mentioned in any event in this request should first be registered here.

        @param thread_id: An id for the thread.  This can then be used as the value for a ``thread`` field
            in the ``event`` object passed to ``add_event``.  Should be unique for this session.
        @param thread_name: A human-readable name for the thread

        @type thread_id: str
        @type thread_name: str

        @return: True if there was the allowed bytes to send were not exceeded by adding this thread to the
            request.
        @rtype: bool
         N/A available_size_for_post_fix N/A N/A self __max_size N/A N/A N/A self __buffer tell N/A N/A N/A N/A self __post_fix_buffer add_thread_entry thread_id thread_name fail_if_buffer_exceeds available_size_for_post_fix N/A add_event N/A N/A self event timestamp sequence_id sequence_number N/A None None None N/A N/A Adds the serialized JSON for event if it does not cause the maximum request size to be exceeded.

        It will automatically set the event's timestamp field to a new timestamp based on the current time
        but ensuring it is greater than any previous timestamp that has been used.

        If sequence_id and sequence_number are specified then this method will automatically set the following
        Event fields fields:

        'sequence_id' set to the value of sequence_id if it is different from the previously seen sequence_id
        'sequence_number' set to the value of sequence_number if we haven't previously seen a sequence number
        'sequence_number_delta' set to the delta of the sequence_number and the previously seen sequence_number

        The 'sequence_number' and 'sequence_number_delta' fields are mutually exclusive.  Only one or the other will be
        used.

        It is illegal to invoke this method if 'get_payload' has already been invoked.

        @param event: The event object.
        @param timestamp: The timestamp to use for the event. This should only be used for testing.
        @param sequence_id: A globally unique id, grouping a set of sequence_numbers
        @param sequence_number: A monotonically increasing sequence_number

        @type event: Event
        @type timestamp: long
        @type sequence_id: long
        @type sequence_number: long

        @return: True if the event's serialized JSON was added to the request, or False if that would have resulted
            in the maximum request size being exceeded so it did not.
         N/A start_pos N/A N/A N/A self __buffer tell N/A N/A N/A self __events_added 0 N/A N/A N/A N/A N/A self __buffer write , N/A N/A timestamp None N/A N/A timestamp N/A N/A self __get_timestamp N/A memento N/A N/A N/A self __event_sequencer get_memento N/A N/A N/A N/A self __event_sequencer add_sequence_fields event sequence_id sequence_number N/A N/A N/A event set_timestamp timestamp N/A N/A N/A event serialize N/A self __buffer N/A N/A N/A self current_size N/A self __max_size N/A N/A N/A N/A N/A self __buffer truncate start_pos N/A N/A N/A N/A self __event_sequencer restore_from_memento memento N/A False N/A N/A self __events_added 1 N/A True N/A num_events N/A N/A self N/A N/A N/A Returns the number of events added to this request so far.

        @return:  The number of events added to this request.
        @rtype: int
         N/A N/A self __events_added N/A property set_client_time N/A N/A self current_time N/A N/A N/A Update the 'client_time' field in the request.

        The 'client_time' field should be set to the current time as known by the client when this request is
        sent.  Since a AddEventsRequest can be re-used multiple times to try to resend some events, it is important
        to update the 'client_time' field before each send.

        The 'client_time' field is used by the server to warn when the client clock skew is too great since that
        can lead to log upload problems.

        @param current_time: The current time to include in the request.
        @type current_time: float
         N/A original_postfix_length N/A N/A self __post_fix_buffer length N/A N/A N/A N/A self __post_fix_buffer set_client_timestamp current_time N/A N/A N/A self __body None N/A N/A rebuild_buffer N/A StringIO N/A N/A N/A rebuild_buffer write N/A self __body N/A N/A self __body None N/A N/A N/A rebuild_buffer seek N/A -1 original_postfix_length 2 N/A N/A N/A rebuild_buffer truncate N/A N/A N/A rebuild_buffer write N/A N/A N/A self __post_fix_buffer content N/A N/A self __body N/A N/A rebuild_buffer getvalue N/A N/A N/A rebuild_buffer close N/A get_payload N/A N/A self N/A N/A N/A Returns the serialized JSON to use as the body for the add_request.

        After this is invoked, no new events can be added via the 'add_event' method.  However,
        you may call the 'set_client_time' method to update when this request is being sent, according to
        the client clock.
         N/A N/A N/A self __body None N/A N/A N/A N/A N/A self __buffer write N/A N/A N/A self __post_fix_buffer content N/A N/A self __body N/A N/A N/A self __buffer getvalue N/A N/A N/A N/A self __buffer close N/A N/A self __buffer None N/A N/A self __body N/A close N/A N/A self N/A N/A N/A Must be invoked after this request is no longer needed.  You may not add events or invoke get_payload
        after this call.
         N/A N/A self __body None N/A N/A self __buffer None N/A increment_timing_data N/A N/A self N/A key_values N/A N/A Increments the timing data kept as part of this data structure to help diagnosis performance issues.

        The arguments should be key/value pairs where the keys name some sort of timing component and the value
        by which to increment the count for that timing component.

        If this is the first time a timing component is being incremented, the initial value is set to zero.
         N/A N/A key value N/A N/A key_values iteritems N/A N/A N/A key N/A self __timing_data N/A N/A amount N/A N/A self __timing_data N/A key N/A N/A amount 0.0 N/A amount value N/A N/A N/A self __timing_data N/A key amount N/A get_timing_data N/A N/A self N/A N/A N/A Serializes all of the timing data that has been collected via ``increment_timing_data``.

        @return: A string of the key/value pairs for all timing data.
        @rtype: str
         N/A output_buffer N/A StringIO N/A first_time True N/A N/A key value N/A N/A N/A self __timing_data iteritems N/A N/A N/A first_time N/A N/A N/A N/A output_buffer write N/A N/A first_time False N/A N/A N/A output_buffer write key N/A N/A N/A output_buffer write = N/A N/A N/A output_buffer write N/A str value N/A N/A N/A output_buffer getvalue N/A __get_timestamp N/A N/A self N/A N/A N/A 
        @return: The next timestamp to use for events.  This is guaranteed to be monotonically increasing.
        @rtype: long
         N/A __last_time_stamp__ N/A base_timestamp N/A long N/A N/A N/A time time 1000000000 N/A N/A N/A __last_time_stamp__ None N/A base_timestamp __last_time_stamp__ N/A N/A base_timestamp N/A __last_time_stamp__ 1 N/A __last_time_stamp__ base_timestamp N/A base_timestamp N/A total_events N/A N/A self N/A N/A N/A Returns the total number of events that will be sent in this batch. N/A N/A self __events_added N/A property position N/A N/A self N/A N/A N/A Returns a position such that if it is passed to 'set_position', all events added since this method was
        invoked are removed. N/A N/A N/A AddEventsRequest Position N/A self __events_added N/A N/A N/A self __buffer tell N/A N/A self __post_fix_buffer position N/A set_position N/A N/A self position N/A N/A N/A Reverts this object to only contain the events contained by the object when position was invoked to
        get the passed in position.

        @param position: The position token representing the previous state.
         N/A N/A self __events_added N/A position events_added N/A N/A N/A N/A self __buffer truncate N/A position buffer_size N/A N/A N/A N/A self __post_fix_buffer set_position N/A position postfix_buffer_position N/A N/A N/A N/A self __event_sequencer reset N/A Position N/A object N/A N/A Represents a position in the added events.
         __init__ N/A N/A self events_added buffer_size postfix_buffer_position N/A N/A N/A N/A self events_added events_added N/A N/A self buffer_size buffer_size N/A N/A self postfix_buffer_position postfix_buffer_position N/A N/A N/A _calculate_per_thread_extra_bytes N/A N/A N/A N/A N/A Calculates how many extra bytes are added to the serialized form of the threads JSON array
    when adding a new thread, excluding the bytes for serializing the thread id and name themselves.

    This is used below by the PostFixBuffer abstraction to help calculate the number of bytes the serialized form
    of the PostFixBuffer will take, without having to actually serialize it.  It was found that doing the heavy
    weight process of serializing it over and over again to just get the size was eating too much CPU.

    @return: An array of two int entries.  The first entry is how many extra bytes are added when adding the
        first thread to the threads JSON array and the second is how many extra bytes are added for all subsequent
        threads.  (The number differences by at least one due to the need for a comma to be inserted).
    @rtype: [int]
     N/A sizes_by_entries N/A N/A threads N/A N/A test_string A N/A i N/A range 3 N/A N/A N/A N/A sizes_by_entries append N/A len N/A N/A json_lib serialize threads N/A N/A N/A threads append N/A id name test_string test_string N/A test_string_len N/A len N/A N/A json_lib serialize test_string N/A result N/A N/A i N/A range 1 3 N/A N/A N/A N/A result append N/A N/A N/A sizes_by_entries N/A i N/A sizes_by_entries N/A N/A i 1 N/A 2 test_string_len N/A result N/A PostFixBuffer N/A object N/A N/A Buffer for the items that must be written after the events JSON array, which typically means
    the client timestamp and the threads JSON array.

    This abstraction has optimizations in place to more efficiency keep track of the number of bytes the
    that will be used by the serialized form.

    Additionally, the buffer can be reset to a previous position.
     __init__ N/A N/A self format_string N/A N/A N/A Initializes the buffer.

        @param format_string: The format for the buffer.  The output of this buffer will be this format string
            with the keywords THREADS and TIMESTAMP replaced with the json serialized form of the threads
            JSON array and the timestamp.
        @type format_string: str
         N/A N/A THREADS format_string N/A N/A TIMESTAMP format_string N/A N/A self __threads N/A N/A N/A self __client_timestamp 0 N/A N/A self __format format_string N/A N/A self __current_size N/A len N/A N/A self content N/A N/A __per_thread_extra_bytes N/A _calculate_per_thread_extra_bytes length N/A N/A self N/A N/A N/A The number of bytes the serialized buffer will take.

        @return: The number of bytes
        @rtype: int
         N/A N/A self __current_size N/A property content N/A N/A self cache_size N/A True N/A N/A Serialize all the information for the post fix and return it.

        @param cache_size: Used for testing purposes.  Can be used to turn off a slop factor that will automatically
            fix differences between the calculated size and the actual size.  We turn this off for testing to make
            sure we catch these errors.
        @type cache_size: bool

        @return: The post fix to include at the end of the AddEventsRequest.
        @rtype: str
         N/A result N/A N/A N/A self __format replace TIMESTAMP N/A str N/A self __client_timestamp N/A result N/A N/A result replace THREADS N/A N/A json_lib serialize N/A self __threads N/A cache_size N/A N/A N/A self __current_size N/A len result N/A result N/A set_client_timestamp N/A N/A self timestamp fail_if_buffer_exceeds N/A None N/A N/A Updates the client timestamp that will be included in the post fix.

        @param timestamp: The timestamp.
        @param fail_if_buffer_exceeds: The maximum number of bytes that can be used by the post fix when serialized.
            If this is not None, and the size will exceed this amount when the timestamp is changed, then the
            timestamp is not changed and False is returned.

        @type timestamp: int|float
        @type fail_if_buffer_exceeds: None|int

        @return: True if the thread was added (can only return False if fail_if_buffer_exceeds is not None)
        @rtype: bool
         N/A new_timestamp N/A int timestamp N/A size_difference N/A N/A len N/A str new_timestamp N/A len N/A str N/A self __client_timestamp N/A N/A N/A fail_if_buffer_exceeds None N/A N/A N/A self __current_size size_difference fail_if_buffer_exceeds N/A N/A False N/A N/A self __current_size size_difference N/A N/A self __client_timestamp new_timestamp N/A True N/A add_thread_entry N/A N/A self thread_id thread_name fail_if_buffer_exceeds N/A None N/A N/A Adds in a new thread entry that will be included in the post fix.


        @param thread_id: The id of the thread.
        @param thread_name: The name of the thread.
        @param fail_if_buffer_exceeds: The maximum number of bytes that can be used by the post fix when serialized.
            If this is not None, and the size will exceed this amount when the thread entry is added, then the
            thread is not added and False is returned.

        @type thread_id: str
        @type thread_name: str
        @type fail_if_buffer_exceeds: None|int

        @return: True if the thread was added (can only return False if fail_if_buffer_exceeds is not None)
        @rtype: bool
         N/A size_difference N/A N/A len N/A N/A json_lib serialize thread_name N/A len N/A N/A json_lib serialize thread_id N/A num_threads N/A len N/A self __threads N/A N/A num_threads 1 N/A N/A size_difference N/A N/A PostFixBuffer __per_thread_extra_bytes N/A 0 N/A N/A size_difference N/A N/A PostFixBuffer __per_thread_extra_bytes N/A 1 N/A N/A N/A fail_if_buffer_exceeds None N/A N/A N/A self __current_size size_difference fail_if_buffer_exceeds N/A N/A False N/A N/A self __current_size size_difference N/A N/A N/A N/A self __threads append N/A id name thread_id thread_name N/A True N/A position N/A N/A self N/A N/A N/A Returns the current `position` for this buffer.

        This can be used to reset the buffer to a state before new thread entries were added or timestamps were set.

        @return: The position object.
         N/A N/A N/A self __current_size N/A self __client_timestamp N/A len N/A self __threads N/A property set_position N/A N/A self position N/A N/A N/A Resets the buffer to a previous state.

        The contents of the thread JSON array and the client timestamp will be reset to whatever it was when
        `position` was invoked.

        @param position: The position to reset the buffer state to.
         N/A N/A self __current_size N/A position N/A 0 N/A N/A self __client_timestamp N/A position N/A 1 N/A N/A N/A len N/A self __threads N/A position N/A 2 N/A N/A N/A position N/A 2 N/A len N/A self __threads N/A N/A N/A self __threads N/A N/A self __threads N/A 0 N/A position N/A 2 N/A N/A Event N/A object N/A N/A Encapsulates a single event that will be included in an ``AddEventsRequest``.

    This abstraction has many optimizations to improve serialization time.
     __init__ N/A N/A self thread_id attrs base N/A None None None N/A N/A Creates an instance of an event to include in an AddEventsRequest.

        This constructor has two ways of being used.

        First, specifying the thread_id and attributes that will apply to the event.  The attributes typically only
        include the attributes for the log file that the event belongs to. You then must set the per-log line
        attributes (such as timestamp and message) using the setters provided below.

        The second form is to create an event based on the copy of an already existing ``Event`` instance.  This
        decreases overall serialization time because the ``attrs`` and ``thread_id`` field's serialization is only
        performed once across all for the original copy and shared to all derived copies.

        This is meant to really optimize the case where we create one base ``Event`` object for each log file that
        we are uploading (specifying that log's thread id and attributes in the constructor).  Then, every time
        we upload a log line for that log, we copy the base ``Event`` instance and then set the per-log line
        attributes using the provided setters.

        @param thread_id:  Used if not specifying ``base``.  The thread id for the event.
        @param attrs:  Used if not specifying ``base``.  The attributes for the event, excluding any attributes
            that can be set via the provided setters.  If you include one of those attributes in ``attrs``, the
            resulting behavior is undefined.
        @param base:  Used if not specifying ``thread_id`` or ``attrs``.  The instance of ``Event`` to copy to
            create this instance.  Only the original ``thread_id`` and ``attrs`` that was passed into ``base``
            are copied.  Anything set using the provided ``setters`` will not be used.

        @type thread_id: str
        @type attrs: dict
        @type base: Event
         N/A N/A self __attrs attrs N/A N/A N/A N/A attrs None N/A thread_id None N/A base None N/A N/A N/A Exception Cannot use both attrs/thread_id and base N/A N/A base None N/A N/A N/A self __serialization_base N/A base __serialization_base N/A N/A self __attrs N/A base __attrs N/A N/A tmp_buffer N/A StringIO N/A N/A N/A tmp_buffer write { N/A N/A thread_id None N/A N/A N/A N/A tmp_buffer write thread: N/A N/A N/A json_lib serialize thread_id use_fast_encoding True output tmp_buffer N/A N/A N/A tmp_buffer write ,  N/A N/A attrs None N/A N/A N/A N/A tmp_buffer write attrs: N/A N/A N/A json_lib serialize attrs use_fast_encoding True output tmp_buffer N/A N/A _rewind_past_close_curly tmp_buffer N/A N/A N/A tmp_buffer write , N/A N/A N/A N/A tmp_buffer write attrs:{ N/A N/A N/A tmp_buffer write message: N/A N/A self __serialization_base N/A N/A tmp_buffer getvalue N/A N/A self __message None N/A N/A self __timestamp None N/A N/A self __sequence_id None N/A N/A self __sequence_number None N/A N/A self __sequence_number_delta None N/A N/A self __sampling_rate None N/A N/A self __has_non_optimal_fields False N/A N/A self __num_optimal_fields 0 N/A attrs N/A N/A self N/A N/A N/A Only use for testing.

        @return: The attributes object as originally based into the constructor or the constructor of the base
            object that was to create this instance.
        @rtype: dict
         N/A N/A self __attrs N/A property set_message N/A N/A self message N/A N/A N/A Sets the message field for the attributes for this event.

        @param message:  The message content.
        @type message: str
        @return:  This object.
        @rtype: Event
         N/A N/A N/A N/A self __message None N/A message None N/A N/A N/A self __num_optimal_fields 1 N/A N/A message unicode N/A N/A N/A self __message N/A N/A message encode utf-8 N/A N/A N/A self __message message N/A self N/A message N/A N/A self N/A N/A N/A Used only for testing.
        @return:  The message content
        @rtype: str
         N/A N/A self __message N/A property set_timestamp N/A N/A self timestamp N/A N/A N/A Sets the timestamp field for the attributes for this event.

        @param timestamp:  The timestamp, in nanoseconds past epoch.
        @type timestamp: long
        @return:  This object.
        @rtype: Event
         N/A N/A N/A N/A self __timestamp None N/A timestamp None N/A N/A N/A self __num_optimal_fields 1 N/A N/A self __timestamp N/A "%s" N/A str timestamp N/A self N/A timestamp N/A N/A self N/A N/A N/A Used only for testing.

        @return: the timestamp for the event.
        @rtype: long
         N/A N/A N/A self __timestamp None N/A N/A N/A long N/A N/A self __timestamp N/A 1 -1 N/A N/A None N/A property set_sequence_id N/A N/A self sequence_id N/A N/A N/A Sets the sequence id for the event.  If this is not invoked, no sequence id will be included
        in the serialized event.  (Which is an optimization that can be used if the sequence id is the same
        as the last serialized event's).

        @param sequence_id:  The unique id for the sequence this event belongs.  This must be globally unique and
            usually tied to a single log file.  Generally, use UUID here.
        @type sequence_id: long
        @return:  This object.
        @rtype: Event
         N/A N/A self __sequence_id N/A "%s" N/A str sequence_id N/A N/A self __has_non_optimal_fields True N/A self N/A sequence_id N/A N/A self N/A N/A N/A Used for testing purposes only
        @return:  The sequence id or None if not set.
        @rtype: str
         N/A N/A N/A self __sequence_id None N/A N/A N/A N/A self __sequence_id N/A 1 -1 N/A N/A self __has_non_optimal_fields True N/A None N/A property set_sequence_number N/A N/A self sequence_number N/A N/A N/A Sets the sequence number for the event.  If this is not invoked, no sequence number will be included
        in the serialized event.  (Which is an optimization that can be used if the sequence id is the same
        as the last serialized event's and you use ``sequence_number_delta`` instead to specify the delta between
        this events sequence number and the last one.).

        @param sequence_number:  The sequence number for the event.
        @type sequence_number: long
        @return:  This object.
        @rtype: Event
         N/A N/A self __has_non_optimal_fields True N/A N/A self __sequence_number N/A str sequence_number N/A self N/A sequence_number N/A N/A self N/A N/A N/A Used for testing purposes only.
        @return: The sequence number or None if not set.
        @rtype: long
         N/A N/A N/A self __sequence_number None N/A N/A N/A long N/A self __sequence_number N/A N/A None N/A property set_sequence_number_delta N/A N/A self sequence_number_delta N/A N/A N/A Sets the sequence number delta for the event.  If this is not invoked, no sequence number delta will be
        included in the serialized event.  (Which is what you should do if you specify a ``sequence_number`` instead).

        @param sequence_number_delta:  The delta between the last sequence number of the one for this event.
        @type sequence_number_delta: long
        @return:  This object.
        @rtype: Event
         N/A N/A N/A N/A self __sequence_number_delta None N/A sequence_number_delta None N/A N/A N/A self __num_optimal_fields 1 N/A N/A self __sequence_number_delta N/A str sequence_number_delta N/A self N/A sequence_number_delta N/A N/A self N/A N/A N/A Uses for testing purposes only.
        @return:  The sequence number delta if set or None.
        @rtype: long
         N/A N/A N/A self __sequence_number_delta None N/A N/A N/A long N/A self __sequence_number_delta N/A N/A None N/A property set_sampling_rate N/A N/A self rate N/A N/A N/A Sets the sampling rate field for this event.

        @param rate The rate
        @type rate float
        @return:  This object.
        @rtype: Event
         N/A N/A self __has_non_optimal_fields True N/A N/A self __sampling_rate N/A str rate N/A self N/A serialize N/A N/A self output_buffer N/A N/A N/A Serialize the event into ``output_buffer``.

        @param output_buffer: The buffer to serialize to.
        @type output_buffer: StringIO
         N/A N/A N/A output_buffer write N/A self __serialization_base N/A N/A N/A json_lib serialize_as_length_prefixed_string N/A self __message output_buffer N/A N/A N/A N/A self __has_non_optimal_fields N/A N/A self __num_optimal_fields 3 N/A N/A N/A N/A output_buffer write } N/A N/A N/A output_buffer write ,sd: N/A N/A N/A output_buffer write N/A self __sequence_number_delta N/A N/A N/A output_buffer write ,ts: N/A N/A N/A output_buffer write N/A self __timestamp N/A N/A N/A N/A self __write_field_if_not_none ,sample_rate: N/A self __sampling_rate output_buffer N/A N/A N/A output_buffer write } N/A N/A N/A self __write_field_if_not_none ,ts: N/A self __timestamp output_buffer N/A N/A N/A self __write_field_if_not_none ,si: N/A self __sequence_id output_buffer N/A N/A N/A self __write_field_if_not_none ,sn: N/A self __sequence_number output_buffer N/A N/A N/A self __write_field_if_not_none ,sd: N/A self __sequence_number_delta output_buffer N/A N/A N/A output_buffer write } N/A __write_field_if_not_none N/A N/A self field_name field_value output_buffer N/A N/A N/A If the specified field value is not None, then emit the field name and the value to the output buffer.

        @param field_name: The text to emit before the value.
        @param field_value: The value to emit.
        @param output_buffer: The buffer to serialize to.

        @type field_name: str
        @type field_value: str or None
        @type output_buffer: StringIO
         N/A N/A field_value None N/A N/A N/A N/A output_buffer write field_name N/A N/A N/A output_buffer write field_value N/A N/A _rewind_past_close_curly N/A N/A output_buffer N/A N/A N/A A utility function for rewinding a buffer that had a JSON object emitted to it.  It rewinds past the
    last closing curly brace in the buffer, and then also erases the last non-whitespace character after that
    if it is a comma (which shouldn't happen in practice).  This is meant to prepare the buffer for emitting
    new fields into the JSON object's serialization.

    @param output_buffer:  The buffer to rewind.
    @type output_buffer: StringO
     N/A location N/A N/A output_buffer tell N/A N/A location 0 N/A N/A location 1 N/A N/A N/A output_buffer seek location N/A N/A N/A N/A output_buffer read 1 } N/A N/A N/A last_char None N/A N/A location 0 N/A N/A location 1 N/A N/A N/A output_buffer seek location N/A last_char N/A N/A output_buffer read 1 N/A N/A N/A N/A last_char isspace N/A N/A N/A N/A N/A location 0 N/A last_char , N/A N/A location 1 N/A N/A location 0 N/A N/A N/A Exception Could not locate trailing "}" and non-whitespace in JSON serialization N/A location 1 N/A N/A N/A output_buffer seek location N/A N/A N/A output_buffer truncate N/A N/A __last_time_stamp__ None HTTPConnectionWithTimeout N/A N/A httplib HTTPConnection N/A N/A An HTTPConnection replacement with added support for setting a timeout on all blocking operations.

    Older versions of Python (2.4, 2.5) do not allow for setting a timeout directly on httplib.HTTPConnection
    objects.  This is meant to solve that problem generally.
     __init__ N/A N/A self host port timeout N/A N/A N/A N/A self __timeout timeout N/A N/A N/A N/A httplib HTTPConnection __init__ self host port N/A connect N/A N/A self N/A N/A N/A N/A hasattr socket create_connection N/A N/A N/A self sock N/A N/A socket create_connection N/A N/A self host N/A self port N/A self __timeout N/A N/A N/A self sock N/A create_connection_helper N/A self host N/A self port timeout N/A self __timeout N/A N/A N/A hasattr self _tunnel_host N/A self _tunnel_host N/A N/A N/A N/A self _tunnel N/A N/A HTTPSConnectionWithTimeoutAndVerification N/A N/A httplib HTTPSConnection N/A N/A An HTTPSConnection replacement that adds support for setting a timeout as well as performing server
    certificate validation.

    Older versions of Python (2.4, 2.5) do not allow for setting a timeout directly on httplib.HTTPConnection
    objects, nor do they perform validation of the server certificate.  However, if the user installs the ssl
    Python library, then it is possible to perform server certificate validation even on Python 2.4, 2.5.  This
    class implements the necessary support.
     __init__ N/A N/A self host port timeout ca_file has_ssl N/A N/A N/A 
        Creates an instance.

        Params:
            host: The server host to connect to.
            port: The port to connect to.
            timeout: The timeout, in seconds, to use for all blocking operations on the underlying socket.
            ca_file:  If not None, then this is a file containing the certificate authority's root cert to use
                for validating the certificate sent by the server.  This must be None if has_ssl is False.
                If None is passed in, then no validation of the server certificate will be done whatsoever, so
                you will be susceptible to man-in-the-middle attacks.  However, at least your traffic will be
                encrypted.
            has_ssl:  True if the ssl Python library is available.
         N/A N/A N/A has_ssl N/A ca_file None N/A N/A N/A Exception If has_ssl is false, you are not allowed to specify a ca_file because it has no affect. N/A N/A self __timeout timeout N/A N/A self __ca_file ca_file N/A N/A self __has_ssl has_ssl N/A N/A N/A N/A httplib HTTPSConnection __init__ self host port N/A connect N/A N/A self N/A N/A N/A N/A N/A self __has_ssl N/A N/A old_timeout None N/A N/A N/A old_timeout N/A N/A socket getdefaulttimeout N/A N/A N/A socket setdefaulttimeout N/A self __timeout N/A N/A N/A N/A httplib HTTPSConnection connect self N/A N/A N/A N/A N/A socket setdefaulttimeout old_timeout N/A N/A hasattr socket create_connection N/A N/A N/A self sock N/A N/A socket create_connection N/A N/A self host N/A self port N/A self __timeout N/A N/A N/A self sock N/A create_connection_helper N/A self host N/A self port timeout N/A self __timeout N/A N/A N/A hasattr self _tunnel_host N/A self _tunnel_host N/A N/A N/A N/A self _tunnel N/A N/A N/A self __ca_file None N/A N/A N/A self sock N/A N/A ssl wrap_socket N/A self sock ca_certs N/A self __ca_file cert_reqs N/A ssl CERT_REQUIRED N/A N/A N/A self sock N/A N/A ssl wrap_socket N/A self sock cert_reqs N/A ssl CERT_NONE N/A N/A create_connection_helper N/A N/A host port timeout source_address N/A None None N/A N/A Creates and returns a socket connecting to host:port with the specified timeout.

    @param host: The host to connect to.
    @param port: The port to connect to.
    @param timeout: The timeout in seconds to use for all blocking operations on the socket.
    @param source_address: The source address, or None.

    @return: The connected socket
     N/A err None N/A res N/A N/A socket getaddrinfo host port 0 N/A socket SOCK_STREAM N/A N/A N/A af socktype proto canonname sa res N/A sock None N/A N/A N/A sock N/A N/A socket socket af socktype proto N/A N/A timeout None N/A N/A N/A N/A sock settimeout timeout N/A N/A source_address None N/A N/A N/A N/A sock bind source_address N/A N/A N/A sock connect sa N/A sock N/A N/A N/A N/A socket error N/A _ N/A N/A err _ N/A N/A sock None N/A N/A N/A N/A sock close N/A N/A err None N/A N/A err N/A N/A N/A N/A socket error getaddrinfo returns an empty list N/A