Module Expr Str ImportFrom alias ImportFrom alias alias alias alias Import alias Import alias Import alias identifier Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias identifier alias identifier alias ImportFrom alias Assign NameStore Str Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Num attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num Num Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index Num Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Num Num Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Num Num ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str If CompareEq NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Index BinOpSub NameLoad Num orelse If CompareEq NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Index BinOpSub NameLoad Num orelse Raise Call NameLoad Str Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str ImportFrom alias Return Call NameLoad BinOpSub Num NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore BinOpAdd BinOpAdd BinOpMult NameLoad Num BinOpMult NameLoad Num BinOpMult NameLoad Num Assign NameStore BinOpSub BinOpAdd BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Num Assign NameStore BinOpDiv NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv NameLoad Call NameLoad NameLoad Assign NameStore BinOpSub BinOpAdd BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Num Assign NameStore Num Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Num Assign NameStore Call NameLoad Num NameLoad keyword Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad NameLoad Assign NameStore ListLoad Expr Call NameLoad NameLoad Expr Call NameLoad NameLoad Expr Call NameLoad NameLoad If CompareGt NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str If CompareGt NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str If CompareGt NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore BinOpMult Call NameLoad NameLoad Num Assign NameStore BinOpSub BinOpAdd BinOpAdd Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Num Assign NameStore BinOpDiv NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp BinOpMult NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore CompareLt SubscriptLoad NameLoad Slice Num Num Assign NameStore CompareGt SubscriptLoad NameLoad Slice Num Num Assign NameStore BinOpAdd SubscriptLoad Call AttributeLoad NameLoad attr BinOpBitOr BinOpBitAnd NameLoad NameLoad CompareEq SubscriptLoad NameLoad Slice Num Num Index Num Num If CompareGtE SubscriptLoad NameLoad Index Num Num body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore CompareGt SubscriptLoad NameLoad Slice Num Num Assign NameStore CompareLt SubscriptLoad NameLoad Slice Num Num Assign NameStore BinOpAdd SubscriptLoad Call AttributeLoad NameLoad attr BinOpBitOr BinOpBitAnd NameLoad NameLoad CompareEq SubscriptLoad NameLoad Slice Num Num Index Num Num If CompareLtE SubscriptLoad NameLoad Index Num Num body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad Assign NameStore BinOpDiv NameLoad BinOpAdd BinOpMult NameLoad BinOpSub Num NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call NameLoad NameLoad If CompareIn NameLoad ListLoad Str Str Str Str body Assign NameStore BinOpDiv NameLoad NameLoad orelse If CompareIn NameLoad ListLoad Str Str body Assign NameStore Call AttributeLoad NameLoad attr BinOpDiv Num Call AttributeLoad NameLoad attr Num Call NameLoad NameLoad Assign NameStore BinOpMult BinOpDiv NameLoad NameLoad NameLoad orelse If CompareIn NameLoad ListLoad Str Str body Assign NameStore BinOpDiv NameLoad BinOpAdd BinOpMult NameLoad BinOpSub Num NameLoad NameLoad orelse If CompareIn NameLoad ListLoad Str Str body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore BinOpDiv BinOpDiv NameLoad NameLoad NameLoad orelse Raise Call NameLoad Str Assign NameStore CompareGtE NameLoad NameLoad If Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num orelse Assign NameStore Num Assign SubscriptStore NameLoad Slice NameLoad NameLoad Return SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num Num Num Num Num Num body Expr Str Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpMult ListLoad Num NameLoad BinOpMult ListLoad NameLoad BinOpSub NameLoad NameLoad Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpAdd NameLoad Call NameLoad NameLoad keyword TupleLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpAdd ListLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad ListLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr ListLoad Call AttributeLoad NameLoad attr CompareLt SubscriptLoad NameLoad Slice NameLoad NameLoad Call AttributeLoad NameLoad attr CompareLt SubscriptLoad NameLoad Slice NameLoad NameLoad ListLoad Call AttributeLoad NameLoad attr CompareLt SubscriptLoad NameLoad Slice NameLoad BinOpDiv NameLoad NameLoad Call AttributeLoad NameLoad attr CompareLt SubscriptLoad NameLoad Slice NameLoad BinOpDiv NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults TupleLoad Num Num NameLoad body Expr Str Assign TupleStore NameStore NameStore NameLoad If BoolOpAnd CompareLt Num NameLoad CompareLt NameLoad Num body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Num Assign NameStore BinOpAdd BinOpMult SubscriptLoad NameLoad ExtSlice Slice Slice Num Call AttributeLoad NameLoad attr BinOpSub Num NameLoad BinOpMult SubscriptLoad NameLoad ExtSlice Slice Slice Num Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Num body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad orelse If CompareLt NameLoad Num body If CompareLt NameLoad BinOpDiv Num BinOpSub NameLoad Num body Raise Call NameLoad Str orelse If CompareEq NameLoad BinOpDiv Num BinOpSub NameLoad Num body Assign NameStore BinOpDiv Num BinOpAdd BinOpSub NameLoad Num Num Assign NameStore BinOpAdd BinOpMult NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad BinOpMult BinOpSub Num NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index CompareGt NameLoad Num Assign NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore BinOpSub Num BinOpDiv Call AttributeLoad BinOpSub BinOpPow NameLoad Num NameLoad attr BinOpSub BinOpPow NameLoad Num NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad orelse If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr BinOpAdd Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr attr Num orelse Assign AttributeStore NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Assign AttributeStore NameLoad attr NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameStore BinOpDiv BinOpMult NameLoad Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore AttributeLoad NameLoad attr If NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad Assign NameStore BinOpAdd Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr attr Num Assign AttributeStore NameLoad attr AttributeLoad Call NameLoad Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad keyword NameLoad attr orelse Assign AttributeStore NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Assign AttributeStore NameLoad attr NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameStore BinOpDiv BinOpMult NameLoad Num AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword BinOpPow NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Return BinOpDiv Call AttributeLoad NameLoad attr BinOpSub AttributeLoad NameLoad attr Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad TupleLoad Num Num NameLoad NameLoad body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareIs Call NameLoad NameLoad Str NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListComp BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore ListComp BinOpAdd SubscriptLoad NameLoad Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad Call NameLoad NameLoad keyword AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword Str orelse If CompareNotIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad Index Num For NameStore Call NameLoad Call NameLoad NameLoad body If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad body Continue If CompareLt BinOpSub Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index NameLoad keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr BinOpMult ListLoad SubscriptLoad NameLoad Index NameLoad Num ListLoad Num AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Expr Call AttributeLoad NameLoad attr BinOpMult ListLoad SubscriptLoad NameLoad Index NameLoad Num ListLoad Num AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str If CompareGt Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index NameLoad keyword Str keyword Str keyword Str keyword Str If CompareGt Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index NameLoad keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Num AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr ListLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad BinOpDiv NameLoad Num BinOpAdd Call AttributeLoad NameLoad attr NameLoad BinOpDiv NameLoad Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num BinOpAdd Call NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr IfExp CompareIsNot NameLoad NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr IfExp CompareIsNot NameLoad NameLoad NameLoad Str Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad orelse For NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore Num For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad Index Num AugAssignAdd NameStore Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad SubscriptLoad Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad Index Num If CompareNotEq NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Import alias Expr Call AttributeLoad NameLoad attr BinOpAdd Str Str Assign NameStore CompareNotEq AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If CompareLt Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr ListComp SubscriptLoad NameLoad Index CompareEq AttributeLoad NameLoad attr NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Str body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpDiv BinOpDiv BinOpMult NameLoad BinOpAdd NameLoad Num Num Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad Str For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad Call AttributeLoad NameLoad attr BinOpDiv Num SubscriptLoad NameLoad Index ListLoad NameLoad NameLoad Assign NameStore BinOpDiv NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad BinOpDiv NameLoad NameLoad CompareGt BinOpDiv NameLoad NameLoad Num Expr Call NameLoad BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num Return BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num Str Num body Expr Str Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad keyword Num keyword NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Num NameLoad keyword ListLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Num Call AttributeLoad NameLoad attr NameLoad Num NameLoad keyword ListLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str AttributeLoad NameLoad attr ImportFrom alias Assign NameStore Call NameLoad NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr BinOpAdd BinOpMod Str TupleLoad AttributeLoad NameLoad attr Str NameLoad NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Return TupleLoad NameLoad TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad AttributeLoad NameLoad attr Index SubscriptLoad SubscriptLoad NameLoad Index Num Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Num Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num ExtSlice Slice Index Num Num Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad NameLoad Index Num ExtSlice Slice Index Num Num SubscriptLoad NameLoad Index Num keyword ListLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr BinOpAdd Str BinOpMod Str NameLoad Return Call NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword SubscriptLoad NameLoad ExtSlice Slice Index Num Assign NameStore BinOpDiv BinOpMult NameLoad Num NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore BinOpAdd BinOpDiv BinOpMult NameLoad Num NameLoad Num Return SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Num For NameStore Call NameLoad Num body For NameStore Call NameLoad Num NameLoad Num body Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return Call AttributeLoad BinOpDiv Num NameLoad attr orelse Return BinOpDiv Call AttributeLoad BinOpDiv Num NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot NameLoad body Return BinOpAdd BinOpDiv Num NameLoad BinOpDiv Num NameLoad orelse Return BinOpDiv BinOpAdd BinOpDiv Num NameLoad BinOpDiv Num NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpDiv BinOpMult NameLoad Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpPow NameLoad Num Call AttributeLoad BinOpMult BinOpPow NameLoad Num NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore BinOpAdd BinOpDiv NameLoad NameLoad BinOpDiv NameLoad NameLoad Assign NameStore BinOpDiv BinOpPow NameLoad Num BinOpAdd BinOpMult NameLoad BinOpPow BinOpDiv NameLoad NameLoad Num BinOpMult NameLoad BinOpPow BinOpDiv NameLoad NameLoad Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore BinOpSub NameLoad Num If CompareEq Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareEq Call AttributeLoad NameLoad attr NameLoad Num CompareEq Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore BinOpMult BinOpDiv BinOpMult Num NameLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad orelse If CompareEq Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore BinOpMult NameLoad Call NameLoad NameLoad keyword NameLoad orelse If CompareGt Call AttributeLoad NameLoad attr NameLoad Num body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad AugAssignDiv NameStore Num orelse Raise Call NameLoad Str Assign NameStore BinOpSub NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Num If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Assign NameStore CompareGt NameLoad NameLoad Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore CompareGt Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad Return TupleLoad TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore BinOpDiv NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore BinOpAdd NameLoad AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num If CompareGt NameLoad Num body Assign NameStore BinOpDiv BinOpSub BinOpMult BinOpSub NameLoad Num NameLoad NameLoad BinOpMult BinOpSub NameLoad Num BinOpSub NameLoad Num orelse Assign NameStore BinOpDiv BinOpMult NameLoad Call AttributeLoad NameLoad attr Num Num Num Return BinOpMult BinOpDiv NameLoad Call AttributeLoad NameLoad attr Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore BinOpSub NameLoad Num If CompareEq Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore BinOpMult NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareEq Call AttributeLoad NameLoad attr NameLoad Num CompareEq Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore BinOpMult BinOpDiv BinOpMult Num NameLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad orelse If CompareEq Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore BinOpMult NameLoad Call NameLoad NameLoad keyword NameLoad orelse If CompareGt Call AttributeLoad NameLoad attr NameLoad Num body Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad AugAssignDiv NameStore Num orelse Raise Call NameLoad Str Assign NameStore BinOpSub NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Num If NameLoad body Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr NameLoad NameLoad Return TupleLoad NameLoad NameLoad NameLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad BinOpAdd NameLoad Num NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad Num Assign SubscriptStore NameLoad Index NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call AttributeLoad NameLoad attr BinOpSub NameLoad Num UnaryOpUSub Call AttributeLoad NameLoad attr BinOpSub NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpSub Call AttributeLoad NameLoad attr NameLoad BinOpDiv Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body ImportFrom alias Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Num Assign NameStore BinOpMult BinOpDiv NameLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Return Call NameLoad NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Num Num Num Expr Call NameLoad Num SubscriptLoad NameLoad Index Num Num Expr Call NameLoad BinOpMult Num Call AttributeLoad NameLoad attr Num SubscriptLoad NameLoad Index Num Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str body Expr Str ImportFrom alias If BoolOpAnd CompareIs NameLoad NameLoad CompareEq NameLoad Str body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpSub Num Call NameLoad UnaryOpUSub NameLoad NameLoad NameLoad NameLoad Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpSub Num Call NameLoad UnaryOpUSub NameLoad NameLoad NameLoad NameLoad Return TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Return BinOpMult NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareIn NameLoad AttributeLoad NameLoad attr body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad ExtSlice Slice Index NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If Call AttributeLoad NameLoad attr CompareGt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index BinOpSub NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad NameLoad If Call AttributeLoad NameLoad attr NameLoad body If CompareGt Call NameLoad NameLoad Num body For NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Return TupleLoad Call NameLoad Call NameLoad AttributeLoad NameLoad attr Call NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad Assign NameStore ListLoad If CompareEq Call AttributeLoad NameLoad attr NameLoad Num body Assign NameStore BinOpMult NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If CompareGt BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Return ListLoad Call NameLoad SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num Call NameLoad SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num orelse Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore ListComp TupleLoad NameLoad NameLoad comprehension NameStore Call NameLoad NameLoad comprehension NameStore Call NameLoad BinOpSub NameLoad Num NameLoad Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpSub Call NameLoad NameLoad NameLoad Return TupleLoad Call NameLoad NameLoad NameLoad Call NameLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore SubscriptLoad Call NameLoad Call NameLoad Call NameLoad NameLoad keyword NameLoad Slice Num body Assign NameStore Call AttributeLoad Call NameLoad NameLoad attr If UnaryOpNot Call NameLoad GeneratorExp Call AttributeLoad Call NameLoad NameLoad attr Call NameLoad NameLoad comprehension NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad BinOpSub Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore SubscriptLoad Call NameLoad Call NameLoad Call NameLoad NameLoad keyword Lambda arguments args NameParam defaults Call NameLoad Call NameLoad NameLoad Slice Num body If UnaryOpNot Call NameLoad GeneratorExp Call AttributeLoad Call NameLoad NameLoad attr Call NameLoad NameLoad comprehension NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore ListLoad Str Str Str Str Str Str Str Str If CompareIn Str NameLoad body Assign NameStore BinOpAdd AttributeLoad Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num attr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num Expr Call NameLoad Call NameLoad NameLoad If BoolOpOr CompareIn Str NameLoad CompareIn Str NameLoad body Assign NameStore ListLoad Num Num Num Num Num Num Num Num Num Num Num Num Expr Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Expr Call NameLoad Call NameLoad NameLoad Expr Call NameLoad Call NameLoad UnaryOpUSub Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpMult ListLoad Num Num BinOpMult ListLoad Num Num Assign NameStore BinOpAdd NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword TupleLoad Num Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore CompareLt NameLoad BinOpMult Call NameLoad NameLoad Num Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Num Call AttributeLoad NameLoad attr NameLoad Num SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr keyword ListLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str AttributeLoad NameLoad attr Expr Call NameLoad Call NameLoad NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad Call NameLoad NameLoad keyword Num Expr Call NameLoad NameLoad Expr Call NameLoad Str Expr Call NameLoad Str Call NameLoad NameLoad keyword Num keyword Str Expr Call NameLoad Str Call NameLoad NameLoad keyword Num keyword Str Expr Call NameLoad Str Call NameLoad NameLoad keyword Num keyword Str Expr Call NameLoad Str Call NameLoad NameLoad keyword Num keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call NameLoad Str For NameStore ListLoad Str Str Str Str body Expr Call NameLoad NameLoad Expr Call NameLoad Call NameLoad NameLoad keyword Num keyword NameLoad If CompareIn Str NameLoad body Assign NameStore Call NameLoad keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num keyword Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Num Expr Call NameLoad NameLoad Expr Call NameLoad BinOpDiv SubscriptLoad NameLoad Index Num Num BinOpSub Num BinOpDiv SubscriptLoad NameLoad Index Num Num Expr Call NameLoad SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num If CompareIn Str NameLoad body Assign NameStore Call NameLoad Num TupleLoad Num Num Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword Num Expr Call NameLoad Call AttributeLoad NameLoad attr Num If CompareIn Str NameLoad body Expr Call NameLoad Call NameLoad Num Num keyword Num Num Expr Call NameLoad Call NameLoad Num Num keyword Num Num If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num Assign NameStore ListComp SubscriptLoad NameLoad Index TupleLoad CompareEq SubscriptLoad NameLoad ExtSlice Slice Index Num NameLoad Num comprehension NameStore Call NameLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Assign NameStore ListComp SubscriptLoad NameLoad Index CompareEq SubscriptLoad NameLoad ExtSlice Slice Index Num NameLoad comprehension NameStore Call NameLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Num Num Expr Call NameLoad Str Expr Call NameLoad BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Slice Num Expr BinOpSub SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad Str For TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Expr Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad Expr Call NameLoad NameLoad BinOpMult NameLoad Num CompareLt BinOpMult NameLoad Num BinOpDiv Num Num CompareLt BinOpMult NameLoad Num BinOpDiv Num Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword SubscriptLoad NameLoad ExtSlice Slice Index Num Assign NameStore BinOpDiv BinOpMult NameLoad Num NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore BinOpAdd BinOpDiv BinOpMult NameLoad Num NameLoad Num Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Num Assign NameStore Call NameLoad NameLoad keyword NameLoad Expr Call NameLoad Str Expr Call NameLoad AttributeLoad NameLoad attr Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num keyword NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr ListLoad SubscriptLoad NameLoad ExtSlice Slice Index Num NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index CompareGt NameLoad Num Assign NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore BinOpSub Num BinOpDiv Call AttributeLoad BinOpSub BinOpPow NameLoad Num NameLoad attr BinOpSub BinOpPow NameLoad Num NameLoad Expr Call NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Num Expr Call NameLoad Str Expr Call NameLoad NameLoad Expr Call NameLoad Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Num Assign NameStore BinOpSub BinOpDiv BinOpMult NameLoad BinOpAdd NameLoad Num Num BinOpDiv NameLoad BinOpMult Num BinOpSub NameLoad Num Assign NameStore BinOpDiv BinOpDiv BinOpMult NameLoad BinOpAdd NameLoad Num Num Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Str For TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad Call AttributeLoad NameLoad attr BinOpDiv Num SubscriptLoad NameLoad Index ListLoad NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad BinOpDiv NameLoad NameLoad CompareGt BinOpDiv NameLoad NameLoad Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad keyword NameLoad Expr Call NameLoad Str For NameStore Call NameLoad Num body Assign TupleStore NameStore NameStore AttributeLoad BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr Num Num Call AttributeLoad NameLoad attr ListLoad Num Num attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index Num NameLoad BinOpMult BinOpSub BinOpDiv NameLoad SubscriptLoad NameLoad Index Num Num Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad Str Expr Call NameLoad NameLoad Expr Call NameLoad Str Expr Call NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str Expr Call NameLoad Str Expr Call NameLoad NameLoad If CompareIn Str NameLoad body Assign NameStore AttributeLoad BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr Num Num Call AttributeLoad NameLoad attr ListLoad Num Num Num Num attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad NameLoad Assign NameStore ListLoad ListLoad Num Num Num Num Num ListLoad Num Num Num Num Num ListLoad Num Num Num Num Num Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore Call NameLoad NameLoad NameLoad Num ListLoad Num Assign NameStore ListLoad Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Expr Call NameLoad Call NameLoad NameLoad keyword Num keyword Str Expr Call NameLoad Call NameLoad NameLoad keyword Num keyword NameLoad Assign NameStore Call NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad ListLoad Num Num SubscriptLoad SubscriptLoad NameLoad Index Num Slice Num Num Expr Call NameLoad Num Call AttributeLoad SubscriptLoad NameLoad Index Num attr Expr Call NameLoad Call NameLoad NameLoad keyword Num keyword NameLoad Expr Call NameLoad Str Call NameLoad NameLoad keyword Num keyword Str Expr Call NameLoad Expr Call NameLoad Num Num Num
N/A N/A 

from pystatsmodels mailinglist 20100524

Notes:
 - unfinished, unverified, but most parts seem to work in MonteCarlo
 - one example taken from lecture notes looks ok
 - needs cases with non-monotonic inequality for test to see difference between
   one-step, step-up and step-down procedures
 - FDR doesn't look really better then Bonferoni in the MC examples that I tried
update:
 - now tested against R, stats and multtest,
   I have all of their methods for p-value correction
 - getting Hommel was impossible until I found reference for pvalue correction
 - now, since I have p-values correction, some of the original tests (rej/norej)
   implementation is not really needed anymore. I think I keep it for reference.
   Test procedure for Hommel in development session log
 - I haven't updated other functions and classes in here.
   - multtest has some good helper function according to docs
 - still need to update references, the real papers
 - fdr with estimated true hypothesis still missing
 - multiple comparison procedures incomplete or missing
 - I will get multiple comparison for now only for independent case, which might
   be conservative in correlated case (?).


some References:

Gibbons, Jean Dickinson and Chakraborti Subhabrata, 2003, Nonparametric Statistical
Inference, Fourth Edition, Marcel Dekker
    p.363: 10.4 THE KRUSKAL-WALLIS ONE-WAY ANOVA TEST AND MULTIPLE COMPARISONS
    p.367: multiple comparison for kruskal formula used in multicomp.kruskal

Sheskin, David J., 2004, Handbook of Parametric and Nonparametric Statistical
Procedures, 3rd ed., Chapman&Hall/CRC
    Test 21: The Single-Factor Between-Subjects Analysis of Variance
    Test 22: The Kruskal-Wallis One-Way Analysis of Variance by Ranks Test

Zwillinger, Daniel and Stephen Kokoska, 2000, CRC standard probability and
statistics tables and formulae, Chapman&Hall/CRC
    14.9 WILCOXON RANKSUM (MANN WHITNEY) TEST


S. Paul Wright, Adjusted P-Values for Simultaneous Inference, Biometrics
    Vol. 48, No. 4 (Dec., 1992), pp. 1005-1013, International Biometric Society
    Stable URL: http://www.jstor.org/stable/2532694
 (p-value correction for Hommel in appendix)

for multicomparison

new book "multiple comparison in R"
Hsu is a good reference but I don't have it.


Author: Josef Pktd and example from H Raja and rewrite from Vincent Davis


TODO
----

* handle exception if empty, shows up only sometimes when running this
- DONE I think

Traceback (most recent call last):
  File "C:\Josef\eclipsegworkspace\statsmodels-josef-experimental-gsoc\scikits\statsmodels\sandbox\stats\multicomp.py", line 711, in <module>
    print('sh', multipletests(tpval, alpha=0.05, method='sh')
  File "C:\Josef\eclipsegworkspace\statsmodels-josef-experimental-gsoc\scikits\statsmodels\sandbox\stats\multicomp.py", line 241, in multipletests
    rejectmax = np.max(np.nonzero(reject))
  File "C:\Programs\Python25\lib\site-packages
umpy\coreromnumeric.py", line 1765, in amax
    return _wrapit(a, 'max', axis, out)
  File "C:\Programs\Python25\lib\site-packages
umpy\coreromnumeric.py", line 37, in _wrapit
    result = getattr(asarray(obj),method)(*args, **kwds)
ValueError: zero-size array to ufunc.reduce without identity

* name of function multipletests, rename to something like pvalue_correction?


 __future__ print_function statsmodels.compat.python lzip range lrange zip N/A scipy.stats N/A numpy N/A numpy np N/A math N/A copy scipy stats statsmodels.iolib.table SimpleTable numpy.testing assert_almost_equal assert_equal statsmodels.stats.multitest multipletests _ecdf ecdf fdrcorrection fdrcorrection0 fdrcorrection_twostage statsmodels.graphics utils N/A qcrit 
  2     3     4     5     6     7     8     9     10
5   3.64 5.70   4.60 6.98   5.22 7.80   5.67 8.42   6.03 8.91   6.33 9.32   6.58 9.67   6.80 9.97   6.99 10.24
6   3.46 5.24   4.34 6.33   4.90 7.03   5.30 7.56   5.63 7.97   5.90 8.32   6.12 8.61   6.32 8.87   6.49 9.10
7   3.34 4.95   4.16 5.92   4.68 6.54   5.06 7.01   5.36 7.37   5.61 7.68   5.82 7.94   6.00 8.17   6.16 8.37
8   3.26 4.75   4.04 5.64   4.53 6.20   4.89 6.62   5.17 6.96   5.40 7.24       5.60 7.47   5.77 7.68   5.92 7.86
9   3.20 4.60   3.95 5.43   4.41 5.96   4.76 6.35   5.02 6.66   5.24 6.91       5.43 7.13   5.59 7.33   5.74 7.49
10  3.15 4.48   3.88 5.27   4.33 5.77   4.65 6.14   4.91 6.43   5.12 6.67       5.30 6.87   5.46 7.05   5.60 7.21
11  3.11 4.39   3.82 5.15   4.26 5.62   4.57 5.97   4.82 6.25   5.03 6.48 5.20 6.67   5.35 6.84   5.49 6.99
12  3.08 4.32   3.77 5.05   4.20 5.50   4.51 5.84   4.75 6.10   4.95 6.32 5.12 6.51   5.27 6.67   5.39 6.81
13  3.06 4.26   3.73 4.96   4.15 5.40   4.45 5.73   4.69 5.98   4.88 6.19 5.05 6.37   5.19 6.53   5.32 6.67
14  3.03 4.21   3.70 4.89   4.11 5.32   4.41 5.63   4.64 5.88   4.83 6.08 4.99 6.26   5.13 6.41   5.25 6.54
15  3.01 4.17   3.67 4.84   4.08 5.25   4.37 5.56   4.59 5.80   4.78 5.99 4.94 6.16   5.08 6.31   5.20 6.44
16  3.00 4.13   3.65 4.79   4.05 5.19   4.33 5.49   4.56 5.72   4.74 5.92 4.90 6.08   5.03 6.22   5.15 6.35
17  2.98 4.10   3.63 4.74   4.02 5.14   4.30 5.43   4.52 5.66   4.70 5.85 4.86 6.01   4.99 6.15   5.11 6.27
18  2.97 4.07   3.61 4.70   4.00 5.09   4.28 5.38   4.49 5.60   4.67 5.79 4.82 5.94   4.96 6.08   5.07 6.20
19  2.96 4.05   3.59 4.67   3.98 5.05   4.25 5.33   4.47 5.55   4.65 5.73 4.79 5.89   4.92 6.02   5.04 6.14
20  2.95 4.02   3.58 4.64   3.96 5.02   4.23 5.29   4.45 5.51   4.62 5.69 4.77 5.84   4.90 5.97   5.01 6.09
24  2.92 3.96   3.53 4.55   3.90 4.91   4.17 5.17   4.37 5.37   4.54 5.54 4.68 5.69   4.81 5.81   4.92 5.92
30  2.89 3.89   3.49 4.45   3.85 4.80   4.10 5.05   4.30 5.24   4.46 5.40 4.60 5.54   4.72 5.65   4.82 5.76
40  2.86 3.82   3.44 4.37   3.79 4.70   4.04 4.93   4.23 5.11   4.39 5.26 4.52 5.39   4.63 5.50   4.73 5.60
60  2.83 3.76   3.40 4.28   3.74 4.59   3.98 4.82   4.16 4.99   4.31 5.13 4.44 5.25   4.55 5.36   4.65 5.45
120   2.80 3.70   3.36 4.20   3.68 4.50   3.92 4.71   4.10 4.87   4.24 5.01 4.36 5.12   4.47 5.21   4.56 5.30
infinity  2.77 3.64   3.31 4.12   3.63 4.40   3.86 4.60   4.03 4.76   4.17 4.88   4.29 4.99   4.39 5.08   4.47 5.16
 N/A res N/A N/A N/A line split N/A line N/A N/A N/A N/A qcrit replace infinity 9999 split N/A c N/A N/A N/A N/A np array N/A res N/A 2 -1 astype float N/A ccols N/A N/A np arange 2 11 N/A crows N/A c N/A N/A N/A 0 N/A cv005 N/A c N/A N/A N/A 1 2 N/A cv001 N/A c N/A N/A N/A 2 2 scipy interpolate get_tukeyQcrit N/A N/A k df alpha N/A 0.05 N/A N/A 
    return critical values for Tukey's HSD (Q)

    Parameters
    ----------
    k : int in {2, ..., 10}
        number of tests
    df : int
        degrees of freedom of error term
    alpha : {0.05, 0.01}
        type 1 error, 1-confidence level



    not enough error checking for limitations
     N/A N/A alpha 0.05 N/A N/A intp N/A N/A interpolate interp1d crows N/A cv005 N/A N/A N/A N/A k 2 N/A N/A N/A alpha 0.01 N/A N/A intp N/A N/A interpolate interp1d crows N/A cv001 N/A N/A N/A N/A k 2 N/A N/A N/A ValueError only implemented for alpha equal to 0.01 and 0.05 N/A N/A intp df N/A get_tukeyQcrit2 N/A N/A k df alpha N/A 0.05 N/A N/A 
    return critical values for Tukey's HSD (Q)

    Parameters
    ----------
    k : int in {2, ..., 10}
        number of tests
    df : int
        degrees of freedom of error term
    alpha : {0.05, 0.01}
        type 1 error, 1-confidence level



    not enough error checking for limitations
     statsmodels.stats.libqsturng qsturng N/A N/A qsturng N/A 1 alpha k df N/A Tukeythreegene N/A N/A first second third N/A N/A N/A firstmean N/A N/A numpy mean first N/A secondmean N/A N/A numpy mean second N/A thirdmean N/A N/A numpy mean third N/A firststd N/A N/A numpy std first N/A secondstd N/A N/A numpy std second N/A thirdstd N/A N/A numpy std third N/A firsts2 N/A N/A math pow firststd 2 N/A seconds2 N/A N/A math pow secondstd 2 N/A thirds2 N/A N/A math pow thirdstd 2 N/A mserrornum N/A N/A N/A firsts2 2 N/A seconds2 2 N/A thirds2 2 N/A mserrorden N/A N/A N/A N/A len first N/A len second N/A len third 3 N/A mserror N/A mserrornum mserrorden N/A standarderror N/A N/A math sqrt N/A mserror N/A len first N/A dftotal N/A N/A N/A N/A len first N/A len second N/A len third 1 N/A dfgroups 2 N/A dferror N/A dftotal dfgroups N/A qcrit 0.5 N/A qcrit N/A get_tukeyQcrit 3 dftotal alpha 0.05 N/A qtest3to1 N/A N/A N/A math fabs N/A thirdmean firstmean standarderror N/A qtest3to2 N/A N/A N/A math fabs N/A thirdmean secondmean standarderror N/A qtest2to1 N/A N/A N/A math fabs N/A secondmean firstmean standarderror N/A conclusion N/A N/A N/A print qtest3to1 N/A N/A print qtest3to2 N/A N/A print qtest2to1 N/A N/A qtest3to1 qcrit N/A N/A N/A N/A conclusion append 3to1null N/A N/A N/A N/A conclusion append 3to1alt N/A N/A qtest3to2 qcrit N/A N/A N/A N/A conclusion append 3to2null N/A N/A N/A N/A conclusion append 3to2alt N/A N/A qtest2to1 qcrit N/A N/A N/A N/A conclusion append 2to1null N/A N/A N/A N/A conclusion append 2to1alt N/A conclusion N/A Tukeythreegene2 N/A N/A genes N/A N/A N/A gend is a list, ie [first, second, third] N/A means N/A N/A stds N/A N/A gene genes N/A N/A N/A N/A means append N/A N/A numpy mean gene N/A N/A N/A std append N/A N/A numpy std gene N/A stds2 N/A N/A std stds N/A N/A N/A N/A stds2 append N/A N/A math pow std 2 N/A mserrornum N/A N/A sum stds2 2 N/A mserrorden N/A N/A N/A N/A len N/A genes N/A 0 N/A len N/A genes N/A 1 N/A len N/A genes N/A 2 3 N/A mserror N/A mserrornum mserrorden N/A catstack N/A N/A args N/A N/A N/A x N/A N/A np hstack args N/A labels N/A N/A np hstack N/A N/A k N/A N/A np ones N/A len arr N/A N/A k arr N/A enumerate args N/A N/A x labels N/A maxzero N/A N/A x N/A N/A N/A find all up zero crossings and return the index of the highest

    Not used anymore


    >>> np.random.seed(12345)
    >>> x = np.random.randn(8)
    >>> x
    array([-0.20470766,  0.47894334, -0.51943872, -0.5557303 ,  1.96578057,
            1.39340583,  0.09290788,  0.28174615])
    >>> maxzero(x)
    (4, array([1, 4]))


    no up-zero-crossing at end

    >>> np.random.seed(0)
    >>> x = np.random.randn(8)
    >>> x
    array([ 1.76405235,  0.40015721,  0.97873798,  2.2408932 ,  1.86755799,
           -0.97727788,  0.95008842, -0.15135721])
    >>> maxzero(x)
    (None, array([6]))
     N/A x N/A N/A np asarray x N/A cond1 N/A N/A x N/A -1 0 N/A cond2 N/A N/A x N/A 1 0 N/A allzeros N/A N/A N/A N/A np nonzero N/A N/A cond1 cond2 N/A N/A x N/A 1 0 N/A 0 1 N/A N/A N/A x N/A -1 0 N/A N/A maxz N/A max allzeros N/A N/A maxz None N/A N/A maxz allzeros N/A maxzerodown N/A N/A x N/A N/A N/A find all up zero crossings and return the index of the highest

    Not used anymore

    >>> np.random.seed(12345)
    >>> x = np.random.randn(8)
    >>> x
    array([-0.20470766,  0.47894334, -0.51943872, -0.5557303 ,  1.96578057,
            1.39340583,  0.09290788,  0.28174615])
    >>> maxzero(x)
    (4, array([1, 4]))


    no up-zero-crossing at end

    >>> np.random.seed(0)
    >>> x = np.random.randn(8)
    >>> x
    array([ 1.76405235,  0.40015721,  0.97873798,  2.2408932 ,  1.86755799,
           -0.97727788,  0.95008842, -0.15135721])
    >>> maxzero(x)
    (None, array([6]))
 N/A x N/A N/A np asarray x N/A cond1 N/A N/A x N/A -1 0 N/A cond2 N/A N/A x N/A 1 0 N/A allzeros N/A N/A N/A N/A np nonzero N/A N/A cond1 cond2 N/A N/A x N/A 1 0 N/A 0 1 N/A N/A N/A x N/A -1 0 N/A N/A maxz N/A max allzeros N/A N/A maxz None N/A N/A maxz allzeros N/A rejectionline N/A N/A n alpha N/A 0.5 N/A N/A reference line for rejection in multiple tests

    Not used anymore

    from: section 3.2, page 60
     N/A t N/A N/A N/A np arange n N/A float n N/A frej N/A t N/A N/A t N/A 1 alpha alpha N/A frej N/A fdrcorrection_bak N/A N/A pvals alpha method N/A 0.05 indep N/A N/A Reject False discovery rate correction for pvalues

    Old version, to be deleted


    missing: methods that estimate fraction of true hypotheses

     N/A pvals N/A N/A np asarray pvals N/A pvals_sortind N/A N/A np argsort pvals N/A pvals_sorted N/A pvals N/A pvals_sortind N/A pecdf N/A ecdf pvals_sorted N/A N/A method N/A i indep p poscorr N/A N/A rline N/A pvals_sorted alpha N/A N/A N/A method N/A n negcorr N/A N/A cm N/A N/A np sum N/A 1.0 N/A N/A np arange 1 N/A len pvals N/A rline N/A N/A pvals_sorted alpha cm N/A N/A N/A method N/A g onegcorr N/A N/A rline N/A pvals_sorted N/A N/A pvals_sorted N/A 1 alpha alpha N/A N/A N/A method N/A oth o2negcorr N/A N/A cm N/A N/A np sum N/A N/A np arange N/A len pvals N/A rline N/A N/A pvals_sorted alpha cm N/A N/A N/A ValueError method not available N/A reject N/A pecdf rline N/A N/A N/A reject any N/A N/A rejectmax N/A max N/A N/A N/A np nonzero reject N/A 0 N/A N/A rejectmax 0 N/A N/A reject N/A rejectmax True N/A N/A reject N/A N/A N/A pvals_sortind argsort N/A mcfdr N/A N/A nrepl nobs ntests ntrue mu alpha rho N/A 100 50 10 6 0.5 0.05 0.0 N/A N/A MonteCarlo to test fdrcorrection
     N/A nfalse N/A ntests ntrue N/A locs N/A N/A np array N/A N/A N/A 0.0 ntrue N/A N/A mu N/A ntests ntrue N/A results N/A N/A i N/A range nrepl N/A N/A rvs N/A locs N/A randmvn rho size N/A nobs ntests N/A N/A tt tpval N/A N/A stats ttest_1samp rvs 0 N/A res N/A fdrcorrection_bak N/A N/A np abs tpval alpha alpha method i N/A res0 N/A fdrcorrection0 N/A N/A np abs tpval alpha alpha N/A N/A N/A results append N/A N/A N/A N/A N/A N/A N/A N/A np sum N/A res N/A ntrue N/A N/A np sum N/A res N/A ntrue N/A N/A N/A np sum N/A res0 N/A ntrue N/A N/A np sum N/A res0 N/A ntrue N/A N/A res tolist N/A N/A N/A N/A np sort tpval tolist N/A N/A N/A np sum N/A N/A tpval N/A ntrue alpha N/A N/A np sum N/A N/A tpval N/A ntrue alpha N/A N/A N/A np sum N/A N/A tpval N/A ntrue N/A alpha ntests N/A N/A np sum N/A N/A tpval N/A ntrue N/A alpha ntests N/A N/A N/A np array results N/A randmvn N/A N/A rho size standardize N/A N/A 1 2 False N/A N/A create random draws from equi-correlated multivariate normal distribution

    Parameters
    ----------
    rho : float
        correlation coefficient
    size : tuple of int
        size is interpreted (nobs, nvars) where each row


    Returns
    -------
    rvs : ndarray, (nobs, nvars)
        where each row is a independent random draw of nvars-dimensional correlated rvs

     N/A N/A nobs nvars size N/A N/A N/A 0 rho N/A rho 1 N/A N/A rvs N/A N/A N/A np random randn nobs N/A nvars 1 N/A rvs2 N/A N/A N/A rvs N/A N/A N/A -1 N/A N/A np sqrt N/A 1 rho N/A N/A rvs N/A N/A N/A -1 N/A N/A np sqrt rho N/A N/A N/A rho 0 N/A N/A rvs2 N/A N/A N/A np random randn nobs nvars N/A N/A N/A rho 0 N/A N/A N/A rho N/A -1.0 N/A nvars 1 N/A N/A N/A ValueError rho has to be larger than -1./(nvars-1) N/A N/A N/A rho N/A -1.0 N/A nvars 1 N/A N/A rho N/A -1.0 N/A N/A nvars 1 1e-10 N/A A N/A N/A rho N/A N/A np ones N/A nvars nvars N/A N/A 1 rho N/A N/A np eye nvars N/A rvs2 N/A N/A np dot N/A N/A N/A np random randn nobs nvars N/A N/A N/A N/A np linalg cholesky A T N/A standardize N/A N/A rvs2 N/A N/A stats zscore rvs2 N/A rvs2 N/A tiecorrect N/A N/A xranks N/A N/A N/A 

    should be equivalent of scipy.stats.tiecorrect

     N/A rankbincount N/A N/A np bincount N/A N/A np asarray xranks dtype int N/A nties N/A rankbincount N/A N/A rankbincount 1 N/A ntot N/A float N/A len xranks N/A tiecorrection N/A 1 N/A N/A N/A N/A N/A nties 3 nties sum N/A N/A ntot 3 ntot N/A tiecorrection N/A GroupsStats N/A object N/A N/A 
    statistics by groups (another version)

    groupstats as a class with lazy evaluation (not yet - decorators are still
    missing)

    written this time as equivalent of scipy.stats.rankdata
    gs = GroupsStats(X, useranks=True)
    assert_almost_equal(gs.groupmeanfilter, stats.rankdata(X[:,0]), 15)

    TODO: incomplete doc strings

     __init__ N/A N/A self x useranks uni intlab N/A False None None N/A N/A descriptive statistics by groups

        Parameters
        ----------
        x : array, 2d
            first column data, second column group labels
        useranks : boolean
            if true, then use ranks as data corresponding to the
            scipy.stats.rankdata definition (start at 1, ties get mean)
        uni, intlab : arrays (optional)
            to avoid call to unique, these can be given as inputs


         N/A N/A self x N/A N/A np asarray x N/A N/A intlab None N/A N/A N/A uni intlab N/A N/A np unique N/A x N/A N/A N/A 1 return_inverse True N/A N/A N/A uni None N/A N/A uni N/A N/A np unique N/A x N/A N/A N/A 1 N/A N/A self useranks useranks N/A N/A self uni uni N/A N/A self intlab intlab N/A N/A self groupnobs groupnobs N/A N/A np bincount intlab N/A N/A N/A self runbasic useranks useranks N/A runbasic_old N/A N/A self useranks N/A False N/A N/A x N/A self x N/A useranks N/A N/A N/A self xx N/A N/A N/A N/A N/A N/A x N/A N/A N/A 1 argsort argsort 1 N/A N/A N/A self xx N/A x N/A N/A N/A 0 N/A N/A self groupsum groupranksum N/A N/A np bincount N/A self intlab weights N/A self xx N/A N/A self groupmean grouprankmean N/A N/A groupranksum 1.0 N/A self groupnobs N/A N/A self groupmeanfilter N/A grouprankmean N/A N/A self intlab N/A runbasic N/A N/A self useranks N/A False N/A N/A x N/A self x N/A useranks N/A N/A N/A xuni xintlab N/A N/A np unique N/A x N/A N/A N/A 0 return_inverse True N/A ranksraw N/A N/A N/A N/A N/A N/A x N/A N/A N/A 0 argsort argsort 1 N/A N/A self xx N/A N/A GroupsStats N/A N/A np column_stack N/A ranksraw xintlab useranks False groupmeanfilter N/A N/A N/A self xx N/A x N/A N/A N/A 0 N/A N/A self groupsum groupranksum N/A N/A np bincount N/A self intlab weights N/A self xx N/A N/A self groupmean grouprankmean N/A N/A groupranksum 1.0 N/A self groupnobs N/A N/A self groupmeanfilter N/A grouprankmean N/A N/A self intlab N/A groupdemean N/A N/A self N/A N/A N/A N/A N/A self xx N/A self groupmeanfilter N/A groupsswithin N/A N/A self N/A N/A N/A xtmp N/A N/A self groupdemean N/A N/A N/A np bincount N/A self intlab weights N/A xtmp 2 N/A groupvarwithin N/A N/A self N/A N/A N/A N/A N/A N/A self groupsswithin N/A N/A self groupnobs 1 N/A N/A TukeyHSDResults N/A object N/A N/A Results from Tukey HSD test, with additional plot methods

    Can also compute and plot additional post-hoc evaluations using this
    results class.

    Attributes
    ----------
    reject : array of boolean, True if we reject Null for group pair
    meandiffs : pairwise mean differences
    confint : confidence interval for pairwise mean differences
    std_pairs : standard deviation of pairwise mean differences
    q_crit : critical value of studentized range statistic at given alpha
    halfwidths : half widths of simultaneous confidence interval

    Notes
    -----
    halfwidths is only available after call to `plot_simultaneous`.

    Other attributes contain information about the data from the
    MultiComparison instance: data, df_total, groups, groupsunique, variance.

     __init__ N/A N/A self mc_object results_table q_crit reject meandiffs std_pairs confint df_total reject2 variance N/A None None None None None None None N/A N/A N/A self _multicomp mc_object N/A N/A self _results_table results_table N/A N/A self q_crit q_crit N/A N/A self reject reject N/A N/A self meandiffs meandiffs N/A N/A self std_pairs std_pairs N/A N/A self confint confint N/A N/A self df_total df_total N/A N/A self reject2 reject2 N/A N/A self variance variance N/A N/A self data N/A N/A self _multicomp data N/A N/A self groups N/A N/A self _multicomp groups N/A N/A self groupsunique N/A N/A self _multicomp groupsunique N/A __str__ N/A N/A self N/A N/A N/A N/A str N/A self _results_table N/A summary N/A N/A self N/A N/A N/A Summary table that can be printed
         N/A N/A self _results_table N/A _simultaneous_ci N/A N/A self N/A N/A N/A Compute simultaneous confidence intervals for comparison of means.
         N/A N/A self halfwidths N/A simultaneous_ci N/A self q_crit N/A self variance N/A N/A N/A self _multicomp groupstats groupnobs N/A N/A self _multicomp pairindices N/A plot_simultaneous N/A N/A self comparison_name ax figsize xlabel ylabel N/A None None N/A 10 6 None None N/A N/A Plot a universal confidence interval of each group mean

        Visiualize significant differences in a plot with one confidence
        interval per group instead of all pairwise confidence intervals.

        Parameters
        ----------
        comparison_name : string, optional
            if provided, plot_intervals will color code all groups that are
            significantly different from the comparison_name red, and will
            color code insignificant groups gray. Otherwise, all intervals will
            just be plotted in black.
        ax : matplotlib axis, optional
            An axis handle on which to attach the plot.
        figsize : tuple, optional
            tuple for the size of the figure generated
        xlabel : string, optional
            Name to be displayed on x axis
        ylabel : string, optional
            Name to be displayed on y axis

        Returns
        -------
        fig : Matplotlib Figure object
            handle to figure object containing interval plots

        Notes
        -----
        Multiple comparison tests are nice, but lack a good way to be
        visualized. If you have, say, 6 groups, showing a graph of the means
        between each group will require 15 confidence intervals.
        Instead, we can visualize inter-group differences with a single
        interval for each group mean. Hochberg et al. [1] first proposed this
        idea and used Tukey's Q critical value to compute the interval widths.
        Unlike plotting the differences in the means and their respective
        confidence intervals, any two pairs can be compared for significance
        by looking for overlap.

        References
        ----------
        .. [1] Hochberg, Y., and A. C. Tamhane. Multiple Comparison Procedures.
               Hoboken, NJ: John Wiley & Sons, 1987.

        Examples
        --------
        >>> from statsmodels.examples.try_tukey_hsd import cylinders, cyl_labels
        >>> from statsmodels.stats.multicomp import MultiComparison
        >>> cardata = MultiComparison(cylinders, cyl_labels)
        >>> results = cardata.tukeyhsd()
        >>> results.plot_simultaneous()
        <matplotlib.figure.Figure at 0x...>

        This example shows an example plot comparing significant differences
        in group means. Significant differences at the alpha=0.05 level can be
        identified by intervals that do not overlap (i.e. USA vs Japan,
        USA vs Germany).

        >>> results.plot_simultaneous(comparison_name="USA")
        <matplotlib.figure.Figure at 0x...>

        Optionally provide one of the group names to color code the plot to
        highlight group means different from comparison_name.

         N/A N/A fig ax1 N/A N/A utils create_mpl_ax ax N/A N/A figsize None N/A N/A N/A N/A fig set_size_inches figsize N/A N/A N/A getattr self halfwidths None None N/A N/A N/A N/A self _simultaneous_ci N/A means N/A N/A N/A self _multicomp groupstats groupmean N/A sigidx N/A N/A nsigidx N/A N/A minrange N/A N/A N/A means N/A i N/A N/A self halfwidths N/A i N/A i N/A range N/A len means N/A maxrange N/A N/A N/A means N/A i N/A N/A self halfwidths N/A i N/A i N/A range N/A len means N/A N/A comparison_name None N/A N/A N/A N/A ax1 errorbar means N/A lrange N/A len means xerr N/A self halfwidths marker o linestyle None color k ecolor k N/A N/A N/A comparison_name N/A self groupsunique N/A N/A N/A ValueError comparison_name not found in group names. N/A midx N/A N/A N/A np where N/A N/A self groupsunique comparison_name N/A 0 N/A i N/A range N/A len means N/A N/A N/A N/A N/A self groupsunique N/A i comparison_name N/A N/A N/A N/A N/A N/A min N/A maxrange N/A i N/A maxrange N/A midx N/A max N/A minrange N/A i N/A minrange N/A midx 0 N/A N/A N/A N/A sigidx append i N/A N/A N/A N/A nsigidx append i N/A N/A N/A ax1 errorbar N/A means N/A midx midx xerr N/A N/A self halfwidths N/A midx marker o linestyle None color b ecolor b N/A N/A N/A ax1 plot N/A N/A N/A minrange N/A midx 2 N/A -1 N/A N/A self _multicomp ngroups linestyle -- color 0.7 N/A N/A N/A ax1 plot N/A N/A N/A maxrange N/A midx 2 N/A -1 N/A N/A self _multicomp ngroups linestyle -- color 0.7 N/A N/A N/A len sigidx 0 N/A N/A N/A N/A ax1 errorbar N/A means N/A sigidx sigidx xerr N/A N/A self halfwidths N/A sigidx marker o linestyle None color r ecolor r N/A N/A N/A len nsigidx 0 N/A N/A N/A N/A ax1 errorbar N/A means N/A nsigidx nsigidx xerr N/A N/A self halfwidths N/A nsigidx marker o linestyle None color 0.5 ecolor 0.5 N/A N/A N/A ax1 set_title Multiple Comparisons Between All Pairs (Tukey) N/A r N/A N/A N/A np max maxrange N/A N/A np min minrange N/A N/A N/A ax1 set_ylim N/A -1 N/A N/A self _multicomp ngroups N/A N/A N/A ax1 set_xlim N/A N/A N/A N/A np min minrange N/A r 10.0 N/A N/A N/A np max maxrange N/A r 10.0 N/A N/A N/A ax1 set_yticklabels N/A N/A np insert N/A N/A N/A self groupsunique astype str 0 N/A N/A N/A ax1 set_yticks N/A N/A np arange -1 N/A N/A len means 1 N/A N/A N/A ax1 set_xlabel N/A N/A xlabel None xlabel N/A N/A N/A ax1 set_ylabel N/A N/A ylabel None ylabel N/A fig N/A N/A MultiComparison N/A object N/A N/A Tests for multiple comparisons

    Parameters
    ----------
    data : array
        independent data samples
    groups : array
        group labels corresponding to each data point
    group_order : list of strings, optional
        the desired order for the group mean results to be reported in. If
        not specified, results are reported in increasing order.
        If group_order does not contain all labels that are in groups, then
        only those observations are kept that have a label in group_order.

     __init__ N/A N/A self data groups group_order N/A None N/A N/A N/A N/A len data N/A len groups N/A N/A N/A ValueError N/A data has %d elements and groups has %d N/A N/A len data N/A len groups N/A N/A self data N/A N/A np asarray data N/A N/A self groups groups N/A N/A np asarray groups N/A N/A group_order None N/A N/A N/A N/A self groupsunique N/A self groupintlab N/A N/A np unique groups return_inverse True N/A N/A grp group_order N/A N/A N/A grp groups N/A N/A N/A ValueError N/A group_order value '%s' not found in groups grp N/A N/A self groupsunique N/A N/A np array group_order N/A N/A self groupintlab N/A N/A np empty N/A len data int N/A N/A N/A N/A self groupintlab fill -999 N/A count 0 N/A name N/A self groupsunique N/A N/A idx N/A N/A N/A np where N/A N/A self groups name N/A 0 N/A count N/A len idx N/A N/A N/A self groupintlab N/A idx N/A N/A N/A np where N/A N/A self groupsunique name N/A 0 N/A N/A count N/A N/A data shape N/A 0 N/A N/A warnings N/A N/A N/A warnings warn N/A group_order does not contain all groups:  dropping observations N/A mask_keep N/A N/A self groupintlab -999 N/A N/A self groupintlab N/A N/A self groupintlab N/A mask_keep N/A N/A self data N/A N/A self data N/A mask_keep N/A N/A self groups N/A N/A self groups N/A mask_keep N/A N/A N/A len N/A self groupsunique 2 N/A N/A N/A ValueError 2 or more groups required for multiple comparisons N/A N/A self datali N/A N/A data N/A N/A N/A self groups k N/A k N/A self groupsunique N/A N/A self pairindices N/A N/A np triu_indices N/A len N/A self groupsunique 1 N/A N/A self nobs N/A N/A N/A self data shape N/A 0 N/A N/A self ngroups N/A len N/A self groupsunique N/A getranks N/A N/A self N/A N/A N/A convert data to rankdata and attach


        This creates rankdata as it is used for non-parametric tests, where
        in the case of ties the average rank is assigned.


         N/A N/A self ranks N/A GroupsStats N/A N/A np column_stack N/A N/A self data N/A self groupintlab useranks True N/A N/A self rankdata N/A N/A self ranks groupmeanfilter N/A kruskal N/A N/A self pairs multimethod N/A None T N/A N/A 
        pairwise comparison for kruskal-wallis test

        This is just a reimplementation of scipy.stats.kruskal and does
        not yet use a multiple comparison correction.

         N/A N/A N/A self getranks N/A tot N/A self nobs N/A meanranks N/A N/A self ranks groupmean N/A groupnobs N/A N/A self ranks groupnobs N/A f N/A N/A N/A tot N/A tot 1.0 12.0 N/A N/A stats tiecorrect N/A self rankdata N/A N/A print MultiComparison.kruskal N/A N/A i j N/A zip N/A self pairindices N/A N/A pdiff N/A N/A np abs N/A N/A meanranks N/A i N/A meanranks N/A j N/A se N/A N/A np sqrt N/A f N/A N/A np sum N/A 1.0 N/A groupnobs N/A N/A i j N/A Q N/A pdiff se N/A N/A print i j pdiff se N/A pdiff se N/A N/A pdiff se 2.631 N/A N/A print N/A N/A N/A N/A stats norm sf Q 2 N/A N/A N/A N/A N/A stats norm sf Q 2 N/A allpairtest N/A N/A self testfunc alpha method pvalidx N/A 0.05 bonf 1 N/A N/A run a pairwise test on all pairs with multiple test correction

        The statistical test given in testfunc is calculated for all pairs
        and the p-values are adjusted by methods in multipletests. The p-value
        correction is generic and based only on the p-values, and does not
        take any special structure of the hypotheses into account.

        Parameters
        ----------
        testfunc : function
            A test function for two (independent) samples. It is assumed that
            the return value on position pvalidx is the p-value.
        alpha : float
            familywise error rate
        method : string
            This specifies the method for the p-value correction. Any method
            of multipletests is possible.
        pvalidx : int (default: 1)
            position of the p-value in the return of testfunc

        Returns
        -------
        sumtab : SimpleTable instance
            summary table for printing

        errors:  TODO: check if this is still wrong, I think it's fixed.
        results from multipletests are in different order
        pval_corrected can be larger than 1 ???
         N/A res N/A N/A N/A i j N/A zip N/A self pairindices N/A N/A N/A N/A res append N/A testfunc N/A N/A self datali N/A i N/A N/A self datali N/A j N/A res N/A N/A np array res N/A N/A reject pvals_corrected alphacSidak alphacBonf N/A multipletests N/A res N/A N/A N/A pvalidx alpha 0.05 method method N/A N/A i1 i2 N/A self pairindices N/A N/A pvals_corrected None N/A N/A resarr N/A N/A np array N/A lzip N/A N/A self groupsunique N/A i1 N/A N/A self groupsunique N/A i2 N/A N/A np round N/A res N/A N/A N/A 0 4 N/A N/A np round N/A res N/A N/A N/A 1 4 reject dtype N/A N/A group1 object N/A group2 object N/A stat float N/A pval float N/A reject N/A np bool8 N/A N/A resarr N/A N/A np array N/A lzip N/A N/A self groupsunique N/A i1 N/A N/A self groupsunique N/A i2 N/A N/A np round N/A res N/A N/A N/A 0 4 N/A N/A np round N/A res N/A N/A N/A 1 4 N/A N/A np round pvals_corrected 4 reject dtype N/A N/A group1 object N/A group2 object N/A stat float N/A pval float N/A pval_corr float N/A reject N/A np bool8 statsmodels.iolib.table SimpleTable N/A results_table N/A SimpleTable resarr headers N/A N/A resarr dtype names N/A N/A results_table title N/A N/A Test Multiple Comparison %s 
%s%4.2f method=%s N/A N/A testfunc __name__ FWER= alpha method N/A 
alphacSidak=%4.2f, alphacBonf=%5.3f N/A alphacSidak alphacBonf N/A N/A results_table N/A res reject pvals_corrected alphacSidak alphacBonf resarr N/A tukeyhsd N/A N/A self alpha N/A 0.05 N/A N/A Tukey's range test to compare means of all pairs of groups

        Parameters
        ----------
        alpha : float, optional
            Value of FWER at which to calculate HSD.

        Returns
        -------
        results : TukeyHSDResults instance
            A results class containing relevant data and some post-hoc
            calculations
         N/A N/A self groupstats N/A GroupsStats N/A N/A np column_stack N/A N/A self data N/A self groupintlab useranks False N/A gmeans N/A N/A self groupstats groupmean N/A gnobs N/A N/A self groupstats groupnobs N/A var_ N/A N/A np var N/A N/A N/A self groupstats groupdemean ddof N/A len gmeans N/A res N/A tukeyhsd gmeans gnobs var_ df None alpha alpha q_crit None N/A resarr N/A N/A np array N/A lzip N/A N/A self groupsunique N/A N/A N/A res N/A 0 N/A 0 N/A N/A self groupsunique N/A N/A N/A res N/A 0 N/A 1 N/A N/A np round N/A res N/A 2 4 N/A N/A np round N/A N/A res N/A 4 N/A N/A N/A 0 4 N/A N/A np round N/A N/A res N/A 4 N/A N/A N/A 1 4 N/A res N/A 1 dtype N/A N/A group1 object N/A group2 object N/A meandiff float N/A lower float N/A upper float N/A reject N/A np bool8 N/A results_table N/A SimpleTable resarr headers N/A N/A resarr dtype names N/A N/A results_table title N/A Multiple Comparison of Means - Tukey HSD, N/A FWER=%4.2f alpha N/A N/A TukeyHSDResults self results_table N/A res N/A 5 N/A res N/A 1 N/A res N/A 2 N/A res N/A 3 N/A res N/A 4 N/A res N/A 6 N/A res N/A 7 var_ N/A N/A rankdata N/A N/A x N/A N/A N/A rankdata, equivalent to scipy.stats.rankdata

    just a different implementation, I have not yet compared speed

     N/A N/A uni intlab N/A N/A np unique N/A x N/A N/A N/A 0 return_inverse True N/A groupnobs N/A N/A np bincount intlab N/A groupxsum N/A N/A np bincount intlab weights N/A X N/A N/A N/A 0 N/A groupxmean N/A N/A groupxsum 1.0 groupnobs N/A rankraw N/A N/A N/A N/A N/A x N/A N/A N/A 0 argsort argsort N/A groupranksum N/A N/A np bincount intlab weights rankraw N/A grouprankmean N/A N/A N/A groupranksum 1.0 groupnobs 1 N/A N/A grouprankmean N/A intlab N/A compare_ordered N/A N/A vals alpha N/A N/A N/A simple ordered sequential comparison of means

    vals : array_like
        means or rankmeans for independent groups

    incomplete, no return, not used yet
     N/A vals N/A N/A np asarray vals N/A alphaf alpha N/A sortind N/A N/A np argsort vals N/A pvals N/A vals N/A sortind N/A sortrevind N/A N/A sortind argsort N/A ntests N/A len vals N/A N/A v1 v2 N/A N/A np triu_indices ntests 1 N/A i N/A range 4 N/A N/A j N/A range 4 i -1 N/A N/A N/A print i j N/A varcorrection_unbalanced N/A N/A nobs_all srange N/A False N/A N/A correction factor for variance with unequal sample sizes

    this is just a harmonic mean

    Parameters
    ----------
    nobs_all : array_like
        The number of observations for each sample
    srange : bool
        if true, then the correction is divided by the number of samples
        for the variance of the studentized range statistic

    Returns
    -------
    correction : float
        Correction factor for variance.


    Notes
    -----

    variance correction factor is

    1/k * sum_i 1/n_i

    where k is the number of samples and summation is over i=0,...,k-1.
    If all n_i are the same, then the correction factor is 1.

    This needs to be multiplied by the joint variance estimate, means square
    error, MSE. To obtain the correction factor for the standard deviation,
    square root needs to be taken.

     N/A nobs_all N/A N/A np asarray nobs_all N/A N/A srange N/A N/A N/A N/A N/A 1.0 nobs_all sum N/A N/A N/A N/A N/A N/A 1.0 nobs_all sum N/A len nobs_all N/A varcorrection_pairs_unbalanced N/A N/A nobs_all srange N/A False N/A N/A correction factor for variance with unequal sample sizes for all pairs

    this is just a harmonic mean

    Parameters
    ----------
    nobs_all : array_like
        The number of observations for each sample
    srange : bool
        if true, then the correction is divided by 2 for the variance of
        the studentized range statistic

    Returns
    -------
    correction : array
        Correction factor for variance.


    Notes
    -----

    variance correction factor is

    1/k * sum_i 1/n_i

    where k is the number of samples and summation is over i=0,...,k-1.
    If all n_i are the same, then the correction factor is 1.

    This needs to be multiplies by the joint variance estimate, means square
    error, MSE. To obtain the correction factor for the standard deviation,
    square root needs to be taken.

    For the studentized range statistic, the resulting factor has to be
    divided by 2.

     N/A N/A n1 n2 N/A N/A np meshgrid nobs_all nobs_all N/A N/A srange N/A N/A N/A N/A 1.0 n1 N/A 1.0 n2 N/A N/A N/A N/A N/A 1.0 n1 N/A 1.0 n2 2.0 N/A varcorrection_unequal N/A N/A var_all nobs_all df_all N/A N/A N/A return joint variance from samples with unequal variances and unequal
    sample sizes

    something is wrong

    Parameters
    ----------
    var_all : array_like
        The variance for each sample
    nobs_all : array_like
        The number of observations for each sample
    df_all : array_like
        degrees of freedom for each sample

    Returns
    -------
    varjoint : float
        joint variance.
    dfjoint : float
        joint Satterthwait's degrees of freedom


    Notes
    -----
    (copy, paste not correct)
    variance is

    1/k * sum_i 1/n_i

    where k is the number of samples and summation is over i=0,...,k-1.
    If all n_i are the same, then the correction factor is 1/n.

    This needs to be multiplies by the joint variance estimate, means square
    error, MSE. To obtain the correction factor for the standard deviation,
    square root needs to be taken.

    This is for variance of mean difference not of studentized range.
     N/A var_all N/A N/A np asarray var_all N/A var_over_n N/A N/A var_all 1.0 nobs_all N/A varjoint N/A N/A var_over_n sum N/A dfjoint N/A N/A varjoint 2 N/A N/A N/A N/A var_over_n 2 df_all sum N/A N/A varjoint dfjoint N/A varcorrection_pairs_unequal N/A N/A var_all nobs_all df_all N/A N/A N/A return joint variance from samples with unequal variances and unequal
    sample sizes for all pairs

    something is wrong

    Parameters
    ----------
    var_all : array_like
        The variance for each sample
    nobs_all : array_like
        The number of observations for each sample
    df_all : array_like
        degrees of freedom for each sample

    Returns
    -------
    varjoint : array
        joint variance.
    dfjoint : array
        joint Satterthwait's degrees of freedom


    Notes
    -----

    (copy, paste not correct)
    variance is

    1/k * sum_i 1/n_i

    where k is the number of samples and summation is over i=0,...,k-1.
    If all n_i are the same, then the correction factor is 1.

    This needs to be multiplies by the joint variance estimate, means square
    error, MSE. To obtain the correction factor for the standard deviation,
    square root needs to be taken.

    TODO: something looks wrong with dfjoint, is formula from SPSS
     N/A N/A v1 v2 N/A N/A np meshgrid var_all var_all N/A N/A n1 n2 N/A N/A np meshgrid nobs_all nobs_all N/A N/A df1 df2 N/A N/A np meshgrid df_all df_all N/A varjoint N/A N/A v1 n1 N/A v2 n2 N/A dfjoint N/A N/A varjoint 2 N/A N/A df1 N/A N/A v1 n1 2 N/A df2 N/A N/A v2 n2 2 N/A N/A varjoint dfjoint N/A tukeyhsd N/A N/A mean_all nobs_all var_all df alpha q_crit N/A None 0.05 None N/A N/A simultaneous Tukey HSD


    check: instead of sorting, I use absolute value of pairwise differences
    in means. That's irrelevant for the test, but maybe reporting actual
    differences would be better.
    CHANGED: meandiffs are with sign, studentized range uses abs

    q_crit added for testing

    TODO: error in variance calculation when nobs_all is scalar, missing 1/n

     N/A mean_all N/A N/A np asarray mean_all N/A n_means N/A len mean_all N/A N/A df None N/A N/A df N/A nobs_all 1 N/A N/A N/A N/A np size df 1 N/A N/A df_total N/A n_means df N/A df N/A N/A N/A np ones n_means df N/A N/A df_total N/A N/A np sum df N/A N/A N/A N/A N/A np size nobs_all 1 N/A N/A N/A np size var_all 1 N/A N/A var_pairs N/A N/A N/A 1.0 var_all nobs_all N/A N/A np ones N/A n_means n_means N/A N/A N/A N/A N/A np size var_all 1 N/A N/A var_pairs N/A var_all N/A varcorrection_pairs_unbalanced nobs_all srange True N/A N/A N/A N/A N/A np size var_all 1 N/A N/A N/A var_pairs df_sum N/A varcorrection_pairs_unequal nobs_all var_all df N/A var_pairs 2.0 N/A N/A N/A ValueError not supposed to be here N/A meandiffs_ N/A mean_all N/A mean_all N/A N/A N/A None N/A std_pairs_ N/A N/A np sqrt var_pairs N/A N/A idx1 idx2 N/A N/A np triu_indices n_means 1 N/A meandiffs N/A meandiffs_ N/A N/A idx1 idx2 N/A std_pairs N/A std_pairs_ N/A N/A idx1 idx2 N/A st_range N/A N/A N/A np abs meandiffs std_pairs N/A df_total_ N/A max df_total 5 N/A N/A q_crit None N/A N/A q_crit N/A get_tukeyQcrit2 n_means df_total alpha alpha N/A reject N/A st_range q_crit N/A crit_int N/A std_pairs q_crit N/A reject2 N/A N/A N/A np abs meandiffs crit_int N/A confint N/A N/A np column_stack N/A N/A meandiffs crit_int N/A meandiffs crit_int N/A N/A N/A idx1 idx2 reject meandiffs std_pairs confint q_crit df_total reject2 N/A simultaneous_ci N/A N/A q_crit var groupnobs pairindices N/A None N/A N/A Compute simultaneous confidence intervals for comparison of means.

    q_crit value is generated from tukey hsd test. Variance is considered
    across all groups. Returned halfwidths can be thought of as uncertainty
    intervals around each group mean. They allow for simultaneous
    comparison of pairwise significance among any pairs (by checking for
    overlap)

    Parameters
    ----------
    q_crit : float
        The Q critical value studentized range statistic from Tukey's HSD
    var : float
        The group variance
    groupnobs : array-like object
        Number of observations contained in each group.
    pairindices : tuple of lists, optional
        Indices corresponding to the upper triangle of matrix. Computed
        here if not supplied

    Returns
    -------
    halfwidths : ndarray
        Half the width of each confidence interval for each group given in
        groupnobs

    See Also
    --------
    MultiComparison : statistics class providing significance tests
    tukeyhsd : among other things, computes q_crit value

    References
    ----------
    .. [1] Hochberg, Y., and A. C. Tamhane. Multiple Comparison Procedures.
           Hoboken, NJ: John Wiley & Sons, 1987.)
     N/A ng N/A len groupnobs N/A N/A pairindices None N/A N/A pairindices N/A N/A np triu_indices ng 1 N/A gvar N/A var groupnobs N/A d12 N/A N/A np sqrt N/A N/A gvar N/A N/A pairindices N/A 0 N/A gvar N/A N/A pairindices N/A 1 N/A d N/A N/A np zeros N/A ng ng N/A N/A d N/A pairindices d12 N/A d N/A d N/A N/A N/A d conj T N/A sum1 N/A N/A np sum d12 N/A sum2 N/A N/A np sum d axis 0 N/A N/A ng 2 N/A N/A w N/A N/A N/A N/A ng 1.0 sum2 sum1 N/A N/A ng 1.0 N/A ng 2.0 N/A N/A w N/A N/A sum1 N/A N/A np ones 2 1 2.0 N/A N/A N/A q_crit N/A N/A np sqrt 2 w N/A distance_st_range N/A N/A mean_all nobs_all var_all df triu N/A None False N/A N/A pairwise distance matrix, outsourced from tukeyhsd



    CHANGED: meandiffs are with sign, studentized range uses abs

    q_crit added for testing

    TODO: error in variance calculation when nobs_all is scalar, missing 1/n

     N/A mean_all N/A N/A np asarray mean_all N/A n_means N/A len mean_all N/A N/A df None N/A N/A df N/A nobs_all 1 N/A N/A N/A N/A np size df 1 N/A N/A df_total N/A n_means df N/A N/A df_total N/A N/A np sum df N/A N/A N/A N/A N/A np size nobs_all 1 N/A N/A N/A np size var_all 1 N/A N/A var_pairs N/A N/A N/A 1.0 var_all nobs_all N/A N/A np ones N/A n_means n_means N/A N/A N/A N/A N/A np size var_all 1 N/A N/A var_pairs N/A var_all N/A varcorrection_pairs_unbalanced nobs_all srange True N/A N/A N/A N/A N/A np size var_all 1 N/A N/A N/A var_pairs df_sum N/A varcorrection_pairs_unequal nobs_all var_all df N/A var_pairs 2.0 N/A N/A N/A ValueError not supposed to be here N/A meandiffs N/A mean_all N/A mean_all N/A N/A N/A None N/A std_pairs N/A N/A np sqrt var_pairs N/A N/A idx1 idx2 N/A N/A np triu_indices n_means 1 N/A triu N/A N/A meandiffs N/A meandiffs_ N/A N/A idx1 idx2 N/A std_pairs N/A std_pairs_ N/A N/A idx1 idx2 N/A st_range N/A N/A N/A np abs meandiffs std_pairs N/A N/A st_range meandiffs std_pairs N/A idx1 idx2 N/A contrast_allpairs N/A N/A nm N/A N/A N/A contrast or restriction matrix for all pairs of nm variables

    Parameters
    ----------
    nm : int

    Returns
    -------
    contr : ndarray, 2d, (nm*(nm-1)/2, nm)
       contrast matrix for all pairwise comparisons

     N/A contr N/A N/A i N/A range nm N/A N/A j N/A range N/A i 1 nm N/A N/A contr_row N/A N/A np zeros nm N/A N/A contr_row N/A i 1 N/A N/A contr_row N/A j -1 N/A N/A N/A contr append contr_row N/A N/A N/A np array contr N/A contrast_all_one N/A N/A nm N/A N/A N/A contrast or restriction matrix for all against first comparison

    Parameters
    ----------
    nm : int

    Returns
    -------
    contr : ndarray, 2d, (nm-1, nm)
       contrast matrix for all against first comparisons

     N/A contr N/A N/A np column_stack N/A N/A N/A np ones N/A nm 1 N/A N/A N/A np eye N/A nm 1 N/A contr N/A contrast_diff_mean N/A N/A nm N/A N/A N/A contrast or restriction matrix for all against mean comparison

    Parameters
    ----------
    nm : int

    Returns
    -------
    contr : ndarray, 2d, (nm-1, nm)
       contrast matrix for all against mean comparisons

     N/A N/A N/A N/A np eye nm N/A N/A N/A np ones N/A nm nm nm N/A tukey_pvalues N/A N/A std_range nm df N/A N/A statsmodels.sandbox.distributions.multivariate mvstdtprob N/A contr N/A contrast_allpairs nm N/A corr N/A N/A N/A np dot contr N/A contr T 2.0 N/A tstat N/A N/A std_range N/A N/A np sqrt 2 N/A N/A np ones N/A N/A corr shape N/A 0 N/A N/A multicontrast_pvalues tstat corr df df N/A test_tukey_pvalues N/A N/A N/A N/A N/A res N/A tukey_pvalues 3.649 3 16 N/A N/A assert_almost_equal 0.05 N/A res N/A 0 3 N/A N/A assert_almost_equal N/A 0.05 N/A N/A np ones 3 N/A res N/A 1 3 N/A multicontrast_pvalues N/A N/A tstat tcorr df dist alternative N/A None t two-sided N/A N/A pvalues for simultaneous tests

     statsmodels.sandbox.distributions.multivariate mvstdtprob N/A N/A N/A df None N/A dist t N/A N/A N/A ValueError df has to be specified for the t-distribution N/A tstat N/A N/A np asarray tstat N/A ntests N/A len tstat N/A cc N/A N/A np abs tstat N/A pval_global N/A 1 N/A mvstdtprob N/A cc cc tcorr df N/A pvals N/A N/A ti cc N/A N/A limits N/A ti N/A N/A np ones ntests N/A N/A N/A pvals append N/A 1 N/A mvstdtprob N/A cc cc tcorr df N/A N/A pval_global N/A N/A np asarray pvals N/A StepDown N/A object N/A N/A a class for step down methods

    This is currently for simple tree subset descend, similar to homogeneous_subsets,
    but checks all leave-one-out subsets instead of assuming an ordered set.
    Comment in SAS manual:
    SAS only uses interval subsets of the sorted list, which is sufficient for range
    tests (maybe also equal variance and balanced sample sizes are required).
    For F-test based critical distances, the restriction to intervals is not sufficient.

    This version uses a single critical value of the studentized range distribution
    for all comparisons, and is therefore a step-down version of Tukey HSD.
    The class is written so it can be subclassed, where the get_distance_matrix and
    get_crit are overwritten to obtain other step-down procedures such as REGW.

    iter_subsets can be overwritten, to get a recursion as in the many to one comparison
    with a control such as in Dunnet's test.


    A one-sided right tail test is not covered because the direction of the inequality
    is hard coded in check_set.  Also Peritz's check of partitions is not possible, but
    I have not seen it mentioned in any more recent references.
    I have only partially read the step-down procedure for closed tests by Westfall.

    One change to make it more flexible, is to separate out the decision on a subset,
    also because the F-based tests, FREGW in SPSS, take information from all elements of
    a set and not just pairwise comparisons. I haven't looked at the details of
    the F-based tests such as Sheffe yet. It looks like running an F-test on equality
    of means in each subset. This would also outsource how pairwise conditions are
    combined, any larger or max. This would also imply that the distance matrix cannot
    be calculated in advance for tests like the F-based ones.


     __init__ N/A N/A self vals nobs_all var_all df N/A None N/A N/A N/A self vals vals N/A N/A self n_vals N/A len vals N/A N/A self nobs_all nobs_all N/A N/A self var_all var_all N/A N/A self df df N/A get_crit N/A N/A self alpha N/A N/A N/A q_crit N/A get_tukeyQcrit N/A self n_vals N/A self df alpha alpha N/A N/A q_crit N/A N/A np ones N/A self n_vals N/A get_distance_matrix N/A N/A self N/A N/A N/A studentized range statistic N/A dres N/A distance_st_range N/A self vals N/A self nobs_all N/A self var_all df N/A self df N/A N/A self distance_matrix N/A dres N/A 0 N/A iter_subsets N/A N/A self indices N/A N/A N/A ii N/A range N/A len indices N/A N/A idxsub N/A N/A copy copy indices N/A N/A N/A idxsub pop ii N/A N/A idxsub N/A check_set N/A N/A self indices N/A N/A N/A check whether pairwise distances of indices satisfy condition

         N/A indtup N/A tuple indices N/A N/A indtup N/A self cache_result N/A N/A N/A N/A self cache_result N/A indtup N/A N/A set_distance_matrix N/A N/A self distance_matrix N/A N/A N/A N/A N/A np asarray indices N/A N/A N/A None indices N/A n_elements N/A len indices N/A N/A N/A np any N/A set_distance_matrix N/A N/A self crit N/A N/A n_elements 1 N/A N/A res True N/A N/A res False N/A N/A N/A self cache_result N/A indtup res N/A res N/A stepdown N/A N/A self indices N/A N/A N/A N/A print indices N/A N/A N/A self check_set indices N/A N/A N/A N/A len indices 2 N/A N/A subs N/A N/A self iter_subsets indices N/A N/A N/A N/A self stepdown subs N/A N/A N/A N/A N/A self rejected append N/A tuple indices N/A N/A N/A N/A N/A self accepted append N/A tuple indices N/A indices N/A run N/A N/A self alpha N/A N/A N/A main function to run the test,

        could be done in __call__ instead
        this could have all the initialization code

         N/A N/A self cache_result N/A N/A N/A self crit N/A N/A self get_crit alpha N/A N/A self accepted N/A N/A N/A self rejected N/A N/A N/A N/A self get_distance_matrix N/A N/A N/A self stepdown N/A lrange N/A self n_vals N/A N/A N/A list N/A set N/A self accepted N/A list N/A set N/A sd rejected N/A N/A homogeneous_subsets N/A N/A vals dcrit N/A N/A N/A recursively check all pairs of vals for minimum distance

    step down method as in Newman-Keuls and Ryan procedures. This is not a
    closed procedure since not all partitions are checked.

    Parameters
    ----------
    vals : array_like
        values that are pairwise compared
    dcrit : array_like or float
        critical distance for rejecting, either float, or 2-dimensional array
        with distances on the upper triangle.

    Returns
    -------
    rejs : list of pairs
        list of pair-indices with (strictly) larger than critical difference
    nrejs : list of pairs
        list of pair-indices with smaller than critical difference
    lli : list of tuples
        list of subsets with smaller than critical difference
    res : tree
        result of all comparisons (for checking)


    this follows description in SPSS notes on Post-Hoc Tests

    Because of the recursive structure, some comparisons are made several
    times, but only unique pairs or sets are returned.

    Examples
    --------
    >>> m = [0, 2, 2.5, 3, 6, 8, 9, 9.5,10 ]
    >>> rej, nrej, ssli, res = homogeneous_subsets(m, 2)
    >>> set_partition(ssli)
    ([(5, 6, 7, 8), (1, 2, 3), (4,)], [0])
    >>> [np.array(m)[list(pp)] for pp in set_partition(ssli)[0]]
    [array([  8. ,   9. ,   9.5,  10. ]), array([ 2. ,  2.5,  3. ]), array([ 6.])]


     N/A nvals N/A len vals N/A indices_ N/A lrange nvals N/A rejected N/A N/A subsetsli N/A N/A N/A N/A N/A np size dcrit 1 N/A N/A dcrit N/A dcrit N/A N/A np ones N/A nvals nvals subsets N/A N/A vals indices_ N/A N/A N/A recursive function for constructing homogeneous subset

        registers rejected and subsetli in outer scope
         N/A N/A i j N/A N/A indices_ N/A 0 N/A indices_ N/A -1 N/A N/A N/A N/A vals N/A -1 N/A vals N/A 0 N/A dcrit N/A N/A i j N/A N/A N/A N/A rejected append N/A N/A indices_ N/A 0 N/A indices_ N/A -1 N/A N/A N/A subsets N/A vals N/A -1 N/A indices_ N/A -1 N/A subsets N/A vals N/A 1 N/A indices_ N/A 1 N/A N/A indices_ N/A 0 N/A indices_ N/A -1 N/A N/A N/A N/A subsetsli append N/A tuple indices_ N/A indices_ N/A N/A res N/A subsets vals indices_ N/A all_pairs N/A N/A i j N/A i N/A range nvals N/A j N/A range N/A nvals 1 i -1 N/A rejs N/A set rejected N/A not_rejected N/A list N/A N/A set all_pairs rejs N/A N/A N/A list rejs not_rejected N/A list N/A set subsetsli res N/A set_partition N/A N/A ssli N/A N/A N/A extract a partition from a list of tuples

    this should be correctly called select largest disjoint sets.
    Begun and Gabriel 1981 don't seem to be bothered by sets of accepted
    hypothesis with joint elements,
    e.g. maximal_accepted_sets = { {1,2,3}, {2,3,4} }

    This creates a set partition from a list of sets given as tuples.
    It tries to find the partition with the largest sets. That is, sets are
    included after being sorted by length.

    If the list doesn't include the singletons, then it will be only a
    partial partition. Missing items are singletons (I think).

    Examples
    --------
    >>> li
    [(5, 6, 7, 8), (1, 2, 3), (4, 5), (0, 1)]
    >>> set_partition(li)
    ([(5, 6, 7, 8), (1, 2, 3)], [0, 4])

     N/A part N/A N/A s N/A N/A sorted N/A list N/A set ssli key len N/A -1 N/A N/A s_ N/A N/A N/A set s copy N/A N/A N/A any N/A N/A N/A N/A set s_ intersection N/A set t N/A t part N/A N/A N/A N/A part append s N/A missing N/A list N/A N/A set N/A i N/A ll ssli N/A i ll N/A set N/A i N/A ll part N/A i ll N/A N/A part missing N/A set_remove_subs N/A N/A ssli N/A N/A N/A remove sets that are subsets of another set from a list of tuples

    Parameters
    ----------
    ssli : list of tuples
        each tuple is considered as a set

    Returns
    -------
    part : list of tuples
        new list with subset tuples removed, it is sorted by set-length of tuples. The
        list contains original tuples, duplicate elements are not removed.

    Examples
    --------
    >>> set_remove_subs([(0, 1), (1, 2), (1, 2, 3), (0,)])
    [(1, 2, 3), (0, 1)]
    >>> set_remove_subs([(0, 1), (1, 2), (1,1, 1, 2, 3), (0,)])
    [(1, 1, 1, 2, 3), (0, 1)]

     N/A part N/A N/A s N/A N/A sorted N/A list N/A set ssli key N/A N/A N/A x N/A N/A len N/A set x N/A -1 N/A N/A N/A N/A any N/A N/A N/A N/A set s issubset N/A set t N/A t part N/A N/A N/A N/A part append s N/A part N/A N/A N/A __name__ __main__ N/A N/A examples N/A tukey tukeycrit fdr fdrmc bonf randmvn multicompdev None N/A N/A tukey examples N/A N/A x N/A N/A N/A N/A np array N/A N/A 0 0 1 T N/A N/A N/A np random randn 3 20 N/A N/A print N/A Tukeythreegene x N/A N/A N/A fdr examples N/A bonf examples N/A N/A x1 N/A 1 1 1 0 -1 -1 -1 0 1 1 -1 1 N/A N/A print N/A lzip N/A N/A np arange N/A len x1 x1 N/A N/A print N/A maxzero x1 N/A N/A print N/A maxzerodown N/A N/A N/A np array x1 N/A locs N/A N/A np linspace 0 1 10 N/A locs N/A N/A np array N/A N/A N/A 0.0 6 N/A N/A 0.75 4 N/A rvs N/A locs N/A N/A N/A stats norm rvs size N/A 20 10 N/A N/A tt tpval N/A N/A stats ttest_1samp rvs 0 N/A tpval_sortind N/A N/A np argsort tpval N/A tpval_sorted N/A tpval N/A tpval_sortind N/A reject N/A tpval_sorted N/A N/A ecdf tpval_sorted 0.05 N/A reject2 N/A max N/A N/A np nonzero reject N/A N/A print reject N/A res N/A N/A np array N/A lzip N/A N/A np round N/A N/A rvs mean 0 4 N/A N/A np round tpval 4 N/A reject N/A N/A N/A tpval_sortind argsort dtype N/A N/A mean float N/A pval float N/A reject N/A np bool8 N/A N/A print N/A SimpleTable res headers N/A N/A res dtype names N/A N/A print N/A fdrcorrection_bak tpval alpha 0.05 N/A N/A print reject N/A N/A print 
random example N/A N/A print bonf N/A multipletests tpval alpha 0.05 method bonf N/A N/A print sidak N/A multipletests tpval alpha 0.05 method sidak N/A N/A print hs N/A multipletests tpval alpha 0.05 method hs N/A N/A print sh N/A multipletests tpval alpha 0.05 method sh N/A pvals N/A N/A np array N/A N/A 0.0020 0.0045 0.0060 0.0080 0.0085 0.0090 0.0175 0.0250 0.1055 0.5350 split float N/A N/A print 
example from lecturnotes N/A meth N/A bonf sidak hs sh N/A N/A N/A print meth N/A N/A print N/A multipletests pvals alpha 0.05 method meth N/A N/A fdrmc examples N/A N/A mcres N/A mcfdr nobs 100 nrepl 1000 ntests 30 ntrue 30 mu 0.1 alpha 0.05 rho 0.3 N/A mcmeans N/A N/A N/A N/A np array mcres mean 0 N/A N/A print mcmeans N/A N/A print N/A N/A mcmeans N/A 0 6.0 N/A 1 N/A N/A mcmeans N/A 1 4.0 N/A N/A print N/A mcmeans N/A 4 N/A mcmeans N/A -4 N/A N/A randmvn examples N/A N/A rvsmvn N/A randmvn 0.8 N/A 5000 5 N/A N/A print N/A N/A np corrcoef rvsmvn rowvar 0 N/A N/A print N/A N/A rvsmvn var 0 N/A N/A tukeycrit examples N/A N/A N/A print N/A get_tukeyQcrit 8 8 alpha 0.05 5.6 N/A N/A print N/A get_tukeyQcrit 8 8 alpha 0.01 7.47 N/A N/A multicompdev examples N/A N/A X N/A N/A np array N/A N/A 7.68 1 N/A 7.69 1 N/A 7.7 1 N/A 7.7 1 N/A 7.72 1 N/A 7.73 1 N/A 7.73 1 N/A 7.76 1 N/A 7.71 2 N/A 7.73 2 N/A 7.74 2 N/A 7.74 2 N/A 7.78 2 N/A 7.78 2 N/A 7.8 2 N/A 7.81 2 N/A 7.74 3 N/A 7.75 3 N/A 7.77 3 N/A 7.78 3 N/A 7.8 3 N/A 7.81 3 N/A 7.84 3 N/A 7.71 4 N/A 7.71 4 N/A 7.74 4 N/A 7.79 4 N/A 7.81 4 N/A 7.85 4 N/A 7.87 4 N/A 7.91 4 N/A xli N/A N/A X N/A N/A N/A N/A X N/A N/A N/A 1 k 0 N/A k N/A range 1 5 N/A xranks N/A N/A stats rankdata N/A X N/A N/A N/A 0 N/A xranksli N/A N/A xranks N/A N/A N/A X N/A N/A N/A 1 k N/A k N/A range 1 5 N/A xnobs N/A N/A np array N/A N/A len x N/A x xli N/A meanranks N/A N/A N/A item mean N/A item xranksli N/A sumranks N/A N/A N/A item sum N/A item xranksli N/A N/A N/A N/A stats norm sf 0.674489750196 N/A N/A N/A N/A stats norm isf 0.25 N/A mrs N/A N/A np sort meanranks N/A N/A v1 v2 N/A N/A np triu_indices 4 1 N/A N/A print 
sorted rank differences N/A N/A print N/A N/A mrs N/A v2 N/A mrs N/A v1 N/A diffidx N/A N/A N/A np argsort N/A N/A mrs N/A v2 N/A mrs N/A v1 N/A -1 N/A N/A N/A mrs N/A N/A v2 N/A diffidx N/A mrs N/A N/A v1 N/A diffidx N/A N/A print 
kruskal for all pairs N/A N/A i j N/A zip N/A v2 N/A diffidx N/A v1 N/A diffidx N/A N/A N/A print i j N/A N/A stats kruskal N/A xli N/A i N/A xli N/A j N/A N/A mwu mwupval N/A N/A stats mannwhitneyu N/A xli N/A i N/A xli N/A j use_continuity False N/A N/A print mwu N/A mwupval 2 N/A N/A mwupval 2 N/A 0.05 6.0 N/A N/A mwupval 2 N/A 0.1 6.0 N/A N/A uni intlab N/A N/A np unique N/A X N/A N/A N/A 0 return_inverse True N/A groupnobs N/A N/A np bincount intlab N/A groupxsum N/A N/A np bincount intlab weights N/A X N/A N/A N/A 0 N/A groupxmean N/A N/A groupxsum 1.0 groupnobs N/A rankraw N/A N/A N/A N/A N/A X N/A N/A N/A 0 argsort argsort N/A groupranksum N/A N/A np bincount intlab weights rankraw N/A grouprankmean N/A N/A N/A groupranksum 1.0 groupnobs 1 N/A N/A assert_almost_equal N/A grouprankmean N/A intlab N/A N/A stats rankdata N/A X N/A N/A N/A 0 15 N/A gs N/A GroupsStats X useranks True N/A N/A print 
groupmeanfilter and grouprankmeans N/A N/A print N/A gs groupmeanfilter N/A N/A print N/A grouprankmean N/A intlab N/A N/A xuni xintlab N/A N/A np unique N/A X N/A N/A N/A 0 return_inverse True N/A gs2 N/A GroupsStats N/A N/A np column_stack N/A N/A X N/A N/A N/A 0 xintlab useranks True N/A rankbincount N/A N/A np bincount N/A N/A xranks astype int N/A nties N/A rankbincount N/A N/A rankbincount 1 N/A ntot N/A float N/A len xranks N/A tiecorrection N/A 1 N/A N/A N/A N/A N/A nties 3 nties sum N/A N/A ntot 3 ntot N/A N/A assert_almost_equal tiecorrection N/A N/A stats tiecorrect xranks 15 N/A N/A print 
tiecorrection for data and ranks N/A N/A print tiecorrection N/A N/A print N/A tiecorrect xranks N/A tot N/A N/A X shape N/A 0 N/A t 500 N/A f N/A N/A N/A tot N/A tot 1.0 12.0 N/A t N/A 6.0 N/A tot 1.0 N/A f N/A N/A N/A tot N/A tot 1.0 12.0 N/A N/A stats tiecorrect xranks N/A N/A print 
pairs of mean rank differences N/A N/A i j N/A zip N/A v2 N/A diffidx N/A v1 N/A diffidx N/A N/A pdiff N/A N/A np abs N/A N/A meanranks N/A i N/A meanranks N/A j N/A se N/A N/A np sqrt N/A f N/A N/A np sum N/A 1.0 N/A xnobs N/A N/A i j N/A N/A print i j pdiff se N/A pdiff se N/A N/A pdiff se 2.631 N/A multicomp N/A MultiComparison N/A X T N/A N/A N/A multicomp kruskal N/A gsr N/A GroupsStats X useranks True N/A N/A print 
examples for kruskal multicomparison N/A i N/A range 10 N/A N/A N/A x1 x2 N/A N/A N/A N/A N/A np random randn 30 2 N/A N/A np array N/A 0 0.5 T N/A skw N/A N/A stats kruskal x1 x2 N/A mc2 N/A MultiComparison N/A N/A np r_ N/A N/A x1 x2 N/A N/A np r_ N/A N/A N/A N/A np zeros N/A len x1 N/A N/A np ones N/A len x2 N/A newskw N/A N/A mc2 kruskal N/A N/A print skw N/A N/A np sqrt N/A skw N/A 0 N/A N/A skw N/A 1 newskw N/A N/A N/A newskw N/A skw N/A 1 1 100 N/A N/A tablett restt arrtt N/A N/A multicomp allpairtest N/A stats ttest_ind N/A N/A tablemw resmw arrmw N/A N/A multicomp allpairtest N/A stats mannwhitneyu N/A N/A print N/A N/A print tablett N/A N/A print N/A N/A print tablemw N/A N/A tablemwhs resmw arrmw N/A N/A multicomp allpairtest N/A stats mannwhitneyu method hs N/A N/A print N/A N/A print tablemwhs N/A N/A last examples N/A N/A xli N/A N/A N/A N/A N/A np random randn 60 4 N/A N/A np array N/A 0 0 0.5 0.5 T N/A N/A xrvs xrvsgr N/A catstack xli N/A multicompr N/A MultiComparison xrvs xrvsgr N/A N/A tablett restt arrtt N/A N/A multicompr allpairtest N/A stats ttest_ind N/A N/A print tablett N/A xli N/A N/A 8 10 9 10 9 N/A 7 8 5 8 5 N/A 4 8 7 5 7 N/A N/A x l N/A catstack xli N/A gs4 N/A GroupsStats N/A N/A np column_stack N/A x l N/A N/A print N/A N/A gs4 groupvarwithin N/A gmeans N/A N/A np array N/A 7.71375 7.76125 7.78428571 7.79875 N/A gnobs N/A N/A np array N/A 8 8 7 8 N/A sd N/A StepDown gmeans gnobs 0.001 N/A 27 N/A pvals N/A 0.0001 0.0004 0.0019 0.0095 0.0201 0.0278 0.0298 0.0344 0.0459 0.324 0.4262 0.5719 0.6528 0.759 1.0 N/A N/A print N/A fdrcorrection0 pvals alpha 0.05 method indep N/A N/A print N/A fdrcorrection_twostage pvals alpha 0.05 iter False N/A res_tst N/A fdrcorrection_twostage pvals alpha 0.05 iter False N/A N/A assert_almost_equal N/A 0.047619 0.0649 N/A N/A res_tst N/A -1 N/A 2 3 N/A N/A assert_equal 8 N/A N/A N/A res_tst N/A 0 sum N/A N/A print N/A fdrcorrection_twostage pvals alpha 0.05 iter True N/A N/A print fdr_gbs N/A multipletests pvals alpha 0.05 method fdr_gbs N/A N/A test_tukey_pvalues N/A N/A tukey_pvalues 3.649 3 16