Module Expr Str ImportFrom alias alias ImportFrom alias ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias identifier ImportFrom alias Import alias identifier ImportFrom alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias identifier Import alias Import alias identifier Import alias Import alias identifier ImportFrom alias Import alias identifier FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign SubscriptStore AttributeLoad NameLoad attr Slice Num BinOpDiv SubscriptLoad AttributeLoad NameLoad attr Slice Num SubscriptLoad AttributeLoad NameLoad attr Slice Num Num Assign SubscriptStore AttributeLoad NameLoad attr Index Num Num Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMult NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str For NameStore NameLoad body Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str For NameStore NameLoad body Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore BinOpMod Str BinOpMult NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str For NameStore NameLoad body Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str For NameStore NameLoad body Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore BinOpMult Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Return BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return TupleLoad NameLoad NameLoad Assign NameStore Num Assign NameStore Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return TupleLoad NameLoad NameLoad handlers ExceptHandler body Return TupleLoad Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str For NameStore Call NameLoad Num Call NameLoad NameLoad body If CompareEq BinOpMod NameLoad Num Num body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad ListLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num ListLoad Str Assign SubscriptStore NameLoad Index Num Call AttributeLoad SubscriptLoad NameLoad Index Num attr keyword Str Assign SubscriptStore NameLoad Index Num Call AttributeLoad SubscriptLoad NameLoad Index Num attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Index SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Index SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad NameLoad Index TupleLoad Num Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad ListLoad Str Str ListLoad Str Str ListLoad Str Str ListLoad Str Str For NameStore Call NameLoad Num Call NameLoad NameLoad body If CompareEq BinOpMod NameLoad Num Num body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad ListLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num ListLoad Str Assign SubscriptStore NameLoad Index Num Call AttributeLoad SubscriptLoad NameLoad Index Num attr keyword Str Assign SubscriptStore NameLoad Index Num Call AttributeLoad SubscriptLoad NameLoad Index Num attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Index SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num Index SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num SubscriptLoad NameLoad Index TupleLoad Num Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Num Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str SubscriptLoad NameLoad Index TupleLoad Num Num keyword Num keyword NameLoad Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str NameLoad keyword Num keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad For NameStore Call NameLoad Num SubscriptLoad NameLoad Index Num body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str BinOpMult SubscriptLoad NameLoad Index NameLoad Num AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Num For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareNotEq NameLoad ListLoad body For NameStore Call NameLoad Num SubscriptLoad NameLoad Index Num body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str BinOpMult SubscriptLoad NameLoad Index NameLoad Num AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If BoolOpAnd CompareEq NameLoad Num CompareLt NameLoad Num body Expr Call AttributeLoad NameLoad attr Str orelse Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad Num Call NameLoad keyword Num Assign NameStore Call NameLoad BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad Num Call NameLoad keyword Num Call AttributeLoad NameLoad attr keyword Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot BoolOpOr CompareEq NameLoad Num CompareEq NameLoad Num body If CompareLt NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str Assign NameStore Num For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad For NameStore Call NameLoad Num SubscriptLoad NameLoad Index Num body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Str Assign NameStore Str For NameStore NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad AugAssignAdd NameStore BinOpMod Str Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Str BinOpMult Str Num NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Str BinOpMult Str Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad BinOpMult Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Str Str Str Str Str Str NameLoad NameLoad Str Num Num Num AttributeLoad NameLoad attr Num Str body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str If BoolOpAnd CompareNotEq NameLoad Str CompareNotEq Call NameLoad NameLoad Call NameLoad ListLoad body Assign NameStore ListLoad NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad ListLoad body Assign NameStore ListLoad NameLoad Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Num If CompareNotEq NameLoad NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Str Print Str NameLoad If CompareEq Call NameLoad NameLoad Call NameLoad Str body If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad orelse If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Expr Call NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Expr Call NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str If CompareNotEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad If CompareNotEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str If CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str BinOpAdd Call NameLoad Call NameLoad BinOpMult SubscriptLoad NameLoad Index Str Num Str For NameStore NameLoad body Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad If CompareNotEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad ListLoad Str keyword NameLoad Index Num For NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr keyword Str Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr keyword Str Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Num If CompareNotEq Call NameLoad NameLoad Call NameLoad Num body For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Str Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword NameLoad Call NameLoad BinOpMult Num BinOpSub BinOpDiv SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Num keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpMult SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num NameLoad keyword NameLoad Call NameLoad BinOpMult Num BinOpSub BinOpDiv SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Num keyword Num keyword NameLoad For NameStore NameLoad body Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpMult SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num NameLoad keyword NameLoad Call NameLoad BinOpMult Num BinOpSub BinOpDiv SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Num keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Index Num keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str BinOpMod Str SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad Assign NameStore Str For NameStore Call NameLoad NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call NameLoad BinOpAdd NameLoad Str NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore Str For NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Assign NameStore Str For NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call NameLoad BinOpAdd NameLoad Str NameLoad keyword Num keyword NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad If BoolOpAnd CompareNotEq NameLoad Num CompareNotEq NameLoad Num body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Str Str Str Str Str Str NameLoad NameLoad Str Num Num Num AttributeLoad NameLoad attr Num body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Str If CompareNotEq NameLoad NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Print Str NameLoad If CompareEq Call NameLoad NameLoad Call NameLoad Str body If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad orelse If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Expr Call NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Expr Call NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str Call NameLoad NameLoad Str If CompareNotEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad If CompareNotEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Str If CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str BinOpAdd Call NameLoad Call NameLoad BinOpMult SubscriptLoad NameLoad Index Str Num Str For NameStore NameLoad body Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad If CompareNotEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad ListLoad Str Assign NameStore SubscriptLoad NameLoad Index Num For NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr keyword Str If CompareNotEq Call NameLoad NameLoad Call NameLoad Num body For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Str Expr Call NameLoad BinOpAdd NameLoad Str Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad BinOpAdd NameLoad Str Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Expr Call NameLoad BinOpAdd NameLoad Str Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpMult SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num NameLoad keyword NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str If CompareGt Call NameLoad NameLoad Num body Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Index Num keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Index Num keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str BinOpMod Str SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call NameLoad Str BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad keyword NameLoad Call NameLoad BinOpDiv BinOpMult Call NameLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Num BinOpMult SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad Assign NameStore Str For NameStore Call NameLoad NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call NameLoad BinOpAdd NameLoad Str NameLoad keyword Num keyword NameLoad Assign NameStore ListLoad Call NameLoad NameLoad NameLoad Assign NameStore ListLoad NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Assign NameStore Str For NameStore Call NameLoad NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call NameLoad BinOpAdd NameLoad Str NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign NameStore Str For NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call NameLoad BinOpAdd NameLoad Str NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Print NameLoad Print NameLoad Assign NameStore ListLoad For NameStore Call NameLoad Num Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad BinOpAdd NameLoad Str Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad Str body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad For NameStore NameLoad body Expr Call NameLoad BinOpAdd NameLoad Str Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore TupleLoad TupleLoad Num Num Num TupleLoad Num Num Num TupleLoad Num Num Num Assign NameStore Call NameLoad Call NameLoad NameLoad Print NameLoad Assign NameStore Num If CompareLt NameLoad Num body Assign NameStore NameLoad Assign NameStore TupleLoad Str Str Str Assign NameStore TupleLoad Str Str Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore BinOpMult NameLoad Num Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore TupleLoad Str Str Str Assign NameStore ListLoad For NameStore Call NameLoad Num Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd NameLoad BinOpMult NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad keyword SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad BinOpDiv BinOpMult NameLoad Call NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad For NameStore Call NameLoad Num Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad FunctionDef arguments args NameParam defaults body For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr BinOpDiv Call AttributeLoad NameLoad attr Num BinOpMult Num NameLoad BinOpMod Str Call NameLoad NameLoad keyword Str keyword Str decorator_list For NameStore Call NameLoad Num Call NameLoad NameLoad body Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Num NameLoad Num Str body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ImportFrom alias Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str If CompareEq Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num orelse Assign NameStore Call AttributeLoad NameLoad attr Num Num keyword ListLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore Num Assign NameStore Num If CompareNotEq Call NameLoad NameLoad Call NameLoad Call NameLoad body If BoolOpOr CompareEq NameLoad Num CompareGt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If BoolOpOr CompareEq NameLoad Num CompareLt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr NameLoad Str keyword Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Num For NameStore NameLoad body If BoolOpAnd CompareEq NameLoad Num CompareNotEq Call NameLoad NameLoad Num body For NameStore Call NameLoad Call NameLoad NameLoad body If BoolOpOr CompareEq NameLoad Num CompareGt NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num If BoolOpOr CompareEq NameLoad Num CompareLt NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num If CompareEq NameLoad Num body Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr BinOpMult AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Str keyword SubscriptLoad NameLoad Index NameLoad orelse Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr BinOpMult AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Str keyword SubscriptLoad NameLoad Index NameLoad orelse If BoolOpOr CompareEq NameLoad Num CompareGt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If BoolOpOr CompareEq NameLoad Num CompareLt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr NameLoad Str keyword Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad ListLoad Str Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Num If CompareNotEq Call NameLoad NameLoad Call NameLoad Num body For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr BinOpMult AttributeLoad SubscriptLoad NameLoad Index NameLoad attr NameLoad Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword TupleLoad Num Num keyword Num If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num If CompareEq Call NameLoad NameLoad Call NameLoad ListLoad body For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr keyword SubscriptLoad NameLoad Index NameLoad orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad If CompareNotEq Call NameLoad NameLoad Call NameLoad ListLoad body Assign NameStore ListLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpMult Num BinOpSub Call NameLoad Call NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpMult NameLoad Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpDiv BinOpAdd NameLoad NameLoad Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpMult NameLoad Num Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword TupleLoad Num Num keyword Num Expr Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore Call NameLoad Str Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Num Expr Call AttributeLoad NameLoad attr Assign NameStore ListLoad Str Assign NameStore Num Assign NameStore Num For NameStore NameLoad body If CompareNotEq Call NameLoad NameLoad Call NameLoad Call NameLoad body If BoolOpOr CompareEq NameLoad Num CompareGt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If BoolOpOr CompareEq NameLoad Num CompareLt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad orelse If BoolOpOr CompareEq NameLoad Num CompareGt NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Index Num body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Index Num If BoolOpOr CompareEq NameLoad Num CompareLt NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Index Num body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Index Num Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index Num attr BinOpMult AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad keyword Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad ListLoad Str keyword NameLoad Index Num Assign NameStore BinOpDiv NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Num For NameStore NameLoad body If CompareNotEq Call NameLoad NameLoad Call NameLoad Call NameLoad body Expr Call NameLoad NameLoad ListLoad Str SubscriptLoad NameLoad Index NameLoad orelse Expr Call NameLoad SubscriptLoad NameLoad Index Num ListLoad Str SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call NameLoad Str keyword Str Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad Str NameLoad Expr Call NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore Num If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Assign NameStore Num Assign NameStore Str If CompareEq NameLoad Num body Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad orelse Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad
N/A N/A 
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license.  Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.

Created on Jan 1, 2011

@author:Drew Bratcher
@contact: dbratcher@gatech.edu
@summary: Contains tutorial for backtester and report.

 os path makedirs os sys qstkutil DataEvolved de qstkutil DataAccess da qstkutil qsdateutil du qstkutil tsutil tsu qstkutil fundutil fu dateutil.relativedelta relativedelta N/A numpy np math log10 N/A converter N/A locale pylab savefig matplotlib pyplot matplotlib gridspec N/A matplotlib.dates mdates N/A cPickle N/A datetime dt N/A pandas N/A numpy np copy deepcopy N/A scipy.stats scst _dividend_rets_funds N/A N/A df_funds f_dividend_rets N/A N/A N/A df_funds_copy N/A deepcopy df_funds N/A f_price N/A deepcopy N/A df_funds_copy N/A 0 N/A N/A N/A df_funds_copy values N/A 1 N/A N/A N/A df_funds_copy values N/A 1 N/A N/A df_funds_copy values N/A 0 -1 N/A N/A N/A df_funds_copy values N/A 0 1 N/A df_funds_copy N/A df_funds_copy f_dividend_rets N/A na_funds_copy N/A N/A np cumprod N/A df_funds_copy values N/A na_funds_copy N/A na_funds_copy f_price N/A df_funds N/A N/A pandas Series na_funds_copy index N/A df_funds_copy index N/A df_funds N/A print_header N/A N/A html_file name N/A N/A N/A 
    @summary prints header of report html file
     N/A N/A N/A html_file write <HTML>
 N/A N/A N/A html_file write <HEAD>
 N/A N/A N/A html_file write N/A N/A <TITLE>QSTK Generated Report: name </TITLE>
 N/A N/A N/A html_file write </HEAD>

 N/A N/A N/A html_file write <BODY>

 N/A print_footer N/A N/A html_file N/A N/A N/A 
    @summary prints footer of report html file
     N/A N/A N/A html_file write </BODY>

 N/A N/A N/A html_file write </HTML> N/A get_annual_return N/A N/A fund_ts years N/A N/A N/A 
    @summary prints annual return for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A lf_ret N/A N/A year years N/A N/A year_vals N/A N/A date N/A fund_ts index N/A N/A N/A N/A date year year N/A N/A N/A N/A year_vals append N/A N/A N/A fund_ts ix N/A date N/A day_rets N/A N/A tsu daily1 year_vals N/A ret N/A N/A tsu get_ror_annual day_rets N/A ret N/A float ret N/A N/A N/A lf_ret append N/A ret 100 N/A lf_ret N/A get_winning_days N/A N/A fund_ts years N/A N/A N/A 
    @summary prints winning days for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A s_ret N/A year years N/A N/A year_vals N/A N/A date N/A fund_ts index N/A N/A N/A N/A date year year N/A N/A N/A N/A year_vals append N/A N/A N/A fund_ts ix N/A date N/A ret N/A N/A fu get_winning_days year_vals N/A s_ret N/A  % + 8.2f%% ret N/A s_ret N/A get_max_draw_down N/A N/A fund_ts years N/A N/A N/A 
    @summary prints max draw down for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A s_ret N/A year years N/A N/A year_vals N/A N/A date N/A fund_ts index N/A N/A N/A N/A date year year N/A N/A N/A N/A year_vals append N/A N/A fund_ts ix N/A date N/A ret N/A N/A fu get_max_draw_down year_vals N/A s_ret N/A  % + 8.2f%% N/A ret 100 N/A s_ret N/A get_daily_sharpe N/A N/A fund_ts years N/A N/A N/A 
    @summary prints sharpe ratio for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A s_ret N/A year years N/A N/A year_vals N/A N/A date N/A fund_ts index N/A N/A N/A N/A date year year N/A N/A N/A N/A year_vals append N/A N/A N/A fund_ts ix N/A date N/A ret N/A N/A fu get_sharpe_ratio year_vals N/A s_ret N/A  % + 8.2f  ret N/A s_ret N/A get_daily_sortino N/A N/A fund_ts years N/A N/A N/A 
    @summary prints sortino ratio for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A s_ret N/A year years N/A N/A year_vals N/A N/A date N/A fund_ts index N/A N/A N/A N/A date year year N/A N/A N/A N/A year_vals append N/A N/A N/A fund_ts ix N/A date N/A ret N/A N/A fu get_sortino_ratio year_vals N/A s_ret N/A  % + 8.2f  ret N/A s_ret N/A get_std_dev N/A N/A fund_ts N/A N/A N/A 
    @summary gets standard deviation of returns for a fund as a string
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A fund_ts N/A N/A fund_ts fillna method pad N/A fund_ts N/A N/A fund_ts fillna method bfill N/A ret N/A N/A N/A np std N/A N/A tsu daily N/A fund_ts values 10000 N/A N/A %+7.2f bps  ret N/A ks_statistic N/A N/A fund_ts N/A N/A N/A fund_ts N/A deepcopy fund_ts N/A N/A N/A len N/A fund_ts values 60 N/A N/A seq1 N/A N/A fund_ts values N/A 0 -60 N/A seq2 N/A N/A fund_ts values N/A -60 N/A N/A N/A tsu returnize0 seq1 N/A N/A N/A tsu returnize0 seq2 N/A N/A ks p N/A N/A scst ks_2samp seq1 seq2 N/A N/A ks p N/A ks -1 N/A p -1 N/A N/A ks p N/A ks_statistic_calc N/A N/A fund_ts_past fund_ts_month N/A N/A N/A N/A N/A seq1 N/A deepcopy N/A fund_ts_past values N/A seq2 N/A deepcopy N/A fund_ts_month values N/A N/A N/A tsu returnize0 seq1 N/A N/A N/A tsu returnize0 seq2 N/A N/A ks p N/A N/A scst ks_2samp seq1 seq2 N/A N/A ks p N/A N/A N/A N/A N/A -1 -1 N/A print_industry_coer N/A N/A fund_ts ostream N/A N/A N/A 
    @summary prints standard deviation of returns for a fund
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A industries N/A N/A $DJUSBM Materials N/A $DJUSNC Goods N/A $DJUSCY Services N/A $DJUSFN Financials N/A $DJUSHC Health N/A $DJUSIN Industrial N/A $DJUSEN Oil & Gas N/A $DJUSTC Technology N/A $DJUSTL TeleComm N/A $DJUSUT Utilities N/A i N/A range 0 N/A len industries N/A N/A N/A N/A i 2 0 N/A N/A N/A N/A ostream write N/A norObj N/A N/A de DataAccess mysql N/A ldtTimestamps N/A N/A du getNYSEdays N/A N/A fund_ts index N/A 0 N/A N/A fund_ts index N/A -1 N/A N/A dt timedelta hours 16 N/A ldfData N/A N/A norObj get_data ldtTimestamps N/A N/A N/A industries N/A i N/A 0 N/A close N/A N/A ldfData N/A 0 N/A N/A N/A ldfData N/A 0 fillna method pad N/A N/A ldfData N/A 0 N/A N/A N/A ldfData N/A 0 fillna method bfill N/A a N/A N/A np corrcoef N/A N/A np ravel N/A N/A tsu daily N/A N/A ldfData N/A 0 N/A N/A N/A industries N/A i N/A 0 N/A N/A np ravel N/A N/A tsu daily N/A fund_ts values N/A b N/A N/A np ravel N/A N/A tsu daily N/A N/A ldfData N/A 0 N/A N/A N/A industries N/A i N/A 0 N/A f N/A N/A np ravel N/A N/A tsu daily fund_ts N/A N/A fBeta unused N/A N/A np polyfit b f 1 N/A N/A N/A ostream write N/A %10s(%s):%+6.2f,   %+6.2f    N/A N/A N/A industries N/A i N/A 1 N/A N/A industries N/A i N/A 0 N/A a N/A N/A 0 1 fBeta N/A print_other_coer N/A N/A fund_ts ostream N/A N/A N/A 
    @summary prints standard deviation of returns for a fund
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A industries N/A N/A $SPX     S&P Index N/A $DJI     Dow Jones N/A $DJUSEN Oil & Gas N/A $DJGSP      Metals N/A i N/A range 0 N/A len industries N/A N/A N/A N/A i 2 0 N/A N/A N/A N/A ostream write N/A norObj N/A N/A de DataAccess mysql N/A ldtTimestamps N/A N/A du getNYSEdays N/A N/A fund_ts index N/A 0 N/A N/A fund_ts index N/A -1 N/A N/A dt timedelta hours 16 N/A ldfData N/A N/A norObj get_data ldtTimestamps N/A N/A N/A industries N/A i N/A 0 N/A close N/A N/A ldfData N/A 0 N/A N/A N/A ldfData N/A 0 fillna method pad N/A N/A ldfData N/A 0 N/A N/A N/A ldfData N/A 0 fillna method bfill N/A a N/A N/A np corrcoef N/A N/A np ravel N/A N/A tsu daily N/A N/A ldfData N/A 0 N/A N/A N/A industries N/A i N/A 0 N/A N/A np ravel N/A N/A tsu daily N/A fund_ts values N/A b N/A N/A np ravel N/A N/A tsu daily N/A N/A ldfData N/A 0 N/A N/A N/A industries N/A i N/A 0 N/A f N/A N/A np ravel N/A N/A tsu daily fund_ts N/A N/A fBeta unused N/A N/A np polyfit b f 1 N/A N/A N/A ostream write N/A %10s(%s):%+6.2f,   %+6.2f    N/A N/A N/A industries N/A i N/A 1 N/A N/A industries N/A i N/A 0 N/A a N/A N/A 0 1 fBeta N/A print_benchmark_coer N/A N/A fund_ts benchmark_close sym ostream N/A N/A N/A 
    @summary prints standard deviation of returns for a fund
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A fund_ts N/A N/A fund_ts fillna method pad N/A fund_ts N/A N/A fund_ts fillna method bfill N/A benchmark_close N/A N/A benchmark_close fillna method pad N/A benchmark_close N/A N/A benchmark_close fillna method bfill N/A faCorr N/A N/A np corrcoef N/A N/A np ravel N/A N/A tsu daily N/A fund_ts values N/A N/A np ravel N/A N/A tsu daily benchmark_close N/A b N/A N/A np ravel N/A N/A tsu daily benchmark_close N/A f N/A N/A np ravel N/A N/A tsu daily fund_ts N/A N/A fBeta unused N/A N/A np polyfit b f 1 N/A N/A print_line N/A sym Correlattion N/A %+6.2f N/A faCorr N/A N/A 0 1 i_spacing 3 ostream ostream N/A N/A print_line N/A sym Beta N/A %+6.2f fBeta i_spacing 3 ostream ostream N/A print_monthly_returns N/A N/A fund_ts years ostream N/A N/A N/A 
    @summary prints monthly returns for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A N/A N/A ostream write N/A month_names N/A N/A du getMonthNames N/A name month_names N/A N/A N/A N/A ostream write N/A N/A str name N/A N/A N/A ostream write N/A i 0 N/A mrets N/A N/A tsu monthly fund_ts N/A year years N/A N/A N/A N/A ostream write N/A str year N/A months N/A N/A du getMonths fund_ts year N/A k N/A range 1 N/A months N/A 0 N/A N/A N/A N/A ostream write N/A month months N/A N/A N/A N/A ostream write N/A  % + 6.2f N/A N/A mrets N/A i 100 N/A i 1 N/A N/A N/A ostream write N/A print_monthly_turnover N/A N/A fund_ts years ts_turnover ostream N/A N/A N/A 
    @summary prints monthly returns for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A N/A N/A ostream write N/A month_names N/A N/A du getMonthNames N/A name month_names N/A N/A N/A N/A ostream write N/A N/A str name N/A N/A N/A ostream write N/A i 0 N/A year years N/A N/A N/A N/A ostream write N/A str year N/A months N/A N/A du getMonths ts_turnover year N/A N/A months N/A N/A N/A k N/A range 1 N/A months N/A 0 N/A N/A N/A N/A ostream write N/A month months N/A N/A N/A N/A ostream write N/A  % + 6.2f N/A N/A ts_turnover N/A i 100 N/A i 1 N/A N/A N/A ostream write N/A print_monthly_ks N/A N/A fund_ts years ostream N/A N/A N/A 
    @summary prints monthly returns for given fund and years to the given stream
    @param fund_ts: pandas fund time series
    @param years: list of years to print out
    @param ostream: stream to print to
     N/A N/A N/A ostream write N/A month_names N/A N/A du getMonthNames N/A name month_names N/A N/A N/A N/A ostream write N/A N/A str name N/A N/A N/A ostream write N/A m_str N/A N/A N/A i year N/A enumerate years N/A N/A months N/A N/A du getMonths fund_ts year N/A N/A j month N/A enumerate months N/A N/A N/A N/A i 0 N/A j 3 N/A N/A N/A N/A m_str append N/A N/A dt_st N/A N/A fund_ts index N/A 0 N/A dt_today N/A N/A N/A dt datetime year month 1 N/A relativedelta months 2 N/A dt_end N/A min N/A N/A N/A N/A dt datetime year month 1 N/A relativedelta months 1 N/A N/A dt timedelta hours -5 N/A N/A fund_ts index N/A -1 N/A fund_ts_past N/A N/A fund_ts ix N/A dt_st dt_today N/A fund_ts_month N/A N/A fund_ts ix N/A dt_today dt_end N/A N/A ks p N/A ks_statistic_calc fund_ts_past fund_ts_month N/A N/A N/A N/A ks -1 N/A p -1 N/A N/A N/A ks p N/A N/A N/A N/A m_str append PASS N/A N/A N/A N/A m_str append FAIL N/A N/A N/A N/A m_str append N/A i 0 N/A year years N/A N/A N/A N/A ostream write N/A str year N/A months N/A N/A du getMonths fund_ts year N/A k N/A range 1 N/A months N/A 0 N/A N/A N/A N/A ostream write N/A month months N/A N/A N/A N/A ostream write N/A %7s N/A m_str N/A i N/A i N/A i 1 N/A N/A N/A ostream write N/A print_years N/A N/A years ostream N/A N/A N/A N/A N/A ostream write N/A s_line N/A s_line2 N/A f_token years N/A N/A s_line N/A %9d  f_token N/A s_line2 N/A %10s ------ N/A N/A N/A ostream write N/A %35s %s%30s
 N/A N/A 4 s_line N/A N/A N/A ostream write N/A %35s %s%30s
 N/A N/A 4 s_line2 N/A print_line N/A N/A s_left_side s_right_side i_spacing ostream N/A 0 stdout N/A N/A N/A N/A ostream write N/A %35s:%s%30s
 N/A s_left_side N/A i_spacing s_right_side N/A print_stats N/A N/A fund_ts benchmark name lf_dividend_rets original s_fund_name s_original_name d_trading_params d_hedge_params s_comments directory leverage s_leverage_name commissions slippage borrowcost ostream i_start_cash ts_turnover N/A 0.0 Fund Original False False Leverage 0 0 0 N/A sys stdout 1000000 False N/A N/A 
    @summary prints stats of a provided fund and benchmark
    @param fund_ts: fund value in pandas timeseries
    @param benchmark: benchmark symbol to compare fund to
    @param name: name to associate with the fund in the report
    @param directory: parameter to specify printing to a directory
    @param leverage: time series to plot with report
    @param commissions: value to print with report
    @param slippage: value to print with report
    @param ostream: stream to print stats to, defaults to stdout
     N/A N/A N/A locale setlocale N/A locale LC_ALL N/A N/A N/A original N/A N/A type original N/A type N/A N/A N/A original N/A original N/A N/A N/A type s_original_name N/A type N/A N/A N/A s_original_name N/A s_original_name N/A s_formatted_original_name N/A N/A name_temp s_original_name N/A N/A N/A N/A s_formatted_original_name append N/A %15s name_temp N/A s_formatted_fund_name N/A %15s s_fund_name N/A fund_ts N/A N/A fund_ts fillna method pad N/A fund_ts N/A N/A fund_ts fillna method bfill N/A fund_ts N/A N/A fund_ts fillna 1.0 N/A N/A directory False N/A N/A N/A N/A N/A path exists directory N/A N/A N/A makedirs directory N/A sfile N/A N/A path join directory N/A report-%s.html name N/A splot N/A plot-%s.png name N/A splot_dir N/A N/A path join directory splot N/A ostream N/A open sfile wb N/A N/A N/A ostream write <pre> N/A writing to  sfile N/A N/A N/A type original N/A type str N/A N/A N/A N/A type leverage N/A type False N/A N/A N/A print_plot fund_ts benchmark name splot_dir lf_dividend_rets leverage leverage i_start_cash i_start_cash s_leverage_name s_leverage_name N/A N/A N/A print_plot fund_ts benchmark name splot_dir lf_dividend_rets i_start_cash i_start_cash N/A N/A N/A N/A type leverage N/A type False N/A N/A N/A print_plot N/A fund_ts original benchmark name splot_dir s_original_name lf_dividend_rets leverage leverage i_start_cash i_start_cash s_leverage_name s_leverage_name N/A N/A N/A print_plot N/A fund_ts original benchmark name splot_dir s_original_name lf_dividend_rets i_start_cash i_start_cash N/A start_date N/A N/A N/A N/A fund_ts index N/A 0 strftime %m/%d/%Y N/A end_date N/A N/A N/A N/A fund_ts index N/A -1 strftime %m/%d/%Y N/A N/A N/A ostream write N/A N/A Performance Summary for  N/A str N/A N/A path basename name  Backtest
 N/A N/A N/A ostream write N/A N/A N/A N/A For the dates  N/A str start_date  to  N/A str end_date N/A N/A d_trading_params N/A N/A N/A N/A ostream write 

Trading Paramaters

 N/A var d_trading_params N/A N/A N/A print_line var N/A d_trading_params N/A var ostream ostream N/A N/A d_hedge_params N/A N/A N/A N/A ostream write 
Hedging Paramaters

 N/A N/A N/A type N/A d_hedge_params N/A Weight of Hedge N/A type float N/A N/A N/A d_hedge_params N/A Weight of Hedge N/A N/A str N/A int N/A N/A d_hedge_params N/A Weight of Hedge 100 % N/A var d_hedge_params N/A N/A N/A print_line var N/A d_hedge_params N/A var ostream ostream N/A N/A s_comments N/A N/A N/A N/A ostream write N/A 
Comments

%s s_comments N/A N/A directory False N/A N/A N/A N/A ostream write N/A N/A 

<img src= splot  width=700 />

 N/A mult N/A i_start_cash N/A N/A fund_ts values N/A 0 N/A timeofday N/A N/A dt timedelta hours 16 N/A timestamps N/A N/A du getNYSEdays N/A N/A fund_ts index N/A 0 N/A N/A fund_ts index N/A -1 timeofday N/A dataobj N/A N/A de DataAccess mysql N/A years N/A N/A du getYears fund_ts N/A benchmark_close N/A N/A N/A dataobj get_data timestamps benchmark N/A close verbose False N/A 0 N/A bench_sym benchmark N/A N/A N/A benchmark_close N/A bench_sym N/A N/A N/A benchmark_close N/A bench_sym fillna method pad N/A N/A benchmark_close N/A bench_sym N/A N/A N/A benchmark_close N/A bench_sym fillna method bfill N/A N/A benchmark_close N/A bench_sym N/A N/A N/A benchmark_close N/A bench_sym fillna 1.0 N/A N/A N/A type lf_dividend_rets N/A type 0.0 N/A N/A N/A i sym N/A enumerate benchmark N/A N/A N/A benchmark_close N/A sym N/A _dividend_rets_funds N/A benchmark_close N/A sym N/A lf_dividend_rets N/A i N/A N/A N/A ostream write N/A N/A Resulting Values in $ with an initial investment of  N/A N/A locale currency N/A int N/A round i_start_cash grouping True N/A N/A print_line N/A s_formatted_fund_name  Resulting Value N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round N/A N/A N/A fund_ts values N/A -1 mult grouping True N/A float N/A 100 N/A N/A N/A N/A fund_ts values N/A -1 N/A N/A fund_ts values N/A 0 1 i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A mult3 N/A i_start_cash N/A N/A N/A original N/A i values N/A 0 N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Resulting Value N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round N/A N/A N/A N/A original N/A i values N/A -1 mult3 grouping True N/A float N/A 100 N/A N/A N/A N/A N/A original N/A i values N/A -1 N/A N/A N/A original N/A i values N/A 0 1 i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A mult2 N/A i_start_cash N/A N/A N/A benchmark_close N/A bench_sym values N/A 0 N/A N/A print_line N/A bench_sym  Resulting Value N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round N/A N/A N/A N/A benchmark_close N/A bench_sym values N/A -1 mult2 grouping True N/A float N/A 100 N/A N/A N/A N/A N/A benchmark_close N/A bench_sym values N/A -1 N/A N/A N/A benchmark_close N/A bench_sym values N/A 0 1 i_spacing 4 ostream ostream N/A N/A N/A ostream write N/A N/A print_line N/A s_formatted_fund_name  Sharpe Ratio N/A %10.3f N/A N/A N/A fu get_sharpe_ratio N/A fund_ts values N/A 0 i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Sharpe Ratio N/A %10.3f N/A N/A N/A fu get_sharpe_ratio N/A N/A original N/A i values N/A 0 i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Sharpe Ratio N/A %10.3f N/A N/A N/A fu get_sharpe_ratio N/A N/A benchmark_close N/A bench_sym values N/A 0 i_spacing 4 ostream ostream N/A N/A N/A ostream write N/A N/A N/A ostream write Transaction Costs
 N/A N/A print_line Total Commissions N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round commissions grouping True N/A float N/A N/A N/A round commissions 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A print_line Total Slippage N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round slippage grouping True N/A float N/A N/A N/A round slippage 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A print_line Total Short Borrowing Cost N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round borrowcost grouping True N/A float N/A N/A N/A round borrowcost 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A print_line Total Costs N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round N/A N/A borrowcost slippage commissions grouping True N/A float N/A N/A N/A round N/A N/A borrowcost slippage commissions 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A N/A ostream write N/A N/A print_line N/A s_formatted_fund_name  Std Dev of Returns N/A get_std_dev fund_ts i_spacing 8 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Std Dev of Returns N/A get_std_dev N/A original N/A i i_spacing 8 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Std Dev of Returns N/A get_std_dev N/A benchmark_close N/A bench_sym i_spacing 8 ostream ostream N/A N/A N/A ostream write N/A bench_sym benchmark N/A N/A N/A print_benchmark_coer fund_ts N/A benchmark_close N/A bench_sym N/A str bench_sym ostream N/A N/A N/A ostream write N/A N/A N/A ostream write 
Yearly Performance Metrics N/A N/A print_years years ostream N/A s_line N/A f_token N/A get_annual_return fund_ts years N/A N/A s_line N/A  %+8.2f%% f_token N/A N/A print_line N/A s_formatted_fund_name  Annualized Return s_line i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A s_line N/A f_token N/A get_annual_return N/A original N/A i years N/A N/A s_line N/A  %+8.2f%% f_token N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Annualized Return s_line i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A s_line N/A f_token N/A get_annual_return N/A benchmark_close N/A bench_sym years N/A N/A s_line N/A  %+8.2f%% f_token N/A N/A print_line N/A bench_sym  Annualized Return s_line i_spacing 4 ostream ostream N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Winning Days N/A get_winning_days fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Winning Days N/A get_winning_days N/A original N/A i years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Winning Days N/A get_winning_days N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Max Draw Down N/A get_max_draw_down fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Max Draw Down N/A get_max_draw_down N/A original N/A i years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Max Draw Down N/A get_max_draw_down N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Daily Sharpe Ratio N/A get_daily_sharpe fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Daily Sharpe Ratio N/A get_daily_sharpe N/A original N/A i years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Daily Sharpe Ratio N/A get_daily_sharpe N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Daily Sortino Ratio N/A get_daily_sortino fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A i N/A range N/A len original N/A N/A N/A print_line N/A N/A s_formatted_original_name N/A i  Daily Sortino Ratio N/A get_daily_sortino N/A original N/A i years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Daily Sortino Ratio N/A get_daily_sortino N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A N/A ostream write 


Correlation and Beta with DJ Industries for the Fund  N/A N/A print_industry_coer fund_ts ostream N/A N/A N/A ostream write 

Correlation and Beta with Other Indices for the Fund  N/A N/A print_other_coer fund_ts ostream N/A N/A N/A ostream write 


Monthly Returns for the Fund %
 N/A N/A print_monthly_returns fund_ts years ostream N/A N/A N/A type ts_turnover N/A type False N/A N/A N/A N/A ostream write 

Monthly Turnover for the fund
 N/A N/A print_monthly_turnover fund_ts years ts_turnover ostream N/A N/A N/A ostream write 

3 Month Kolmogorov-Smirnov 2-Sample Similarity Test
 N/A N/A print_monthly_ks fund_ts years ostream N/A N/A ks p N/A ks_statistic fund_ts N/A N/A N/A ks -1 N/A p -1 N/A N/A N/A N/A ostream write N/A 
Results for the Similarity Test over last 3 months : (KS = %2.5f, p = %2.5f) 

 N/A ks p N/A N/A directory False N/A N/A N/A N/A ostream write </pre> N/A print_html N/A N/A fund_ts benchmark name lf_dividend_rets original s_fund_name s_original_name d_trading_params d_hedge_params s_comments directory leverage s_leverage_name commissions slippage borrowcost ostream i_start_cash N/A 0.0 Fund Original False False Leverage 0 0 0 N/A sys stdout 1000000 N/A N/A 
    @summary prints stats of a provided fund and benchmark
    @param fund_ts: fund value in pandas timeseries
    @param benchmark: benchmark symbol to compare fund to
    @param name: name to associate with the fund in the report
    @param directory: parameter to specify printing to a directory
    @param leverage: time series to plot with report
    @param commissions: value to print with report
    @param slippage: value to print with report
    @param ostream: stream to print stats to, defaults to stdout
     N/A N/A N/A locale setlocale N/A locale LC_ALL N/A s_formatted_original_name N/A %15s s_original_name N/A s_formatted_fund_name N/A %15s s_fund_name N/A fund_ts N/A N/A fund_ts fillna method pad N/A N/A directory False N/A N/A N/A N/A N/A path exists directory N/A N/A N/A makedirs directory N/A sfile N/A N/A path join directory N/A report-%s.html name N/A splot N/A plot-%s.png name N/A splot_dir N/A N/A path join directory splot N/A ostream N/A open sfile wb N/A writing to  sfile N/A N/A N/A type original N/A type str N/A N/A N/A N/A type leverage N/A type False N/A N/A N/A print_plot fund_ts benchmark name splot_dir lf_dividend_rets leverage leverage i_start_cash i_start_cash s_leverage_name s_leverage_name N/A N/A N/A print_plot fund_ts benchmark name splot_dir lf_dividend_rets i_start_cash i_start_cash N/A N/A N/A N/A type leverage N/A type False N/A N/A N/A print_plot N/A fund_ts original benchmark name splot_dir s_original_name lf_dividend_rets leverage leverage i_start_cash i_start_cash s_leverage_name s_leverage_name N/A N/A N/A print_plot N/A fund_ts original benchmark name splot_dir s_original_name lf_dividend_rets i_start_cash i_start_cash N/A N/A print_header ostream name N/A start_date N/A N/A N/A N/A fund_ts index N/A 0 strftime %m/%d/%Y N/A end_date N/A N/A N/A N/A fund_ts index N/A -1 strftime %m/%d/%Y N/A N/A N/A ostream write N/A N/A Performance Summary for  N/A str N/A N/A path basename name  Backtest
 N/A N/A N/A ostream write N/A N/A N/A N/A For the dates  N/A str start_date  to  N/A str end_date N/A N/A d_trading_params N/A N/A N/A N/A ostream write 

Trading Paramaters

 N/A var d_trading_params N/A N/A N/A print_line var N/A d_trading_params N/A var ostream ostream N/A N/A d_hedge_params N/A N/A N/A N/A ostream write 
Hedging Paramaters

 N/A N/A N/A type N/A d_hedge_params N/A Weight of Hedge N/A type float N/A N/A N/A d_hedge_params N/A Weight of Hedge N/A N/A str N/A int N/A N/A d_hedge_params N/A Weight of Hedge 100 % N/A var d_hedge_params N/A N/A N/A print_line var N/A d_hedge_params N/A var ostream ostream N/A N/A s_comments N/A N/A N/A N/A ostream write N/A 
Comments

%s s_comments N/A N/A directory False N/A N/A N/A N/A ostream write N/A N/A 

<img src= splot  width=600 />

 N/A mult N/A i_start_cash N/A N/A fund_ts values N/A 0 N/A timeofday N/A N/A dt timedelta hours 16 N/A timestamps N/A N/A du getNYSEdays N/A N/A fund_ts index N/A 0 N/A N/A fund_ts index N/A -1 timeofday N/A dataobj N/A N/A de DataAccess mysql N/A years N/A N/A du getYears fund_ts N/A benchmark_close N/A N/A dataobj get_data timestamps benchmark N/A close N/A benchmark_close N/A benchmark_close N/A 0 N/A bench_sym benchmark N/A N/A N/A benchmark_close N/A bench_sym N/A N/A N/A benchmark_close N/A bench_sym fillna method pad N/A N/A N/A type lf_dividend_rets N/A type 0.0 N/A N/A N/A i sym N/A enumerate benchmark N/A N/A N/A benchmark_close N/A sym N/A _dividend_rets_funds N/A benchmark_close N/A sym N/A lf_dividend_rets N/A i N/A N/A N/A ostream write N/A N/A Resulting Values in $ with an initial investment of  N/A N/A locale currency N/A int N/A round i_start_cash grouping True N/A N/A print_line N/A s_formatted_fund_name  Resulting Value N/A N/A locale currency N/A int N/A round N/A N/A N/A fund_ts values N/A -1 mult grouping True i_spacing 3 ostream ostream N/A N/A N/A type original N/A type str N/A N/A mult3 N/A i_start_cash N/A N/A original values N/A 0 N/A N/A print_line N/A s_formatted_original_name  Resulting Value N/A N/A locale currency N/A int N/A round N/A N/A N/A original values N/A -1 mult3 grouping True i_spacing 3 ostream ostream N/A bench_sym benchmark N/A N/A mult2 N/A i_start_cash N/A N/A N/A benchmark_close N/A bench_sym values N/A 0 N/A N/A print_line N/A bench_sym  Resulting Value N/A N/A locale currency N/A int N/A round N/A N/A N/A N/A benchmark_close N/A bench_sym values N/A -1 mult2 grouping True i_spacing 3 ostream ostream N/A N/A N/A ostream write N/A N/A N/A len years 1 N/A N/A N/A print_line N/A s_formatted_fund_name  Sharpe Ratio N/A %10.3f N/A N/A N/A fu get_sharpe_ratio N/A fund_ts values N/A 0 i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A N/A print_line N/A s_formatted_original_name  Sharpe Ratio N/A %10.3f N/A N/A N/A fu get_sharpe_ratio N/A original values N/A 0 i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Sharpe Ratio N/A %10.3f N/A N/A N/A fu get_sharpe_ratio N/A N/A benchmark_close N/A bench_sym values N/A 0 i_spacing 4 ostream ostream N/A N/A N/A ostream write N/A N/A N/A ostream write Transaction Costs
 N/A N/A print_line Total Commissions N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round commissions grouping True N/A float N/A N/A N/A round commissions 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A print_line Total Slippage N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round slippage grouping True N/A float N/A N/A N/A round slippage 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A print_line Total Short Borrowing Cost N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round borrowcost grouping True N/A float N/A N/A N/A round borrowcost 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A print_line Total Costs N/A  %15s, %10.2f%% N/A N/A N/A locale currency N/A int N/A round N/A N/A borrowcost slippage commissions grouping True N/A float N/A N/A N/A round N/A N/A borrowcost slippage commissions 100 N/A N/A N/A fund_ts values N/A -1 mult i_spacing 4 ostream ostream N/A N/A N/A ostream write N/A N/A print_line N/A s_formatted_fund_name  Std Dev of Returns N/A get_std_dev fund_ts i_spacing 8 ostream ostream N/A N/A N/A type original N/A type str N/A N/A N/A print_line N/A s_formatted_original_name  Std Dev of Returns N/A get_std_dev original i_spacing 8 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Std Dev of Returns N/A get_std_dev N/A benchmark_close N/A bench_sym i_spacing 8 ostream ostream N/A N/A N/A ostream write N/A bench_sym benchmark N/A N/A N/A print_benchmark_coer fund_ts N/A benchmark_close N/A bench_sym N/A str bench_sym ostream N/A N/A N/A ostream write N/A N/A N/A ostream write 
Yearly Performance Metrics N/A N/A print_years years ostream N/A s_line N/A f_token N/A get_annual_return fund_ts years N/A N/A s_line N/A  %+8.2f%% f_token N/A N/A print_line N/A s_formatted_fund_name  Annualized Return s_line i_spacing 4 ostream ostream N/A lf_vals N/A N/A get_annual_return fund_ts years N/A ls_labels N/A name N/A N/A N/A type original N/A type str N/A N/A s_line N/A f_token N/A get_annual_return original years N/A N/A s_line N/A  %+8.2f%% f_token N/A N/A print_line N/A s_formatted_original_name  Annualized Return s_line i_spacing 4 ostream ostream N/A N/A N/A lf_vals append N/A get_annual_return original years N/A N/A N/A ls_labels append s_original_name N/A bench_sym benchmark N/A N/A s_line N/A f_token N/A get_annual_return N/A benchmark_close N/A bench_sym years N/A N/A s_line N/A  %+8.2f%% f_token N/A N/A print_line N/A bench_sym  Annualized Return s_line i_spacing 4 ostream ostream N/A N/A N/A lf_vals append N/A get_annual_return N/A benchmark_close N/A bench_sym years N/A N/A N/A ls_labels append bench_sym N/A lf_vals N/A ls_labels N/A ls_year_labels N/A N/A i N/A range 0 N/A len years N/A N/A N/A N/A ls_year_labels append N/A str N/A years N/A i N/A N/A print_bar_chart lf_vals ls_labels ls_year_labels N/A directory /annual_rets.png N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Winning Days N/A get_winning_days fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A N/A print_line N/A s_formatted_original_name  Winning Days N/A get_winning_days original years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Winning Days N/A get_winning_days N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Max Draw Down N/A get_max_draw_down fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A N/A print_line N/A s_formatted_original_name  Max Draw Down N/A get_max_draw_down original years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Max Draw Down N/A get_max_draw_down N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Daily Sharpe Ratio N/A get_daily_sharpe fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A N/A print_line N/A s_formatted_original_name  Daily Sharpe Ratio N/A get_daily_sharpe original years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Daily Sharpe Ratio N/A get_daily_sharpe N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A print_years years ostream N/A N/A print_line N/A s_formatted_fund_name  Daily Sortino Ratio N/A get_daily_sortino fund_ts years i_spacing 4 ostream ostream N/A N/A N/A type original N/A type str N/A N/A N/A print_line N/A s_formatted_original_name  Daily Sortino Ratio N/A get_daily_sortino original years i_spacing 4 ostream ostream N/A bench_sym benchmark N/A N/A N/A print_line N/A bench_sym  Daily Sortino Ratio N/A get_daily_sortino N/A benchmark_close N/A bench_sym years i_spacing 4 ostream ostream N/A N/A N/A ostream write 


Correlation and Beta with DJ Industries for the Fund  N/A N/A print_industry_coer fund_ts ostream N/A N/A N/A ostream write 

Correlation and Beta with Other Indices for the Fund  N/A N/A print_other_coer fund_ts ostream N/A N/A N/A ostream write 


Monthly Returns for the Fund %
 N/A N/A print_monthly_returns fund_ts years ostream N/A N/A print_footer ostream N/A print_bar_chart N/A N/A llf_vals ls_fund_labels ls_year_labels s_filename N/A N/A N/A llf_vals N/A N/A 1 2 3 N/A 3 2 1 N/A 2 2 2 N/A amin N/A min N/A min llf_vals N/A amin N/A min_lim 0 N/A N/A amin 0 N/A N/A min_lim amin N/A ls_fund_labels N/A Fund 1 Benchmark Original N/A ls_year_labels N/A 2000 2001 2002 N/A N/A N/A pyplot clf N/A ind N/A N/A np arange N/A len ls_year_labels N/A ind N/A ind 2 N/A width 0.35 N/A fig N/A N/A pyplot figure N/A ax N/A N/A fig add_subplot 111 N/A colors N/A r g b N/A rects N/A N/A i N/A range 0 N/A len llf_vals N/A N/A N/A N/A rects append N/A N/A ax bar N/A ind N/A width i N/A llf_vals N/A i width color N/A colors N/A i N/A N/A N/A ax set_ylabel Annual Return N/A N/A N/A ax set_ylim min_lim 5 N/A N/A N/A ax set_title Annual Return by Fund and Year N/A N/A N/A ax set_xticks N/A ind N/A N/A width N/A len llf_vals 2 N/A N/A N/A ax set_xticklabels ls_year_labels N/A plots N/A N/A i N/A range 0 N/A len llf_vals N/A N/A N/A N/A plots append N/A N/A rects N/A i N/A 0 N/A N/A N/A ax legend plots ls_fund_labels autolabel N/A N/A rects N/A N/A N/A rect rects N/A N/A height N/A N/A rect get_height N/A N/A N/A ax text N/A N/A N/A rect get_x N/A N/A N/A rect get_width 2.0 N/A 1.05 height N/A %d N/A int height ha center va bottom N/A N/A i N/A range 0 N/A len llf_vals N/A N/A N/A autolabel N/A rects N/A i N/A N/A savefig s_filename format png N/A print_plot N/A N/A fund benchmark graph_name filename s_original_name lf_dividend_rets leverage i_start_cash s_leverage_name N/A 0.0 False 1000000 Leverage N/A N/A 
    @summary prints a plot of a provided fund and benchmark
    @param fund: fund value in pandas timeseries
    @param benchmark: benchmark symbol to compare fund to
    @param graph_name: name to associate with the fund in the report
    @param filename: file location to store plot1
     N/A N/A N/A pyplot clf N/A fig N/A N/A pyplot figure matplotlib.font_manager FontProperties N/A fontP N/A FontProperties N/A N/A N/A fontP set_size small N/A N/A N/A type leverage N/A type False N/A N/A ax N/A N/A pyplot subplot 111 N/A N/A gs N/A N/A gridspec GridSpec 2 1 height_ratios N/A 4 1 N/A ax N/A N/A pyplot subplot N/A gs N/A 0 N/A start_date 0 N/A end_date 0 N/A N/A N/A type fund N/A type N/A list N/A N/A N/A N/A start_date 0 N/A start_date N/A N/A fund index N/A 0 N/A N/A start_date N/A N/A fund index N/A 0 N/A N/A N/A end_date 0 N/A end_date N/A N/A fund index N/A -1 N/A N/A end_date N/A N/A fund index N/A -1 N/A mult N/A i_start_cash N/A N/A fund values N/A 0 N/A N/A N/A pyplot plot N/A fund index N/A N/A fund values mult b label N/A N/A path basename graph_name N/A N/A i 0 N/A entity fund N/A N/A N/A N/A i 1 N/A N/A len fund 1 N/A N/A j N/A range N/A len entity N/A N/A N/A N/A start_date 0 N/A start_date N/A N/A N/A entity N/A j index N/A 0 N/A N/A start_date N/A N/A N/A entity N/A j index N/A 0 N/A N/A N/A end_date 0 N/A end_date N/A N/A N/A entity N/A j index N/A -1 N/A N/A end_date N/A N/A N/A entity N/A j index N/A -1 N/A mult N/A i_start_cash N/A N/A N/A entity N/A j values N/A 0 N/A N/A j 0 N/A N/A N/A N/A pyplot plot N/A N/A entity N/A j index N/A N/A N/A entity N/A j values mult k label N/A s_original_name N/A j N/A N/A N/A N/A pyplot plot N/A N/A entity N/A j index N/A N/A N/A entity N/A j values mult g label N/A s_original_name N/A j N/A N/A N/A N/A start_date 0 N/A start_date N/A N/A entity index N/A 0 N/A N/A start_date N/A N/A entity index N/A 0 N/A N/A N/A end_date 0 N/A end_date N/A N/A entity index N/A -1 N/A N/A end_date N/A N/A entity index N/A -1 N/A mult N/A i_start_cash N/A N/A entity values N/A 0 N/A N/A N/A pyplot plot N/A entity index N/A N/A entity values mult b label N/A N/A path basename graph_name N/A i N/A i 1 N/A timeofday N/A N/A dt timedelta hours 16 N/A timestamps N/A N/A du getNYSEdays start_date end_date timeofday N/A dataobj N/A N/A de DataAccess mysql N/A benchmark_close N/A N/A dataobj get_data timestamps benchmark N/A close N/A benchmark_close N/A benchmark_close N/A 0 N/A benchmark_close N/A N/A benchmark_close fillna method pad N/A benchmark_close N/A N/A benchmark_close fillna method bfill N/A benchmark_close N/A N/A benchmark_close fillna 1.0 N/A N/A N/A type lf_dividend_rets N/A type 0.0 N/A N/A N/A i sym N/A enumerate benchmark N/A N/A N/A benchmark_close N/A sym N/A _dividend_rets_funds N/A benchmark_close N/A sym N/A lf_dividend_rets N/A i N/A N/A i sym N/A enumerate benchmark N/A N/A mult N/A i_start_cash N/A N/A N/A benchmark_close N/A sym values N/A 0 N/A N/A N/A pyplot plot N/A N/A benchmark_close N/A sym index N/A N/A N/A benchmark_close N/A sym values mult r label sym N/A N/A N/A pyplot xlabel Date size xx-small N/A N/A N/A pyplot ylabel Fund Value size xx-small N/A N/A N/A pyplot xticks size xx-small N/A N/A N/A pyplot yticks size xx-small N/A box N/A N/A ax get_position N/A N/A N/A ax set_position N/A N/A box x0 N/A N/A box y0 N/A N/A box height 0.1 N/A box width N/A N/A box height 0.9 N/A N/A N/A ax legend prop fontP loc upper center bbox_to_anchor N/A 0.5 -0.05 ncol 3 N/A N/A N/A type leverage N/A type False N/A N/A ax1 N/A N/A pyplot subplot N/A gs N/A 1 N/A N/A N/A type leverage N/A type N/A N/A N/A i N/A range N/A len leverage N/A N/A N/A N/A pyplot plot N/A N/A leverage N/A i index N/A N/A leverage N/A i values label N/A s_leverage_name N/A i N/A N/A N/A N/A pyplot plot N/A leverage index N/A leverage values label s_leverage_name N/A N/A N/A type leverage N/A type N/A N/A N/A labels N/A N/A max_label N/A max N/A leverage values N/A min_label N/A min N/A leverage values N/A rounder N/A -1 N/A N/A round N/A log10 max_label 1 N/A N/A N/A labels append N/A round N/A min_label 0.9 N/A int rounder N/A N/A N/A labels append N/A round N/A N/A max_label min_label 2 N/A int rounder N/A N/A N/A labels append N/A round N/A max_label 1.1 N/A int rounder N/A N/A N/A pyplot yticks labels size xx-small N/A N/A N/A pyplot xlabel Date size xx-small N/A N/A N/A pyplot ylabel Exposure size xx-small N/A N/A N/A pyplot xticks size xx-small N/A N/A N/A pyplot yticks size xx-small N/A box N/A N/A ax1 get_position N/A N/A N/A ax1 set_position N/A N/A box x0 N/A N/A box y0 N/A N/A box height 0.1 N/A box width N/A N/A box height 0.9 N/A N/A N/A ax1 legend prop fontP loc upper center bbox_to_anchor N/A 0.5 -0.15 ncol 3 N/A N/A N/A pyplot savefig filename format png N/A generate_report N/A N/A funds_list graph_names out_file i_start_cash N/A 10000 N/A N/A 
    @summary generates a report given a list of fund time series
     N/A html_file N/A open report.html w N/A N/A print_header html_file out_file N/A N/A N/A html_file write <IMG SRC = './funds.png' width = 400/>
 N/A N/A N/A html_file write <BR/>

 N/A i 0 N/A N/A N/A pyplot clf N/A symbol N/A $SPX N/A start_date 0 N/A end_date 0 N/A fund funds_list N/A N/A N/A N/A type fund N/A type N/A list N/A N/A N/A N/A start_date 0 N/A start_date N/A N/A fund index N/A 0 N/A N/A start_date N/A N/A fund index N/A 0 N/A N/A N/A end_date 0 N/A end_date N/A N/A fund index N/A -1 N/A N/A end_date N/A N/A fund index N/A -1 N/A mult N/A i_start_cash N/A N/A fund values N/A 0 N/A N/A N/A pyplot plot N/A fund index N/A N/A fund values mult label N/A N/A path basename N/A graph_names N/A i N/A N/A N/A N/A start_date 0 N/A start_date N/A N/A N/A fund N/A 0 index N/A 0 N/A N/A start_date N/A N/A N/A fund N/A 0 index N/A 0 N/A N/A N/A end_date 0 N/A end_date N/A N/A N/A fund N/A 0 index N/A -1 N/A N/A end_date N/A N/A N/A fund N/A 0 index N/A -1 N/A mult N/A i_start_cash N/A N/A N/A fund N/A 0 values N/A 0 N/A N/A N/A pyplot plot N/A N/A fund N/A 0 index N/A N/A N/A fund N/A 0 values mult label N/A N/A path basename N/A graph_names N/A i N/A i 1 N/A timeofday N/A N/A dt timedelta hours 16 N/A timestamps N/A N/A du getNYSEdays start_date end_date timeofday N/A dataobj N/A N/A de DataAccess mysql N/A benchmark_close N/A N/A N/A dataobj get_data timestamps symbol N/A close verbose False N/A 0 N/A mult N/A i_start_cash N/A N/A benchmark_close values N/A 0 N/A i 0 N/A fund funds_list N/A N/A N/A N/A type fund N/A type N/A list N/A N/A N/A print_stats fund N/A $SPX N/A graph_names N/A i N/A N/A N/A print_stats N/A fund N/A 0 N/A $SPX N/A graph_names N/A i N/A i 1 N/A N/A N/A pyplot plot N/A benchmark_close index N/A N/A benchmark_close values mult label SSPX N/A N/A N/A pyplot ylabel Fund Value N/A N/A N/A pyplot xlabel Date N/A N/A N/A pyplot legend N/A N/A savefig funds.png format png N/A N/A print_footer html_file N/A generate_robust_report N/A N/A fund_matrix out_file N/A N/A N/A 
    @summary generates a report using robust backtesting
    @param fund_matrix: a pandas matrix of fund time series
    @param out_file: filename where to print report
     N/A html_file N/A open out_file w N/A N/A print_header html_file out_file N/A N/A N/A converter fundsToPNG fund_matrix funds.png N/A N/A N/A html_file write N/A N/A <H2>QSTK Generated Report: out_file </H2>
 N/A N/A N/A html_file write <IMG SRC = './funds.png'/>
 N/A N/A N/A html_file write <IMG SRC = './analysis.png'/>
 N/A N/A N/A html_file write <BR/>

 N/A N/A print_stats fund_matrix robust funds html_file N/A N/A print_footer html_file N/A N/A N/A __name__ __main__ N/A N/A ROBUST 0 N/A N/A N/A N/A sys argv N/A 1 -r N/A N/A ROBUST 1 N/A FILENAME report.html N/A N/A ROBUST 1 N/A N/A ANINPUT N/A open N/A N/A sys argv N/A 2 r N/A FUNDS N/A N/A cPickle load ANINPUT N/A N/A generate_robust_report FUNDS FILENAME N/A N/A FILES N/A sys argv N/A N/A N/A FILES remove N/A FILES N/A 0 N/A FUNDS N/A N/A AFILE FILES N/A N/A ANINPUT N/A open AFILE r N/A FUND N/A N/A cPickle load ANINPUT N/A N/A N/A FUNDS append FUND N/A N/A generate_report FUNDS FILES FILENAME