Module Expr Str ImportFrom alias Import alias Import alias Import alias Assign NameStore Str FunctionDef arguments args defaults body Expr Str Return Call AttributeLoad NameLoad attr Num keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num SubscriptLoad NameLoad Slice Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad ExtSlice Slice Num Index Num attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr Num AugAssignSub SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpMult Num Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpMult BinOpMult Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad ExtSlice Slice Num Slice Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore SubscriptLoad NameLoad Index Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad TupleLoad NameLoad Num Num TupleLoad Num NameLoad Num TupleLoad Num Num NameLoad keyword AttributeLoad NameLoad attr AugAssignAdd NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpSub Num NameLoad AugAssignMult NameStore NameLoad AugAssignAdd NameStore Call AttributeLoad NameLoad attr TupleLoad TupleLoad Num UnaryOpUSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num TupleLoad SubscriptLoad NameLoad Index Num Num UnaryOpUSub SubscriptLoad NameLoad Index Num TupleLoad UnaryOpUSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad ExtSlice Slice Num Slice Num NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num keyword AttributeLoad NameLoad attr keyword NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpSub NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Num Slice Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore SubscriptLoad NameLoad Index Num Assign NameStore BinOpDiv BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num If CompareGt Call NameLoad SubscriptLoad NameLoad Index Num Num body Assign NameStore BinOpDiv BinOpAdd SubscriptLoad NameLoad Index TupleLoad Num Num BinOpMult BinOpMult BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num orelse If CompareGt Call NameLoad SubscriptLoad NameLoad Index Num Num body Assign NameStore BinOpDiv BinOpAdd SubscriptLoad NameLoad Index TupleLoad Num Num BinOpMult BinOpMult BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num orelse Assign NameStore BinOpDiv BinOpAdd SubscriptLoad NameLoad Index TupleLoad Num Num BinOpMult BinOpMult BinOpSub NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad TupleLoad NameLoad Num Num Num TupleLoad Num NameLoad Num Num TupleLoad Num Num NameLoad Num TupleLoad Num Num Num Num keyword AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num SubscriptLoad NameLoad Slice Num AugAssignMult SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpSub Num NameLoad orelse Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore BinOpSub Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num AugAssignSub SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpMult BinOpMult NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Num Slice Num Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Num TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad Num Index Num Index Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr AugAssignDiv NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign NameStore BinOpDiv BinOpAdd NameLoad Num Num Assign NameStore NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore SubscriptLoad NameLoad Index Num Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num keyword AttributeLoad NameLoad attr keyword NameLoad Assign SubscriptStore NameLoad Index TupleLoad Num Num SubscriptStore NameLoad Index TupleLoad Num Num SubscriptStore NameLoad Index TupleLoad Num Num Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad NameLoad AugAssignSub SubscriptStore NameLoad ExtSlice Slice Num Slice Num Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body AugAssignSub SubscriptStore NameLoad ExtSlice Slice Num Slice Num Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpAdd NameLoad NameLoad orelse Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Index Num Slice Num UnaryOpUSub NameLoad Assign SubscriptStore NameLoad Index TupleLoad Num Num Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AugAssignSub SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpDiv Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpMult NameLoad BinOpDiv Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse AugAssignSub SubscriptStore NameLoad ExtSlice Slice Num Slice Num Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Num Slice Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If BoolOpAnd UnaryOpNot NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore SubscriptLoad NameLoad Index Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore Call NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num Index Num If Call NameLoad NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore Call NameLoad NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad orelse Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareGt Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore SubscriptLoad NameLoad Index Num Assign NameStore UnaryOpUSub SubscriptLoad NameLoad ExtSlice Index Num Slice Num Assign NameStore BinOpDiv SubscriptLoad NameLoad ExtSlice Slice Num Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num NameLoad If NameLoad body AugAssignSub NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If BoolOpOr CompareGtE NameLoad NameLoad CompareGtE NameLoad NameLoad CompareGtE NameLoad NameLoad body Raise Call NameLoad Str If NameLoad body If CompareLtE NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore BinOpMult Num NameLoad Assign NameStore TupleLoad TupleLoad BinOpDiv UnaryOpUSub NameLoad BinOpSub NameLoad NameLoad Num BinOpDiv BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad Num TupleLoad Num BinOpDiv UnaryOpUSub NameLoad BinOpSub NameLoad NameLoad BinOpDiv BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad Num TupleLoad Num Num BinOpDiv UnaryOpUSub BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad BinOpDiv BinOpMult NameLoad NameLoad BinOpSub NameLoad NameLoad TupleLoad Num Num Num Num orelse Assign NameStore TupleLoad TupleLoad BinOpDiv Num BinOpSub NameLoad NameLoad Num Num BinOpDiv BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad TupleLoad Num BinOpDiv Num BinOpSub NameLoad NameLoad Num BinOpDiv BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad TupleLoad Num Num BinOpDiv Num BinOpSub NameLoad NameLoad BinOpDiv BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad TupleLoad Num Num Num Num Return Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num If CompareGt Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num BinOpMult BinOpMult UnaryOpUSub NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Num Slice Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If CompareLt Call NameLoad NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr attr Assign NameStore Num For TupleStore NameStore NameStore TupleLoad TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call NameLoad NameLoad If CompareGt NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad AugAssignDiv NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad Call AttributeLoad NameLoad attr Num NameLoad Assign NameStore Call NameLoad NameLoad AugAssignDiv NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr CompareLt Call NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad Num Num Index Num If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index SubscriptLoad NameLoad Index Num attr AugAssignDiv NameStore SubscriptLoad NameLoad Index Num Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad attr If CompareLt Call NameLoad SubscriptLoad NameLoad Index TupleLoad Num Num NameLoad body Raise Call NameLoad Str AugAssignDiv NameStore SubscriptLoad NameLoad Index TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Slice Index Num TupleLoad Num Num Num Num If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num keyword AttributeLoad NameLoad attr Assign NameStore ListLoad Num Num Num Assign NameStore ListLoad Num Num Num If Call NameLoad CompareGt Call NameLoad SubscriptLoad NameLoad ExtSlice Slice Num Index Num NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Slice Index Num TupleLoad Num Num Num Num orelse Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Num Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad SubscriptLoad NameLoad ExtSlice Index Num Slice Num attr Assign SubscriptStore NameLoad ExtSlice Index Num Slice Num Num Assign NameStore Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Num Slice Num attr Assign SubscriptStore NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num AugAssignDiv SubscriptStore NameLoad Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num AugAssignSub SubscriptStore NameLoad Index Num BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num AugAssignDiv SubscriptStore NameLoad Index Num SubscriptLoad NameLoad Index Num AugAssignDiv SubscriptStore NameLoad Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num AugAssignSub SubscriptStore NameLoad Index Num BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num AugAssignSub SubscriptStore NameLoad Index Num BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num AugAssignDiv SubscriptStore NameLoad Index Num SubscriptLoad NameLoad Index Num AugAssignDiv SubscriptStore NameLoad Slice Num SubscriptLoad NameLoad Index Num If CompareLt Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num body AugAssignMult NameStore Num AugAssignMult NameStore Num Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad NameLoad Index TupleLoad Num Num If Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num body Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num orelse Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Assign SubscriptStore NameLoad Index Num Num Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Num If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad ExtSlice Index Num Slice SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AugAssignDiv NameStore SubscriptLoad NameLoad Index TupleLoad Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpDiv BinOpSub BinOpMult NameLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Return Call AttributeLoad NameLoad attr TupleLoad TupleLoad BinOpMult BinOpMult NameLoad NameLoad Call AttributeLoad NameLoad attr BinOpSub Num BinOpMult NameLoad NameLoad Num Num Num TupleLoad BinOpMult BinOpMult UnaryOpUSub NameLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Num Num TupleLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad NameLoad Num TupleLoad Num Num Num Num keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Slice Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Slice Num If BoolOpOr CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareLt SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore BinOpSub NameLoad Call AttributeLoad NameLoad attr Num Num Assign NameStore BinOpSub NameLoad Call AttributeLoad NameLoad attr Num Num If NameLoad body Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareLt Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num body AugAssignSub NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num BinOpMult SubscriptLoad NameLoad ExtSlice Index Num Slice Num AugAssignMult SubscriptStore NameLoad Index Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad ExtSlice Slice Num Slice Num NameLoad orelse Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad keyword Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Num keyword Num keyword Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Num keyword Num keyword Num Assign NameStore TupleLoad TupleLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad TupleLoad BinOpSub NameLoad NameLoad BinOpSub BinOpSub NameLoad NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpAdd NameLoad NameLoad TupleLoad BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpSub BinOpAdd UnaryOpUSub NameLoad NameLoad NameLoad BinOpAdd NameLoad NameLoad TupleLoad BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpAdd BinOpSub UnaryOpUSub NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index Call AttributeLoad NameLoad attr NameLoad AugAssignDiv NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call NameLoad NameLoad If NameLoad body AugAssignMult NameStore NameLoad AugAssignMult NameStore NameLoad AugAssignMult SubscriptStore NameLoad ExtSlice Slice Num Slice Num Call AttributeLoad NameLoad attr BinOpDiv Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad ExtSlice Slice Num Index Num UnaryOpUSub NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str TryExcept body Assign TupleStore NameStore NameStore NameStore NameStore SubscriptLoad NameLoad Index NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign TupleStore NameStore NameStore NameStore NameStore NameLoad Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpAdd NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpAdd BinOpSub NameLoad NameLoad Num If NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad If NameLoad body Assign TupleStore NameStore NameStore NameStore TupleLoad UnaryOpUSub NameLoad UnaryOpUSub NameLoad UnaryOpUSub NameLoad Assign TupleStore NameStore NameStore NameStore TupleLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore TupleLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore TupleLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Assign TupleStore NameStore NameStore TupleLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num If NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpAdd BinOpMult UnaryOpUSub NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpSub BinOpMult UnaryOpUSub NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult UnaryOpUSub NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpAdd BinOpMult NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpSub BinOpMult NameLoad NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpSub BinOpMult NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpAdd BinOpMult NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpAdd BinOpMult NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpSub BinOpMult NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad UnaryOpUSub NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str TryExcept body Assign TupleStore NameStore NameStore NameStore NameStore SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign TupleStore NameStore NameStore NameStore NameStore NameLoad Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpAdd NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad ExtSlice Slice Num Slice Num If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpMult SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad BinOpMult SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad If CompareGt NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad UnaryOpUSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore Num orelse Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpMult SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad BinOpMult SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad If CompareGt NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr UnaryOpUSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad NameLoad Assign NameStore Num If NameLoad body Assign TupleStore NameStore NameStore NameStore TupleLoad UnaryOpUSub NameLoad UnaryOpUSub NameLoad UnaryOpUSub NameLoad If NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str Return Call NameLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str TryExcept body Assign TupleStore NameStore NameStore NameStore NameStore SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr handlers ExceptHandler type TupleLoad NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign TupleStore NameStore NameStore NameStore NameStore NameLoad Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpAdd NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpAdd BinOpSub NameLoad NameLoad Num If NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad If NameLoad body Assign NameStore UnaryOpUSub NameLoad AugAssignDiv NameStore Num AugAssignDiv NameStore Num AugAssignDiv NameStore Num 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 BinOpMult NameLoad NameLoad Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num keyword AttributeLoad NameLoad attr If NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpMult NameLoad BinOpAdd NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpMult NameLoad BinOpAdd NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpMult NameLoad BinOpSub NameLoad NameLoad Assign SubscriptStore NameLoad Index Num BinOpMult NameLoad BinOpSub NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad BinOpSub BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpSub BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index Num BinOpAdd BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad If NameLoad body AugAssignMult SubscriptStore NameLoad Index NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Slice Num SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad NameLoad If CompareGt NameLoad NameLoad body AugAssignMult NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpDiv NameLoad Num NameLoad Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr BinOpDiv NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareLt NameLoad NameLoad body Return Call AttributeLoad NameLoad attr Num AugAssignMult NameStore Call AttributeLoad NameLoad attr BinOpDiv Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call AttributeLoad NameLoad attr TupleLoad TupleLoad BinOpSub BinOpSub Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num BinOpAdd SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Num TupleLoad BinOpAdd SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num BinOpSub BinOpSub Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Num TupleLoad BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num BinOpAdd SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num BinOpSub BinOpSub Num SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Num TupleLoad Num Num Num Num keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num keyword AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad ExtSlice Slice Num Slice Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt NameLoad SubscriptLoad NameLoad Index TupleLoad Num Num body Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Assign SubscriptStore NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Assign SubscriptStore NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num orelse Assign TupleStore NameStore NameStore NameStore TupleLoad Num Num Num If CompareGt SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num body Assign TupleStore NameStore NameStore NameStore TupleLoad Num Num Num If CompareGt SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore TupleLoad Num Num Num Assign NameStore BinOpAdd BinOpSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad BinOpAdd SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad Num Num Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad AugAssignMult NameStore BinOpDiv Num Call AttributeLoad NameLoad attr BinOpMult NameLoad SubscriptLoad NameLoad Index TupleLoad Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore NameStore NameLoad Assign TupleStore NameStore NameStore NameStore NameStore NameLoad Return Call AttributeLoad NameLoad attr TupleLoad BinOpAdd BinOpSub BinOpAdd BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpAdd BinOpAdd BinOpAdd BinOpMult UnaryOpUSub NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpAdd BinOpAdd BinOpSub BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpAdd BinOpSub BinOpSub BinOpMult UnaryOpUSub NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad BinOpMult NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr TupleLoad UnaryOpUSub SubscriptLoad NameLoad Index Num UnaryOpUSub SubscriptLoad NameLoad Index Num UnaryOpUSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpDiv Call NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad body Expr Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Num If CompareEq NameLoad Num body Return NameLoad orelse If CompareEq NameLoad Num body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareLt Call NameLoad BinOpSub Call NameLoad NameLoad Num NameLoad body Return NameLoad If BoolOpAnd NameLoad CompareLt NameLoad Num body Assign NameStore UnaryOpUSub NameLoad AugAssignMult NameStore Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad BinOpMult NameLoad AttributeLoad NameLoad attr If CompareLt Call NameLoad NameLoad NameLoad body Return NameLoad Assign NameStore BinOpDiv Num Call AttributeLoad NameLoad attr NameLoad AugAssignMult NameStore BinOpMult Call AttributeLoad NameLoad attr BinOpMult BinOpSub Num NameLoad NameLoad NameLoad AugAssignMult NameStore BinOpMult Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad NameLoad AugAssignAdd NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num orelse Assert CompareEq Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr BinOpSub Num SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore BinOpMult AttributeLoad NameLoad attr Num Assign NameStore BinOpMult NameLoad SubscriptLoad NameLoad Index Num Assign NameStore BinOpMult NameLoad SubscriptLoad NameLoad Index Num Return Call AttributeLoad NameLoad attr TupleLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str Return Call NameLoad Call NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr ListLoad Num Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num Num keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num Num Num keyword AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr TupleLoad Num Num body Assign AttributeStore NameLoad attr Call NameLoad NameLoad orelse If CompareEq AttributeLoad NameLoad attr TupleLoad Num body AugAssignDiv NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad orelse Raise Call NameLoad Str Assign AttributeStore NameLoad attr AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Num SubscriptLoad NameLoad Index Num Assign SubscriptStore AttributeLoad NameLoad attr Index Num SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr ListComp Call NameLoad NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr CompareEq NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeStore NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If CompareLt Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore ListLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd Num NameLoad NameLoad Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpDiv BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num NameLoad BinOpDiv BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num NameLoad Num keyword AttributeLoad NameLoad attr Assign NameStore BinOpAdd BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If CompareGt NameLoad Num body AugAssignDiv NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr BinOpSub Num NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad AugAssignSub NameStore BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareGt NameLoad NameLoad body If CompareLt SubscriptLoad NameLoad Index Num Num body AugAssignMult NameStore Num AugAssignDiv NameStore NameLoad Return NameLoad If CompareEq SubscriptLoad NameLoad Index Num Num body Return Call AttributeLoad NameLoad attr ListLoad Num Num Num keyword AttributeLoad NameLoad attr Return Call NameLoad ListLoad UnaryOpUSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore NameLoad Assign NameStore Num For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad If CompareGt NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Return NameLoad decorator_list Assign NameStore BinOpMult AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Num Assign NameStore ListLoad Num Num Num Num Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num TupleLoad Num Num Num Num Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad If CompareIs NameLoad NameLoad body If CompareEq AttributeLoad NameLoad attr Num body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad AugAssignMult NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad orelse AugAssignMult NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad If CompareEq AttributeLoad NameLoad attr Num body AugAssignDiv NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad orelse If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Slice Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AugAssignDiv NameStore NameLoad If CompareIs NameLoad NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Num For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad AugAssignDiv NameStore SubscriptLoad NameLoad Index TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad AugAssignDiv NameStore SubscriptLoad NameLoad Index TupleLoad Num Num Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Str Str body Expr Str TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad orelse For NameStore Call NameLoad NameLoad body If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr NameLoad body Continue If NameLoad body If CompareIn NameLoad Call NameLoad body Assign SubscriptStore Call NameLoad Index BinOpAdd NameLoad NameLoad SubscriptLoad Call NameLoad Index NameLoad orelse If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Assign SubscriptStore Call NameLoad Index NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list
N/A N/A Homogeneous Transformation Matrices and Quaternions.

A library for calculating 4x4 matrices for translating, rotating, reflecting,
scaling, shearing, projecting, orthogonalizing, and superimposing arrays of
3D homogeneous coordinates as well as for converting between rotation matrices,
Euler angles, and quaternions. Also includes an Arcball control object and
functions to decompose transformation matrices.

:Authors:
  `Christoph Gohlke <http://www.lfd.uci.edu/~gohlke/>`__,
  Laboratory for Fluorescence Dynamics, University of California, Irvine

:Version: 20090418

Requirements
------------

* `Python 2.6 <http://www.python.org>`__
* `Numpy 1.3 <http://numpy.scipy.org>`__
* `transformations.c 20090418 <http://www.lfd.uci.edu/~gohlke/>`__
  (optional implementation of some functions in C)

Notes
-----

Matrices (M) can be inverted using numpy.linalg.inv(M), concatenated using
numpy.dot(M0, M1), or used to transform homogeneous coordinates (v) using
numpy.dot(M, v) for shape (4, \*) "point of arrays", respectively
numpy.dot(v, M.T) for shape (\*, 4) "array of points".

Calculations are carried out with numpy.float64 precision.

This Python implementation is not optimized for speed.

Vector, point, quaternion, and matrix function arguments are expected to be
"array like", i.e. tuple, list, or numpy arrays.

Return types are numpy arrays unless specified otherwise.

Angles are in radians unless specified otherwise.

Quaternions ix+jy+kz+w are represented as [x, y, z, w].

Use the transpose of transformation matrices for OpenGL glMultMatrixd().

A triple of Euler angles can be applied/interpreted in 24 ways, which can
be specified using a 4 character string or encoded 4-tuple:

  *Axes 4-string*: e.g. 'sxyz' or 'ryxy'

  - first character : rotations are applied to 's'tatic or 'r'otating frame
  - remaining characters : successive rotation axis 'x', 'y', or 'z'

  *Axes 4-tuple*: e.g. (0, 0, 0, 0) or (1, 1, 1, 1)

  - inner axis: code of axis ('x':0, 'y':1, 'z':2) of rightmost matrix.
  - parity : even (0) if inner axis 'x' is followed by 'y', 'y' is followed
    by 'z', or 'z' is followed by 'x'. Otherwise odd (1).
  - repetition : first and last axis are same (1) or different (0).
  - frame : rotations are applied to static (0) or rotating (1) frame.

References
----------

(1)  Matrices and transformations. Ronald Goldman.
     In "Graphics Gems I", pp 472-475. Morgan Kaufmann, 1990.
(2)  More matrices and transformations: shear and pseudo-perspective.
     Ronald Goldman. In "Graphics Gems II", pp 320-323. Morgan Kaufmann, 1991.
(3)  Decomposing a matrix into simple transformations. Spencer Thomas.
     In "Graphics Gems II", pp 320-323. Morgan Kaufmann, 1991.
(4)  Recovering the data from the transformation matrix. Ronald Goldman.
     In "Graphics Gems II", pp 324-331. Morgan Kaufmann, 1991.
(5)  Euler angle conversion. Ken Shoemake.
     In "Graphics Gems IV", pp 222-229. Morgan Kaufmann, 1994.
(6)  Arcball rotation control. Ken Shoemake.
     In "Graphics Gems IV", pp 175-192. Morgan Kaufmann, 1994.
(7)  Representing attitude: Euler angles, unit quaternions, and rotation
     vectors. James Diebel. 2006.
(8)  A discussion of the solution for the best rotation to relate two sets
     of vectors. W Kabsch. Acta Cryst. 1978. A34, 827-828.
(9)  Closed-form solution of absolute orientation using unit quaternions.
     BKP Horn. J Opt Soc Am A. 1987. 4(4), 629-642.
(10) Quaternions. Ken Shoemake.
     http://www.sfu.ca/~jwa3/cmpt461/files/quatut.pdf
(11) From quaternion to matrix and back. JMP van Waveren. 2005.
     http://www.intel.com/cd/ids/developer/asmo-na/eng/293748.htm
(12) Uniform random rotations. Ken Shoemake.
     In "Graphics Gems III", pp 124-132. Morgan Kaufmann, 1992.


Examples
--------

>>> alpha, beta, gamma = 0.123, -1.234, 2.345
>>> origin, xaxis, yaxis, zaxis = (0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)
>>> I = identity_matrix()
>>> Rx = rotation_matrix(alpha, xaxis)
>>> Ry = rotation_matrix(beta, yaxis)
>>> Rz = rotation_matrix(gamma, zaxis)
>>> R = concatenate_matrices(Rx, Ry, Rz)
>>> euler = euler_from_matrix(R, 'rxyz')
>>> numpy.allclose([alpha, beta, gamma], euler)
True
>>> Re = euler_matrix(alpha, beta, gamma, 'rxyz')
>>> is_same_transform(R, Re)
True
>>> al, be, ga = euler_from_matrix(Re, 'rxyz')
>>> is_same_transform(Re, euler_matrix(al, be, ga, 'rxyz'))
True
>>> qx = quaternion_about_axis(alpha, xaxis)
>>> qy = quaternion_about_axis(beta, yaxis)
>>> qz = quaternion_about_axis(gamma, zaxis)
>>> q = quaternion_multiply(qx, qy)
>>> q = quaternion_multiply(q, qz)
>>> Rq = quaternion_matrix(q)
>>> is_same_transform(R, Rq)
True
>>> S = scale_matrix(1.23, origin)
>>> T = translation_matrix((1, 2, 3))
>>> Z = shear_matrix(beta, xaxis, origin, zaxis)
>>> R = random_rotation_matrix(numpy.random.rand(3))
>>> M = concatenate_matrices(T, R, Z, S)
>>> scale, shear, angles, trans, persp = decompose_matrix(M)
>>> numpy.allclose(scale, 1.23)
True
>>> numpy.allclose(trans, (1, 2, 3))
True
>>> numpy.allclose(shear, (0, math.tan(beta), 0))
True
>>> is_same_transform(R, euler_matrix(axes='sxyz', *angles))
True
>>> M1 = compose_matrix(scale, shear, angles, trans, persp)
>>> is_same_transform(M, M1)
True

 __future__ division N/A warnings N/A math N/A numpy N/A __docformat__ restructuredtext en identity_matrix N/A N/A N/A N/A N/A Return 4x4 identity/unit matrix.

    >>> I = identity_matrix()
    >>> numpy.allclose(I, numpy.dot(I, I))
    True
    >>> numpy.sum(I), numpy.trace(I)
    (4.0, 4.0)
    >>> numpy.allclose(I, numpy.identity(4, dtype=numpy.float64))
    True

     N/A N/A N/A numpy identity 4 dtype N/A numpy float64 N/A translation_matrix N/A N/A direction N/A N/A N/A Return matrix to translate by direction vector.

    >>> v = numpy.random.random(3) - 0.5
    >>> numpy.allclose(v, translation_matrix(v)[:3, 3])
    True

     N/A M N/A N/A numpy identity 4 N/A N/A M N/A N/A 3 N/A 3 N/A direction N/A 3 N/A M N/A translation_from_matrix N/A N/A matrix N/A N/A N/A Return translation vector from translation matrix.

    >>> v0 = numpy.random.random(3) - 0.5
    >>> v1 = translation_from_matrix(translation_matrix(v0))
    >>> numpy.allclose(v0, v1)
    True

     N/A N/A N/A N/A N/A N/A numpy array matrix copy False N/A N/A 3 N/A 3 copy N/A reflection_matrix N/A N/A point normal N/A N/A N/A Return matrix to mirror at plane defined by point and normal vector.

    >>> v0 = numpy.random.random(4) - 0.5
    >>> v0[3] = 1.0
    >>> v1 = numpy.random.random(3) - 0.5
    >>> R = reflection_matrix(v0, v1)
    >>> numpy.allclose(2., numpy.trace(R))
    True
    >>> numpy.allclose(v0, numpy.dot(R, v0))
    True
    >>> v2 = v0.copy()
    >>> v2[:3] += v1
    >>> v3 = v0.copy()
    >>> v2[:3] -= v1
    >>> numpy.allclose(v2, numpy.dot(R, v3))
    True

     N/A normal N/A unit_vector N/A normal N/A 3 N/A M N/A N/A numpy identity 4 N/A N/A M N/A N/A 3 N/A 3 N/A 2.0 N/A N/A numpy outer normal normal N/A N/A M N/A N/A 3 N/A 3 N/A N/A 2.0 N/A N/A numpy dot N/A point N/A 3 normal normal N/A M N/A reflection_from_matrix N/A N/A matrix N/A N/A N/A Return mirror plane point and normal vector from reflection matrix.

    >>> v0 = numpy.random.random(3) - 0.5
    >>> v1 = numpy.random.random(3) - 0.5
    >>> M0 = reflection_matrix(v0, v1)
    >>> point, normal = reflection_from_matrix(M0)
    >>> M1 = reflection_matrix(point, normal)
    >>> is_same_transform(M0, M1)
    True

     N/A M N/A N/A numpy array matrix dtype N/A numpy float64 copy False N/A N/A l V N/A N/A N/A numpy linalg eig N/A M N/A N/A 3 N/A 3 N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no unit eigenvector corresponding to eigenvalue -1 N/A normal N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A 0 squeeze N/A N/A l V N/A N/A N/A numpy linalg eig M N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no unit eigenvector corresponding to eigenvalue 1 N/A point N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A -1 squeeze N/A point N/A point N/A 3 N/A N/A point normal N/A rotation_matrix N/A N/A angle direction point N/A None N/A N/A Return matrix to rotate about axis defined by point and direction.

    >>> angle = (random.random() - 0.5) * (2*math.pi)
    >>> direc = numpy.random.random(3) - 0.5
    >>> point = numpy.random.random(3) - 0.5
    >>> R0 = rotation_matrix(angle, direc, point)
    >>> R1 = rotation_matrix(angle-2*math.pi, direc, point)
    >>> is_same_transform(R0, R1)
    True
    >>> R0 = rotation_matrix(angle, direc, point)
    >>> R1 = rotation_matrix(-angle, -direc, point)
    >>> is_same_transform(R0, R1)
    True
    >>> I = numpy.identity(4, numpy.float64)
    >>> numpy.allclose(I, rotation_matrix(math.pi*2, direc))
    True
    >>> numpy.allclose(2., numpy.trace(rotation_matrix(math.pi/2,
    ...                                                direc, point)))
    True

     N/A sina N/A N/A math sin angle N/A cosa N/A N/A math cos angle N/A direction N/A unit_vector N/A direction N/A 3 N/A R N/A N/A numpy array N/A N/A cosa 0.0 0.0 N/A 0.0 cosa 0.0 N/A 0.0 0.0 cosa dtype N/A numpy float64 N/A R N/A N/A N/A numpy outer direction direction N/A 1.0 cosa N/A direction sina N/A R N/A N/A numpy array N/A N/A 0.0 N/A N/A direction N/A 2 N/A direction N/A 1 N/A N/A direction N/A 2 0.0 N/A N/A direction N/A 0 N/A N/A N/A direction N/A 1 N/A direction N/A 0 0.0 dtype N/A numpy float64 N/A M N/A N/A numpy identity 4 N/A N/A M N/A N/A 3 N/A 3 R N/A N/A point None N/A N/A point N/A N/A numpy array N/A point N/A 3 dtype N/A numpy float64 copy False N/A N/A M N/A N/A 3 N/A 3 N/A point N/A N/A numpy dot R point N/A M N/A rotation_from_matrix N/A N/A matrix N/A N/A N/A Return rotation angle and axis from rotation matrix.

    >>> angle = (random.random() - 0.5) * (2*math.pi)
    >>> direc = numpy.random.random(3) - 0.5
    >>> point = numpy.random.random(3) - 0.5
    >>> R0 = rotation_matrix(angle, direc, point)
    >>> angle, direc, point = rotation_from_matrix(R0)
    >>> R1 = rotation_matrix(angle, direc, point)
    >>> is_same_transform(R0, R1)
    True

     N/A R N/A N/A numpy array matrix dtype N/A numpy float64 copy False N/A R33 N/A R N/A N/A 3 N/A 3 N/A N/A l W N/A N/A N/A numpy linalg eig N/A R33 T N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no unit eigenvector corresponding to eigenvalue 1 N/A direction N/A N/A N/A N/A numpy real N/A W N/A N/A N/A N/A i N/A -1 squeeze N/A N/A l Q N/A N/A N/A numpy linalg eig R N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no unit eigenvector corresponding to eigenvalue 1 N/A point N/A N/A N/A N/A numpy real N/A Q N/A N/A N/A N/A i N/A -1 squeeze N/A point N/A point N/A 3 N/A cosa N/A N/A N/A N/A numpy trace R33 1.0 2.0 N/A N/A N/A abs N/A direction N/A 2 1e-08 N/A N/A sina N/A N/A N/A R N/A N/A 1 0 N/A N/A N/A cosa 1.0 N/A direction N/A 0 N/A direction N/A 1 N/A direction N/A 2 N/A N/A N/A N/A abs N/A direction N/A 1 1e-08 N/A N/A sina N/A N/A N/A R N/A N/A 0 2 N/A N/A N/A cosa 1.0 N/A direction N/A 0 N/A direction N/A 2 N/A direction N/A 1 N/A N/A sina N/A N/A N/A R N/A N/A 2 1 N/A N/A N/A cosa 1.0 N/A direction N/A 1 N/A direction N/A 2 N/A direction N/A 0 N/A angle N/A N/A math atan2 sina cosa N/A N/A angle direction point N/A scale_matrix N/A N/A factor origin direction N/A None None N/A N/A Return matrix to scale by factor around origin in direction.

    Use factor -1 for point symmetry.

    >>> v = (numpy.random.rand(4, 5) - 0.5) * 20.0
    >>> v[3] = 1.0
    >>> S = scale_matrix(-1.234)
    >>> numpy.allclose(numpy.dot(S, v)[:3], -1.234*v[:3])
    True
    >>> factor = random.random() * 10 - 5
    >>> origin = numpy.random.random(3) - 0.5
    >>> direct = numpy.random.random(3) - 0.5
    >>> S = scale_matrix(factor, origin)
    >>> S = scale_matrix(factor, origin, direct)

     N/A N/A direction None N/A N/A M N/A N/A numpy array N/A N/A factor 0.0 0.0 0.0 N/A 0.0 factor 0.0 0.0 N/A 0.0 0.0 factor 0.0 N/A 0.0 0.0 0.0 1.0 dtype N/A numpy float64 N/A N/A origin None N/A N/A N/A M N/A N/A 3 N/A 3 N/A origin N/A 3 N/A N/A M N/A N/A 3 N/A 3 N/A 1.0 factor N/A N/A direction N/A unit_vector N/A direction N/A 3 N/A factor N/A 1.0 factor N/A M N/A N/A numpy identity 4 N/A N/A M N/A N/A 3 N/A 3 N/A factor N/A N/A numpy outer direction direction N/A N/A origin None N/A N/A N/A M N/A N/A 3 N/A 3 N/A N/A factor N/A N/A numpy dot N/A origin N/A 3 direction direction N/A M N/A scale_from_matrix N/A N/A matrix N/A N/A N/A Return scaling factor, origin and direction from scaling matrix.

    >>> factor = random.random() * 10 - 5
    >>> origin = numpy.random.random(3) - 0.5
    >>> direct = numpy.random.random(3) - 0.5
    >>> S0 = scale_matrix(factor, origin)
    >>> factor, origin, direction = scale_from_matrix(S0)
    >>> S1 = scale_matrix(factor, origin, direction)
    >>> is_same_transform(S0, S1)
    True
    >>> S0 = scale_matrix(factor, origin, direct)
    >>> factor, origin, direction = scale_from_matrix(S0)
    >>> S1 = scale_matrix(factor, origin, direction)
    >>> is_same_transform(S0, S1)
    True

     N/A M N/A N/A numpy array matrix dtype N/A numpy float64 copy False N/A M33 N/A M N/A N/A 3 N/A 3 N/A factor N/A N/A N/A numpy trace M33 2.0 N/A N/A N/A N/A l V N/A N/A N/A numpy linalg eig M33 N/A i N/A N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l factor 1e-08 N/A 0 N/A 0 N/A direction N/A N/A N/A N/A numpy real N/A V N/A N/A N/A i squeeze N/A direction N/A vector_norm direction N/A N/A N/A IndexError N/A N/A factor N/A N/A factor 2.0 3.0 N/A direction None N/A N/A l V N/A N/A N/A numpy linalg eig M N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no eigenvector corresponding to eigenvalue 1 N/A origin N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A -1 squeeze N/A origin N/A origin N/A 3 N/A N/A factor origin direction N/A projection_matrix N/A N/A point normal direction perspective pseudo N/A None None False N/A N/A Return matrix to project onto plane defined by point and normal.

    Using either perspective point, projection direction, or none of both.

    If pseudo is True, perspective projections will preserve relative depth
    such that Perspective = dot(Orthogonal, PseudoPerspective).

    >>> P = projection_matrix((0, 0, 0), (1, 0, 0))
    >>> numpy.allclose(P[1:, 1:], numpy.identity(4)[1:, 1:])
    True
    >>> point = numpy.random.random(3) - 0.5
    >>> normal = numpy.random.random(3) - 0.5
    >>> direct = numpy.random.random(3) - 0.5
    >>> persp = numpy.random.random(3) - 0.5
    >>> P0 = projection_matrix(point, normal)
    >>> P1 = projection_matrix(point, normal, direction=direct)
    >>> P2 = projection_matrix(point, normal, perspective=persp)
    >>> P3 = projection_matrix(point, normal, perspective=persp, pseudo=True)
    >>> is_same_transform(P2, numpy.dot(P0, P3))
    True
    >>> P = projection_matrix((3, 0, 0), (1, 1, 0), (1, 0, 0))
    >>> v0 = (numpy.random.rand(4, 5) - 0.5) * 20.0
    >>> v0[3] = 1.0
    >>> v1 = numpy.dot(P, v0)
    >>> numpy.allclose(v1[1], v0[1])
    True
    >>> numpy.allclose(v1[0], 3.0-v1[1])
    True

     N/A M N/A N/A numpy identity 4 N/A point N/A N/A numpy array N/A point N/A 3 dtype N/A numpy float64 copy False N/A normal N/A unit_vector N/A normal N/A 3 N/A N/A perspective None N/A N/A perspective N/A N/A numpy array N/A perspective N/A 3 dtype N/A numpy float64 copy False N/A N/A M N/A N/A 0 0 N/A M N/A N/A 1 1 N/A M N/A N/A 2 2 N/A N/A numpy dot N/A perspective point normal N/A N/A M N/A N/A 3 N/A 3 N/A N/A numpy outer perspective normal N/A pseudo N/A N/A N/A M N/A N/A 3 N/A 3 N/A N/A numpy outer normal normal N/A N/A M N/A N/A 3 N/A 3 N/A N/A N/A numpy dot point normal N/A perspective normal N/A N/A N/A M N/A N/A 3 N/A 3 N/A N/A N/A numpy dot point normal perspective N/A N/A M N/A N/A 3 N/A 3 N/A normal N/A N/A M N/A N/A 3 3 N/A N/A numpy dot perspective normal N/A N/A N/A direction None N/A N/A direction N/A N/A numpy array N/A direction N/A 3 dtype N/A numpy float64 copy False N/A scale N/A N/A numpy dot direction normal N/A N/A M N/A N/A 3 N/A 3 N/A N/A N/A numpy outer direction normal scale N/A N/A M N/A N/A 3 N/A 3 N/A direction N/A N/A N/A numpy dot point normal scale N/A N/A N/A M N/A N/A 3 N/A 3 N/A N/A numpy outer normal normal N/A N/A M N/A N/A 3 N/A 3 N/A N/A N/A numpy dot point normal normal N/A M N/A projection_from_matrix N/A N/A matrix pseudo N/A False N/A N/A Return projection plane and perspective point from projection matrix.

    Return values are same as arguments for projection_matrix function:
    point, normal, direction, perspective, and pseudo.

    >>> point = numpy.random.random(3) - 0.5
    >>> normal = numpy.random.random(3) - 0.5
    >>> direct = numpy.random.random(3) - 0.5
    >>> persp = numpy.random.random(3) - 0.5
    >>> P0 = projection_matrix(point, normal)
    >>> result = projection_from_matrix(P0)
    >>> P1 = projection_matrix(*result)
    >>> is_same_transform(P0, P1)
    True
    >>> P0 = projection_matrix(point, normal, direct)
    >>> result = projection_from_matrix(P0)
    >>> P1 = projection_matrix(*result)
    >>> is_same_transform(P0, P1)
    True
    >>> P0 = projection_matrix(point, normal, perspective=persp, pseudo=False)
    >>> result = projection_from_matrix(P0, pseudo=False)
    >>> P1 = projection_matrix(*result)
    >>> is_same_transform(P0, P1)
    True
    >>> P0 = projection_matrix(point, normal, perspective=persp, pseudo=True)
    >>> result = projection_from_matrix(P0, pseudo=True)
    >>> P1 = projection_matrix(*result)
    >>> is_same_transform(P0, P1)
    True

     N/A M N/A N/A numpy array matrix dtype N/A numpy float64 copy False N/A M33 N/A M N/A N/A 3 N/A 3 N/A N/A l V N/A N/A N/A numpy linalg eig M N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 1e-08 N/A 0 N/A N/A N/A pseudo N/A len i N/A N/A point N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A -1 squeeze N/A point N/A point N/A 3 N/A N/A l V N/A N/A N/A numpy linalg eig M33 N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A numpy real l 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no eigenvector corresponding to eigenvalue 0 N/A direction N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A 0 squeeze N/A direction N/A vector_norm direction N/A N/A l V N/A N/A N/A numpy linalg eig N/A M33 T N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A numpy real l 1e-08 N/A 0 N/A N/A len i N/A N/A normal N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A 0 squeeze N/A normal N/A vector_norm normal N/A N/A point normal direction None False N/A N/A N/A point direction None None False N/A N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A numpy real l 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no eigenvector not corresponding to eigenvalue 0 N/A point N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A -1 squeeze N/A point N/A point N/A 3 N/A normal N/A N/A M N/A N/A 3 N/A 3 N/A perspective N/A N/A M N/A N/A 3 N/A 3 N/A N/A numpy dot N/A point N/A 3 normal N/A pseudo N/A N/A perspective normal N/A N/A point normal None perspective pseudo N/A clip_matrix N/A N/A left right bottom top near far perspective N/A False N/A N/A Return matrix to obtain normalized device coordinates from frustrum.

    The frustrum bounds are axis-aligned along x (left, right),
    y (bottom, top) and z (near, far).

    Normalized device coordinates are in range [-1, 1] if coordinates are
    inside the frustrum.

    If perspective is True the frustrum is a truncated pyramid with the
    perspective point at origin and direction along z axis, otherwise an
    orthographic canonical view volume (a box).

    Homogeneous coordinates transformed by the perspective clip matrix
    need to be dehomogenized (devided by w coordinate).

    >>> frustrum = numpy.random.rand(6)
    >>> frustrum[1] += frustrum[0]
    >>> frustrum[3] += frustrum[2]
    >>> frustrum[5] += frustrum[4]
    >>> M = clip_matrix(*frustrum, perspective=False)
    >>> numpy.dot(M, [frustrum[0], frustrum[2], frustrum[4], 1.0])
    array([-1., -1., -1.,  1.])
    >>> numpy.dot(M, [frustrum[1], frustrum[3], frustrum[5], 1.0])
    array([ 1.,  1.,  1.,  1.])
    >>> M = clip_matrix(*frustrum, perspective=True)
    >>> v = numpy.dot(M, [frustrum[0], frustrum[2], frustrum[4], 1.0])
    >>> v / v[3]
    array([-1., -1., -1.,  1.])
    >>> v = numpy.dot(M, [frustrum[1], frustrum[3], frustrum[4], 1.0])
    >>> v / v[3]
    array([ 1.,  1., -1.,  1.])

     N/A N/A N/A left right N/A bottom top N/A near far N/A N/A N/A ValueError invalid frustrum N/A perspective N/A N/A N/A near _EPS N/A N/A N/A ValueError invalid frustrum: near <= 0 N/A t N/A 2.0 near N/A M N/A N/A N/A N/A t N/A right left 0.0 N/A N/A right left N/A right left 0.0 N/A 0.0 N/A N/A t N/A top bottom N/A N/A top bottom N/A top bottom 0.0 N/A 0.0 0.0 N/A N/A N/A far near N/A far near N/A N/A t far N/A far near N/A 0.0 0.0 -1.0 0.0 N/A N/A M N/A N/A N/A 2.0 N/A right left 0.0 0.0 N/A N/A right left N/A left right N/A 0.0 N/A 2.0 N/A top bottom 0.0 N/A N/A top bottom N/A bottom top N/A 0.0 0.0 N/A 2.0 N/A far near N/A N/A far near N/A near far N/A 0.0 0.0 0.0 1.0 N/A N/A N/A numpy array M dtype N/A numpy float64 N/A shear_matrix N/A N/A angle direction point normal N/A N/A N/A Return matrix to shear by angle along direction vector on shear plane.

    The shear plane is defined by a point and normal vector. The direction
    vector must be orthogonal to the plane's normal vector.

    A point P is transformed by the shear matrix into P" such that
    the vector P-P" is parallel to the direction vector and its extent is
    given by the angle of P-P'-P", where P' is the orthogonal projection
    of P onto the shear plane.

    >>> angle = (random.random() - 0.5) * 4*math.pi
    >>> direct = numpy.random.random(3) - 0.5
    >>> point = numpy.random.random(3) - 0.5
    >>> normal = numpy.cross(direct, numpy.random.random(3))
    >>> S = shear_matrix(angle, direct, point, normal)
    >>> numpy.allclose(1.0, numpy.linalg.det(S))
    True

     N/A normal N/A unit_vector N/A normal N/A 3 N/A direction N/A unit_vector N/A direction N/A 3 N/A N/A N/A abs N/A N/A numpy dot normal direction 1e-06 N/A N/A N/A ValueError direction and normal vectors are not orthogonal N/A angle N/A N/A math tan angle N/A M N/A N/A numpy identity 4 N/A N/A M N/A N/A 3 N/A 3 N/A angle N/A N/A numpy outer direction normal N/A N/A M N/A N/A 3 N/A 3 N/A N/A N/A angle N/A N/A numpy dot N/A point N/A 3 normal direction N/A M N/A shear_from_matrix N/A N/A matrix N/A N/A N/A Return shear angle, direction and plane from shear matrix.

    >>> angle = (random.random() - 0.5) * 4*math.pi
    >>> direct = numpy.random.random(3) - 0.5
    >>> point = numpy.random.random(3) - 0.5
    >>> normal = numpy.cross(direct, numpy.random.random(3))
    >>> S0 = shear_matrix(angle, direct, point, normal)
    >>> angle, direct, point, normal = shear_from_matrix(S0)
    >>> S1 = shear_matrix(angle, direct, point, normal)
    >>> is_same_transform(S0, S1)
    True

     N/A M N/A N/A numpy array matrix dtype N/A numpy float64 copy False N/A M33 N/A M N/A N/A 3 N/A 3 N/A N/A l V N/A N/A N/A numpy linalg eig M33 N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 0.0001 N/A 0 N/A N/A N/A len i 2 N/A N/A N/A ValueError N/A No two linear independent eigenvectors found %s l N/A V N/A N/A N/A N/A N/A numpy real N/A V N/A N/A N/A i squeeze T N/A lenorm -1.0 N/A N/A i0 i1 N/A N/A 0 1 N/A 0 2 N/A 1 2 N/A N/A n N/A N/A numpy cross N/A V N/A i0 N/A V N/A i1 N/A l N/A vector_norm n N/A N/A l lenorm N/A N/A lenorm l N/A normal n N/A normal lenorm N/A direction N/A N/A numpy dot N/A M33 N/A N/A numpy identity 3 normal N/A angle N/A vector_norm direction N/A direction angle N/A angle N/A N/A math atan angle N/A N/A l V N/A N/A N/A numpy linalg eig M N/A i N/A N/A N/A numpy where N/A N/A abs N/A N/A N/A numpy real l 1.0 1e-08 N/A 0 N/A N/A N/A len i N/A N/A N/A ValueError no eigenvector corresponding to eigenvalue 1 N/A point N/A N/A N/A N/A numpy real N/A V N/A N/A N/A N/A i N/A -1 squeeze N/A point N/A point N/A 3 N/A N/A angle direction point normal N/A decompose_matrix N/A N/A matrix N/A N/A N/A Return sequence of transformations from transformation matrix.

    matrix : array_like
        Non-degenerative homogeneous transformation matrix

    Return tuple of:
        scale : vector of 3 scaling factors
        shear : list of shear factors for x-y, x-z, y-z axes
        angles : list of Euler angles about static x, y, z axes
        translate : translation vector along x, y, z axes
        perspective : perspective partition of matrix

    Raise ValueError if matrix is of wrong type or degenerative.

    >>> T0 = translation_matrix((1, 2, 3))
    >>> scale, shear, angles, trans, persp = decompose_matrix(T0)
    >>> T1 = translation_matrix(trans)
    >>> numpy.allclose(T0, T1)
    True
    >>> S = scale_matrix(0.123)
    >>> scale, shear, angles, trans, persp = decompose_matrix(S)
    >>> scale[0]
    0.123
    >>> R0 = euler_matrix(1, 2, 3)
    >>> scale, shear, angles, trans, persp = decompose_matrix(R0)
    >>> R1 = euler_matrix(*angles)
    >>> numpy.allclose(R0, R1)
    True

     N/A M N/A N/A N/A numpy array matrix dtype N/A numpy float64 copy True T N/A N/A N/A abs N/A M N/A N/A 3 3 _EPS N/A N/A N/A ValueError M[3, 3] is zero N/A M N/A M N/A N/A 3 3 N/A P N/A N/A M copy N/A N/A P N/A N/A N/A 3 N/A 0 0 0 1 N/A N/A N/A N/A N/A numpy linalg det P N/A N/A N/A ValueError Matrix is singular N/A scale N/A N/A numpy zeros N/A 3 dtype N/A numpy float64 N/A shear N/A 0 0 0 N/A angles N/A 0 0 0 N/A N/A any N/A N/A abs N/A M N/A N/A 3 N/A 3 _EPS N/A N/A perspective N/A N/A numpy dot N/A M N/A N/A N/A 3 N/A N/A N/A numpy linalg inv N/A P T N/A N/A M N/A N/A N/A 3 N/A 0 0 0 1 N/A N/A perspective N/A N/A numpy array N/A 0 0 0 1 dtype N/A numpy float64 N/A translate N/A N/A N/A M N/A N/A 3 N/A 3 copy N/A N/A M N/A N/A 3 N/A 3 0 N/A row N/A N/A N/A M N/A N/A 3 N/A 3 copy N/A N/A scale N/A 0 N/A vector_norm N/A row N/A 0 N/A N/A row N/A 0 N/A scale N/A 0 N/A N/A shear N/A 0 N/A N/A numpy dot N/A row N/A 0 N/A row N/A 1 N/A N/A row N/A 1 N/A N/A row N/A 0 N/A shear N/A 0 N/A N/A scale N/A 1 N/A vector_norm N/A row N/A 1 N/A N/A row N/A 1 N/A scale N/A 1 N/A N/A shear N/A 0 N/A scale N/A 1 N/A N/A shear N/A 1 N/A N/A numpy dot N/A row N/A 0 N/A row N/A 2 N/A N/A row N/A 2 N/A N/A row N/A 0 N/A shear N/A 1 N/A N/A shear N/A 2 N/A N/A numpy dot N/A row N/A 1 N/A row N/A 2 N/A N/A row N/A 2 N/A N/A row N/A 1 N/A shear N/A 2 N/A N/A scale N/A 2 N/A vector_norm N/A row N/A 2 N/A N/A row N/A 2 N/A scale N/A 2 N/A N/A shear N/A 1 N/A scale N/A 2 N/A N/A N/A N/A numpy dot N/A row N/A 0 N/A N/A numpy cross N/A row N/A 1 N/A row N/A 2 0 N/A N/A scale -1 N/A row -1 N/A N/A angles N/A 1 N/A N/A math asin N/A N/A row N/A N/A 0 2 N/A N/A N/A math cos N/A angles N/A 1 N/A N/A N/A angles N/A 0 N/A N/A math atan2 N/A row N/A N/A 1 2 N/A row N/A N/A 2 2 N/A N/A angles N/A 2 N/A N/A math atan2 N/A row N/A N/A 0 1 N/A row N/A N/A 0 0 N/A N/A N/A angles N/A 0 N/A N/A math atan2 N/A N/A row N/A N/A 2 1 N/A row N/A N/A 1 1 N/A N/A angles N/A 2 0.0 N/A N/A scale shear angles translate perspective N/A compose_matrix N/A N/A scale shear angles translate perspective N/A None None None None None N/A N/A Return transformation matrix from sequence of transformations.

    This is the inverse of the decompose_matrix function.

    Sequence of transformations:
        scale : vector of 3 scaling factors
        shear : list of shear factors for x-y, x-z, y-z axes
        angles : list of Euler angles about static x, y, z axes
        translate : translation vector along x, y, z axes
        perspective : perspective partition of matrix

    >>> scale = numpy.random.random(3) - 0.5
    >>> shear = numpy.random.random(3) - 0.5
    >>> angles = (numpy.random.random(3) - 0.5) * (2*math.pi)
    >>> trans = numpy.random.random(3) - 0.5
    >>> persp = numpy.random.random(4) - 0.5
    >>> M0 = compose_matrix(scale, shear, angles, trans, persp)
    >>> result = decompose_matrix(M0)
    >>> M1 = compose_matrix(*result)
    >>> is_same_transform(M0, M1)
    True

     N/A M N/A N/A numpy identity 4 N/A N/A perspective None N/A N/A P N/A N/A numpy identity 4 N/A N/A P N/A N/A 3 N/A N/A perspective N/A 4 N/A M N/A N/A numpy dot M P N/A N/A translate None N/A N/A T N/A N/A numpy identity 4 N/A N/A T N/A N/A 3 N/A 3 N/A translate N/A 3 N/A M N/A N/A numpy dot M T N/A N/A angles None N/A N/A R N/A euler_matrix N/A angles N/A 0 N/A angles N/A 1 N/A angles N/A 2 sxyz N/A M N/A N/A numpy dot M R N/A N/A shear None N/A N/A Z N/A N/A numpy identity 4 N/A N/A Z N/A N/A 1 2 N/A shear N/A 2 N/A N/A Z N/A N/A 0 2 N/A shear N/A 1 N/A N/A Z N/A N/A 0 1 N/A shear N/A 0 N/A M N/A N/A numpy dot M Z N/A N/A scale None N/A N/A S N/A N/A numpy identity 4 N/A N/A S N/A N/A 0 0 N/A scale N/A 0 N/A N/A S N/A N/A 1 1 N/A scale N/A 1 N/A N/A S N/A N/A 2 2 N/A scale N/A 2 N/A M N/A N/A numpy dot M S N/A M N/A M N/A N/A 3 3 N/A M N/A orthogonalization_matrix N/A N/A lengths angles N/A N/A N/A Return orthogonalization matrix for crystallographic cell coordinates.

    Angles are expected in degrees.

    The de-orthogonalization matrix is the inverse.

    >>> O = orthogonalization_matrix((10., 10., 10.), (90., 90., 90.))
    >>> numpy.allclose(O[:3, :3], numpy.identity(3, float) * 10)
    True
    >>> O = orthogonalization_matrix([9.8, 12.0, 15.5], [87.2, 80.7, 69.7])
    >>> numpy.allclose(numpy.sum(O), 43.063229)
    True

     N/A N/A a b c lengths N/A angles N/A N/A numpy radians angles N/A N/A sina sinb _ N/A N/A numpy sin angles N/A N/A cosa cosb cosg N/A N/A numpy cos angles N/A co N/A N/A N/A cosa cosb cosg N/A sina sinb N/A N/A N/A numpy array N/A N/A N/A N/A a sinb N/A N/A math sqrt N/A 1.0 N/A co co 0.0 0.0 0.0 N/A N/A N/A N/A a sinb co N/A b sina 0.0 0.0 N/A N/A a cosb N/A b cosa c 0.0 N/A 0.0 0.0 0.0 1.0 dtype N/A numpy float64 N/A superimposition_matrix N/A N/A v0 v1 scaling usesvd N/A False True N/A N/A Return matrix to transform given vector set into second vector set.

    v0 and v1 are shape (3, \*) or (4, \*) arrays of at least 3 vectors.

    If usesvd is True, the weighted sum of squared deviations (RMSD) is
    minimized according to the algorithm by W. Kabsch [8]. Otherwise the
    quaternion based algorithm by B. Horn [9] is used (slower when using
    this Python implementation).

    The returned matrix performs rotation, translation and uniform scaling
    (if specified).

    >>> v0 = numpy.random.rand(3, 10)
    >>> M = superimposition_matrix(v0, v0)
    >>> numpy.allclose(M, numpy.identity(4))
    True
    >>> R = random_rotation_matrix(numpy.random.random(3))
    >>> v0 = ((1,0,0), (0,1,0), (0,0,1), (1,1,1))
    >>> v1 = numpy.dot(R, v0)
    >>> M = superimposition_matrix(v0, v1)
    >>> numpy.allclose(v1, numpy.dot(M, v0))
    True
    >>> v0 = (numpy.random.rand(4, 100) - 0.5) * 20.0
    >>> v0[3] = 1.0
    >>> v1 = numpy.dot(R, v0)
    >>> M = superimposition_matrix(v0, v1)
    >>> numpy.allclose(v1, numpy.dot(M, v0))
    True
    >>> S = scale_matrix(random.random())
    >>> T = translation_matrix(numpy.random.random(3)-0.5)
    >>> M = concatenate_matrices(T, R, S)
    >>> v1 = numpy.dot(M, v0)
    >>> v0[:3] += numpy.random.normal(0.0, 1e-9, 300).reshape(3, -1)
    >>> M = superimposition_matrix(v0, v1, scaling=True)
    >>> numpy.allclose(v1, numpy.dot(M, v0))
    True
    >>> M = superimposition_matrix(v0, v1, scaling=True, usesvd=False)
    >>> numpy.allclose(v1, numpy.dot(M, v0))
    True
    >>> v = numpy.empty((4, 100, 3), dtype=numpy.float64)
    >>> v[:, :, 0] = v0
    >>> M = superimposition_matrix(v0, v1, scaling=True, usesvd=False)
    >>> numpy.allclose(v1, numpy.dot(M, v[:, :, 0]))
    True

     N/A v0 N/A N/A N/A numpy array v0 dtype N/A numpy float64 copy False N/A 3 N/A v1 N/A N/A N/A numpy array v1 dtype N/A numpy float64 copy False N/A 3 N/A N/A N/A N/A v0 shape N/A v1 shape N/A N/A N/A v0 shape N/A 1 3 N/A N/A N/A ValueError Vector sets are of wrong shape or type. N/A t0 N/A N/A numpy mean v0 axis 1 N/A t1 N/A N/A numpy mean v1 axis 1 N/A v0 N/A v0 N/A N/A t0 reshape 3 1 N/A v1 N/A v1 N/A N/A t1 reshape 3 1 N/A usesvd N/A N/A N/A u s vh N/A N/A N/A numpy linalg svd N/A N/A numpy dot v1 N/A v0 T N/A R N/A N/A numpy dot u vh N/A N/A N/A N/A N/A numpy linalg det R 0.0 N/A N/A R N/A N/A numpy outer N/A u N/A N/A N/A 2 N/A N/A vh N/A N/A 2 N/A 2.0 N/A N/A s N/A -1 -1.0 N/A M N/A N/A numpy identity 4 N/A N/A M N/A N/A 3 N/A 3 R N/A N/A N/A xx yy zz N/A N/A numpy sum N/A v0 v1 axis 1 N/A N/A xy yz zx N/A N/A numpy sum N/A v0 N/A N/A numpy roll v1 -1 axis 0 axis 1 N/A N/A xz yx zy N/A N/A numpy sum N/A v0 N/A N/A numpy roll v1 -2 axis 0 axis 1 N/A N N/A N/A N/A N/A xx yy zz N/A yz zy N/A zx xz N/A xy yx N/A N/A yz zy N/A N/A xx yy zz N/A xy yx N/A zx xz N/A N/A zx xz N/A xy yx N/A N/A N/A xx yy zz N/A yz zy N/A N/A xy yx N/A zx xz N/A yz zy N/A N/A N/A xx yy zz N/A N/A l V N/A N/A N/A numpy linalg eig N N/A q N/A V N/A N/A N/A N/A N/A numpy argmax l N/A q N/A vector_norm q N/A q N/A N/A numpy roll q -1 N/A M N/A quaternion_matrix q N/A scaling N/A N/A v0 v0 N/A v1 v1 N/A N/A M N/A N/A 3 N/A 3 N/A N/A math sqrt N/A N/A N/A numpy sum v1 N/A N/A numpy sum v0 N/A N/A M N/A N/A 3 N/A 3 t1 N/A T N/A N/A numpy identity 4 N/A N/A T N/A N/A 3 N/A 3 N/A t0 N/A M N/A N/A numpy dot M T N/A M N/A euler_matrix N/A N/A ai aj ak axes N/A sxyz N/A N/A Return homogeneous rotation matrix from Euler angles and axis sequence.

    ai, aj, ak : Euler's roll, pitch and yaw angles
    axes : One of 24 axis sequences as string or encoded tuple

    >>> R = euler_matrix(1, 2, 3, 'syxz')
    >>> numpy.allclose(numpy.sum(R[0]), -1.34786452)
    True
    >>> R = euler_matrix(1, 2, 3, (0, 1, 0, 1))
    >>> numpy.allclose(numpy.sum(R[0]), -0.383436184)
    True
    >>> ai, aj, ak = (4.0*math.pi) * (numpy.random.random(3) - 0.5)
    >>> for axes in _AXES2TUPLE.keys():
    ...    R = euler_matrix(ai, aj, ak, axes)
    >>> for axes in _TUPLE2AXES.keys():
    ...    R = euler_matrix(ai, aj, ak, axes)

     N/A N/A N/A N/A firstaxis parity repetition frame N/A _AXES2TUPLE N/A axes N/A N/A N/A N/A AttributeError KeyError N/A N/A _ N/A _TUPLE2AXES N/A axes N/A N/A firstaxis parity repetition frame axes N/A i firstaxis N/A j N/A _NEXT_AXIS N/A N/A i parity N/A k N/A _NEXT_AXIS N/A N/A N/A i parity 1 N/A frame N/A N/A N/A ai ak N/A ak ai N/A parity N/A N/A N/A ai aj ak N/A N/A ai N/A aj N/A ak N/A N/A si sj sk N/A N/A N/A math sin ai N/A N/A math sin aj N/A N/A math sin ak N/A N/A ci cj ck N/A N/A N/A math cos ai N/A N/A math cos aj N/A N/A math cos ak N/A N/A cc cs N/A N/A ci ck N/A ci sk N/A N/A sc ss N/A N/A si ck N/A si sk N/A M N/A N/A numpy identity 4 N/A repetition N/A N/A N/A M N/A N/A i i cj N/A N/A M N/A N/A i j N/A sj si N/A N/A M N/A N/A i k N/A sj ci N/A N/A M N/A N/A j i N/A sj sk N/A N/A M N/A N/A j j N/A N/A N/A cj ss cc N/A N/A M N/A N/A j k N/A N/A N/A cj cs sc N/A N/A M N/A N/A k i N/A N/A sj ck N/A N/A M N/A N/A k j N/A N/A cj sc cs N/A N/A M N/A N/A k k N/A N/A cj cc ss N/A N/A N/A M N/A N/A i i N/A cj ck N/A N/A M N/A N/A i j N/A N/A sj sc cs N/A N/A M N/A N/A i k N/A N/A sj cc ss N/A N/A M N/A N/A j i N/A cj sk N/A N/A M N/A N/A j j N/A N/A sj ss cc N/A N/A M N/A N/A j k N/A N/A sj cs sc N/A N/A M N/A N/A k i N/A sj N/A N/A M N/A N/A k j N/A cj si N/A N/A M N/A N/A k k N/A cj ci N/A M N/A euler_from_matrix N/A N/A matrix axes N/A sxyz N/A N/A Return Euler angles from rotation matrix for specified axis sequence.

    axes : One of 24 axis sequences as string or encoded tuple

    Note that many Euler angle triplets can describe one matrix.

    >>> R0 = euler_matrix(1, 2, 3, 'syxz')
    >>> al, be, ga = euler_from_matrix(R0, 'syxz')
    >>> R1 = euler_matrix(al, be, ga, 'syxz')
    >>> numpy.allclose(R0, R1)
    True
    >>> angles = (4.0*math.pi) * (numpy.random.random(3) - 0.5)
    >>> for axes in _AXES2TUPLE.keys():
    ...    R0 = euler_matrix(axes=axes, *angles)
    ...    R1 = euler_matrix(axes=axes, *euler_from_matrix(R0, axes))
    ...    if not numpy.allclose(R0, R1): print(axes, "failed")

     N/A N/A N/A N/A firstaxis parity repetition frame N/A _AXES2TUPLE N/A N/A N/A axes lower N/A N/A N/A N/A AttributeError KeyError N/A N/A _ N/A _TUPLE2AXES N/A axes N/A N/A firstaxis parity repetition frame axes N/A i firstaxis N/A j N/A _NEXT_AXIS N/A N/A i parity N/A k N/A _NEXT_AXIS N/A N/A N/A i parity 1 N/A M N/A N/A N/A numpy array matrix dtype N/A numpy float64 copy False N/A N/A 3 N/A 3 N/A repetition N/A N/A sy N/A N/A math sqrt N/A N/A N/A M N/A N/A i j N/A M N/A N/A i j N/A N/A M N/A N/A i k N/A M N/A N/A i k N/A N/A sy _EPS N/A N/A ax N/A N/A math atan2 N/A M N/A N/A i j N/A M N/A N/A i k N/A ay N/A N/A math atan2 sy N/A M N/A N/A i i N/A az N/A N/A math atan2 N/A M N/A N/A j i N/A N/A M N/A N/A k i N/A N/A ax N/A N/A math atan2 N/A N/A M N/A N/A j k N/A M N/A N/A j j N/A ay N/A N/A math atan2 sy N/A M N/A N/A i i N/A az 0.0 N/A N/A cy N/A N/A math sqrt N/A N/A N/A M N/A N/A i i N/A M N/A N/A i i N/A N/A M N/A N/A j i N/A M N/A N/A j i N/A N/A cy _EPS N/A N/A ax N/A N/A math atan2 N/A M N/A N/A k j N/A M N/A N/A k k N/A ay N/A N/A math atan2 N/A N/A M N/A N/A k i cy N/A az N/A N/A math atan2 N/A M N/A N/A j i N/A M N/A N/A i i N/A N/A ax N/A N/A math atan2 N/A N/A M N/A N/A j k N/A M N/A N/A j j N/A ay N/A N/A math atan2 N/A N/A M N/A N/A k i cy N/A az 0.0 N/A parity N/A N/A N/A ax ay az N/A N/A ax N/A ay N/A az N/A frame N/A N/A N/A ax az N/A az ax N/A N/A ax ay az N/A euler_from_quaternion N/A N/A quaternion axes N/A sxyz N/A N/A Return Euler angles from quaternion for specified axis sequence.

    >>> angles = euler_from_quaternion([0.06146124, 0, 0, 0.99810947])
    >>> numpy.allclose(angles, [0.123, 0, 0])
    True

     N/A N/A euler_from_matrix N/A quaternion_matrix quaternion axes N/A quaternion_from_euler N/A N/A ai aj ak axes N/A sxyz N/A N/A Return quaternion from Euler angles and axis sequence.

    ai, aj, ak : Euler's roll, pitch and yaw angles
    axes : One of 24 axis sequences as string or encoded tuple

    >>> q = quaternion_from_euler(1, 2, 3, 'ryxz')
    >>> numpy.allclose(q, [0.310622, -0.718287, 0.444435, 0.435953])
    True

     N/A N/A N/A N/A firstaxis parity repetition frame N/A _AXES2TUPLE N/A N/A N/A axes lower N/A N/A N/A N/A AttributeError KeyError N/A N/A _ N/A _TUPLE2AXES N/A axes N/A N/A firstaxis parity repetition frame axes N/A i firstaxis N/A j N/A _NEXT_AXIS N/A N/A i parity N/A k N/A _NEXT_AXIS N/A N/A N/A i parity 1 N/A frame N/A N/A N/A ai ak N/A ak ai N/A parity N/A N/A aj N/A aj N/A ai 2.0 N/A aj 2.0 N/A ak 2.0 N/A ci N/A N/A math cos ai N/A si N/A N/A math sin ai N/A cj N/A N/A math cos aj N/A sj N/A N/A math sin aj N/A ck N/A N/A math cos ak N/A sk N/A N/A math sin ak N/A cc N/A ci ck N/A cs N/A ci sk N/A sc N/A si ck N/A ss N/A si sk N/A quaternion N/A N/A numpy empty N/A 4 dtype N/A numpy float64 N/A repetition N/A N/A N/A quaternion N/A i N/A cj N/A cs sc N/A N/A quaternion N/A j N/A sj N/A cc ss N/A N/A quaternion N/A k N/A sj N/A cs sc N/A N/A quaternion N/A 3 N/A cj N/A cc ss N/A N/A N/A quaternion N/A i N/A N/A cj sc N/A sj cs N/A N/A quaternion N/A j N/A N/A cj ss N/A sj cc N/A N/A quaternion N/A k N/A N/A cj cs N/A sj sc N/A N/A quaternion N/A 3 N/A N/A cj cc N/A sj ss N/A parity N/A N/A N/A quaternion N/A j -1 N/A quaternion N/A quaternion_about_axis N/A N/A angle axis N/A N/A N/A Return quaternion for rotation about axis.

    >>> q = quaternion_about_axis(0.123, (1, 0, 0))
    >>> numpy.allclose(q, [0.06146124, 0, 0, 0.99810947])
    True

     N/A quaternion N/A N/A numpy zeros N/A 4 dtype N/A numpy float64 N/A N/A quaternion N/A 3 N/A axis N/A 3 N/A qlen N/A vector_norm quaternion N/A N/A qlen _EPS N/A N/A quaternion N/A N/A N/A math sin N/A angle 2.0 qlen N/A N/A quaternion N/A 3 N/A N/A math cos N/A angle 2.0 N/A quaternion N/A quaternion_matrix N/A N/A quaternion N/A N/A N/A Return homogeneous rotation matrix from quaternion.

    >>> R = quaternion_matrix([0.06146124, 0, 0, 0.99810947])
    >>> numpy.allclose(R, rotation_matrix(0.123, (1, 0, 0)))
    True

     N/A q N/A N/A numpy array N/A quaternion N/A 4 dtype N/A numpy float64 copy True N/A nq N/A N/A numpy dot q q N/A N/A nq _EPS N/A N/A N/A N/A numpy identity 4 N/A q N/A N/A math sqrt N/A 2.0 nq N/A q N/A N/A numpy outer q q N/A N/A N/A numpy array N/A N/A N/A N/A 1.0 N/A q N/A N/A 1 1 N/A q N/A N/A 2 2 N/A N/A q N/A N/A 0 1 N/A q N/A N/A 2 3 N/A N/A q N/A N/A 0 2 N/A q N/A N/A 1 3 0.0 N/A N/A N/A q N/A N/A 0 1 N/A q N/A N/A 2 3 N/A N/A 1.0 N/A q N/A N/A 0 0 N/A q N/A N/A 2 2 N/A N/A q N/A N/A 1 2 N/A q N/A N/A 0 3 0.0 N/A N/A N/A q N/A N/A 0 2 N/A q N/A N/A 1 3 N/A N/A q N/A N/A 1 2 N/A q N/A N/A 0 3 N/A N/A 1.0 N/A q N/A N/A 0 0 N/A q N/A N/A 1 1 0.0 N/A 0.0 0.0 0.0 1.0 dtype N/A numpy float64 N/A quaternion_from_matrix N/A N/A matrix N/A N/A N/A Return quaternion from rotation matrix.

    >>> R = rotation_matrix(0.123, (1, 2, 3))
    >>> q = quaternion_from_matrix(R)
    >>> numpy.allclose(q, [0.0164262, 0.0328524, 0.0492786, 0.9981095])
    True

     N/A q N/A N/A numpy empty N/A 4 dtype N/A numpy float64 N/A M N/A N/A N/A numpy array matrix dtype N/A numpy float64 copy False N/A N/A 4 N/A 4 N/A t N/A N/A numpy trace M N/A N/A t N/A M N/A N/A 3 3 N/A N/A N/A q N/A 3 t N/A N/A q N/A 2 N/A N/A M N/A N/A 1 0 N/A M N/A N/A 0 1 N/A N/A q N/A 1 N/A N/A M N/A N/A 0 2 N/A M N/A N/A 2 0 N/A N/A q N/A 0 N/A N/A M N/A N/A 2 1 N/A M N/A N/A 1 2 N/A N/A N/A i j k N/A 0 1 2 N/A N/A N/A M N/A N/A 1 1 N/A M N/A N/A 0 0 N/A N/A N/A i j k N/A 1 2 0 N/A N/A N/A M N/A N/A 2 2 N/A M N/A N/A i i N/A N/A N/A i j k N/A 2 0 1 N/A t N/A N/A N/A M N/A N/A i i N/A N/A M N/A N/A j j N/A M N/A N/A k k N/A M N/A N/A 3 3 N/A N/A q N/A i t N/A N/A q N/A j N/A N/A M N/A N/A i j N/A M N/A N/A j i N/A N/A q N/A k N/A N/A M N/A N/A k i N/A M N/A N/A i k N/A N/A q N/A 3 N/A N/A M N/A N/A k j N/A M N/A N/A j k N/A q N/A 0.5 N/A N/A math sqrt N/A t N/A M N/A N/A 3 3 N/A q N/A quaternion_multiply N/A N/A quaternion1 quaternion0 N/A N/A N/A Return multiplication of two quaternions.

    >>> q = quaternion_multiply([1, -2, 3, 4], [-5, 6, 7, 8])
    >>> numpy.allclose(q, [-44, -14, 48, 28])
    True

     N/A N/A x0 y0 z0 w0 quaternion0 N/A N/A x1 y1 z1 w1 quaternion1 N/A N/A N/A numpy array N/A N/A N/A N/A N/A x1 w0 N/A y1 z0 N/A z1 y0 N/A w1 x0 N/A N/A N/A N/A N/A x1 z0 N/A y1 w0 N/A z1 x0 N/A w1 y0 N/A N/A N/A N/A x1 y0 N/A y1 x0 N/A z1 w0 N/A w1 z0 N/A N/A N/A N/A N/A x1 x0 N/A y1 y0 N/A z1 z0 N/A w1 w0 dtype N/A numpy float64 N/A quaternion_conjugate N/A N/A quaternion N/A N/A N/A Return conjugate of quaternion.

    >>> q0 = random_quaternion()
    >>> q1 = quaternion_conjugate(q0)
    >>> q1[3] == q0[3] and all(q1[:3] == -q0[:3])
    True

     N/A N/A N/A numpy array N/A N/A N/A quaternion N/A 0 N/A N/A quaternion N/A 1 N/A N/A quaternion N/A 2 N/A quaternion N/A 3 dtype N/A numpy float64 N/A quaternion_inverse N/A N/A quaternion N/A N/A N/A Return inverse of quaternion.

    >>> q0 = random_quaternion()
    >>> q1 = quaternion_inverse(q0)
    >>> numpy.allclose(quaternion_multiply(q0, q1), [0, 0, 0, 1])
    True

     N/A N/A N/A quaternion_conjugate quaternion N/A N/A numpy dot quaternion quaternion N/A quaternion_slerp N/A N/A quat0 quat1 fraction spin shortestpath N/A 0 True N/A N/A Return spherical linear interpolation between two quaternions.

    >>> q0 = random_quaternion()
    >>> q1 = random_quaternion()
    >>> q = quaternion_slerp(q0, q1, 0.0)
    >>> numpy.allclose(q, q0)
    True
    >>> q = quaternion_slerp(q0, q1, 1.0, 1)
    >>> numpy.allclose(q, q1)
    True
    >>> q = quaternion_slerp(q0, q1, 0.5)
    >>> angle = math.acos(numpy.dot(q0, q))
    >>> numpy.allclose(2.0, math.acos(numpy.dot(q0, q1)) / angle) or         numpy.allclose(2.0, math.acos(-numpy.dot(q0, q1)) / angle)
    True

     N/A q0 N/A unit_vector N/A quat0 N/A 4 N/A q1 N/A unit_vector N/A quat1 N/A 4 N/A N/A fraction 0.0 N/A N/A q0 N/A N/A N/A fraction 1.0 N/A N/A q1 N/A d N/A N/A numpy dot q0 q1 N/A N/A N/A abs N/A N/A abs d 1.0 _EPS N/A N/A q0 N/A N/A shortestpath N/A d 0.0 N/A N/A d N/A d N/A q1 -1.0 N/A angle N/A N/A N/A math acos d N/A spin N/A math pi N/A N/A N/A abs angle _EPS N/A N/A q0 N/A isin N/A 1.0 N/A N/A math sin angle N/A q0 N/A N/A N/A math sin N/A N/A 1.0 fraction angle isin N/A q1 N/A N/A N/A math sin N/A fraction angle isin N/A q0 q1 N/A q0 N/A random_quaternion N/A N/A rand N/A None N/A N/A Return uniform random unit quaternion.

    rand: array like or None
        Three independent random variables that are uniformly distributed
        between 0 and 1.

    >>> q = random_quaternion()
    >>> numpy.allclose(1.0, vector_norm(q))
    True
    >>> q = random_quaternion(numpy.random.random(3))
    >>> q.shape
    (4,)

     N/A N/A rand None N/A N/A rand N/A N/A N/A numpy random rand 3 N/A N/A N/A N/A len rand 3 N/A r1 N/A N/A numpy sqrt N/A 1.0 N/A rand N/A 0 N/A r2 N/A N/A numpy sqrt N/A rand N/A 0 N/A pi2 N/A N/A math pi 2.0 N/A t1 N/A pi2 N/A rand N/A 1 N/A t2 N/A pi2 N/A rand N/A 2 N/A N/A N/A numpy array N/A N/A N/A N/A numpy sin t1 r1 N/A N/A N/A numpy cos t1 r1 N/A N/A N/A numpy sin t2 r2 N/A N/A N/A numpy cos t2 r2 dtype N/A numpy float64 N/A random_rotation_matrix N/A N/A rand N/A None N/A N/A Return uniform random rotation matrix.

    rnd: array like
        Three independent random variables that are uniformly distributed
        between 0 and 1 for each returned quaternion.

    >>> R = random_rotation_matrix()
    >>> numpy.allclose(numpy.dot(R.T, R), numpy.identity(4))
    True

     N/A N/A quaternion_matrix N/A random_quaternion rand N/A Arcball N/A object N/A N/A Virtual Trackball Control.

    >>> ball = Arcball()
    >>> ball = Arcball(initial=numpy.identity(4))
    >>> ball.place([320, 320], 320)
    >>> ball.down([500, 250])
    >>> ball.drag([475, 275])
    >>> R = ball.matrix()
    >>> numpy.allclose(numpy.sum(R), 3.90583455)
    True
    >>> ball = Arcball(initial=[0, 0, 0, 1])
    >>> ball.place([320, 320], 320)
    >>> ball.setaxes([1,1,0], [-1, 1, 0])
    >>> ball.setconstrain(True)
    >>> ball.down([400, 200])
    >>> ball.drag([200, 400])
    >>> R = ball.matrix()
    >>> numpy.allclose(numpy.sum(R), 0.2055924)
    True
    >>> ball.next()

     __init__ N/A N/A self initial N/A None N/A N/A Initialize virtual trackball control.

        initial : quaternion or rotation matrix

         N/A N/A self _axis None N/A N/A self _axes None N/A N/A self _radius 1.0 N/A N/A self _center N/A 0.0 0.0 N/A N/A self _vdown N/A N/A numpy array N/A 0 0 1 dtype N/A numpy float64 N/A N/A self _constrain False N/A N/A initial None N/A N/A N/A self _qdown N/A N/A numpy array N/A 0 0 0 1 dtype N/A numpy float64 N/A N/A initial N/A N/A numpy array initial dtype N/A numpy float64 N/A N/A N/A initial shape N/A 4 4 N/A N/A N/A self _qdown N/A quaternion_from_matrix initial N/A N/A N/A N/A initial shape N/A 4 N/A N/A initial N/A vector_norm initial N/A N/A self _qdown initial N/A N/A N/A ValueError initial not a quaternion or matrix. N/A N/A self _qnow N/A self _qpre N/A self _qdown N/A place N/A N/A self center radius N/A N/A N/A Place Arcball, e.g. when window size changes.

        center : sequence[2]
            Window coordinates of trackball center.
        radius : float
            Radius of trackball in window coordinates.

         N/A N/A self _radius N/A float radius N/A N/A N/A self _center N/A 0 N/A center N/A 0 N/A N/A N/A self _center N/A 1 N/A center N/A 1 N/A setaxes N/A N/A self N/A axes N/A N/A Set axes to constrain rotations. N/A N/A axes None N/A N/A N/A self _axes None N/A N/A N/A self _axes N/A N/A unit_vector axis N/A axis axes N/A setconstrain N/A N/A self constrain N/A N/A N/A Set state of constrain to axis mode. N/A N/A self _constrain N/A constrain True N/A getconstrain N/A N/A self N/A N/A N/A Return state of constrain to axis mode. N/A N/A self _constrain N/A down N/A N/A self point N/A N/A N/A Set initial cursor window coordinates and pick constrain-axis. N/A N/A self _vdown N/A arcball_map_to_sphere point N/A self _center N/A self _radius N/A N/A self _qdown N/A self _qpre N/A self _qnow N/A N/A N/A self _constrain N/A N/A self _axes None N/A N/A N/A self _axis N/A arcball_nearest_axis N/A self _vdown N/A self _axes N/A N/A self _vdown N/A arcball_constrain_to_axis N/A self _vdown N/A self _axis N/A N/A N/A self _axis None N/A drag N/A N/A self point N/A N/A N/A Update current cursor window coordinates. N/A vnow N/A arcball_map_to_sphere point N/A self _center N/A self _radius N/A N/A N/A self _axis None N/A N/A vnow N/A arcball_constrain_to_axis vnow N/A self _axis N/A N/A self _qpre N/A self _qnow N/A t N/A N/A numpy cross N/A self _vdown vnow N/A N/A N/A N/A numpy dot t t _EPS N/A N/A N/A self _qnow N/A self _qdown N/A N/A q N/A N/A t N/A 0 N/A t N/A 1 N/A t N/A 2 N/A N/A numpy dot N/A self _vdown vnow N/A N/A self _qnow N/A quaternion_multiply q N/A self _qdown N/A next N/A N/A self acceleration N/A 0.0 N/A N/A Continue rotation in direction of last drag. N/A q N/A quaternion_slerp N/A self _qpre N/A self _qnow N/A 2.0 acceleration False N/A N/A N/A self _qpre N/A self _qnow N/A N/A self _qnow q N/A matrix N/A N/A self N/A N/A N/A Return homogeneous rotation matrix. N/A N/A quaternion_matrix N/A self _qnow N/A N/A arcball_map_to_sphere N/A N/A point center radius N/A N/A N/A Return unit sphere coordinates from window coordinates. N/A v N/A N/A numpy array N/A N/A N/A N/A point N/A 0 N/A center N/A 0 radius N/A N/A N/A center N/A 1 N/A point N/A 1 radius 0.0 dtype N/A numpy float64 N/A n N/A N/A N/A v N/A 0 N/A v N/A 0 N/A N/A v N/A 1 N/A v N/A 1 N/A N/A n 1.0 N/A N/A v N/A N/A math sqrt n N/A N/A N/A v N/A 2 N/A N/A math sqrt N/A 1.0 n N/A v N/A arcball_constrain_to_axis N/A N/A point axis N/A N/A N/A Return sphere point perpendicular to axis. N/A v N/A N/A numpy array point dtype N/A numpy float64 copy True N/A a N/A N/A numpy array axis dtype N/A numpy float64 copy True N/A v N/A a N/A N/A numpy dot a v N/A n N/A vector_norm v N/A N/A n _EPS N/A N/A N/A N/A v N/A 2 0.0 N/A N/A v -1.0 N/A v n N/A v N/A N/A N/A a N/A 2 1.0 N/A N/A N/A N/A numpy array N/A 1 0 0 dtype N/A numpy float64 N/A N/A unit_vector N/A N/A N/A a N/A 1 N/A a N/A 0 0 N/A arcball_nearest_axis N/A N/A point axes N/A N/A N/A Return axis, which arc is nearest to point. N/A point N/A N/A numpy array point dtype N/A numpy float64 copy False N/A nearest None N/A mx -1.0 N/A axis axes N/A N/A t N/A N/A numpy dot N/A arcball_constrain_to_axis point axis point N/A N/A t mx N/A N/A nearest axis N/A mx t N/A nearest N/A N/A _EPS N/A N/A N/A N/A numpy finfo float eps 4.0 N/A _NEXT_AXIS N/A 1 2 0 1 N/A _AXES2TUPLE N/A sxyz sxyx sxzy sxzx syzx syzy syxz syxy szxy szxz szyx szyz rzyx rxyx ryzx rxzx rxzy ryzy rzxy ryxy ryxz rzxz rxyz rzyz N/A 0 0 0 0 N/A 0 0 1 0 N/A 0 1 0 0 N/A 0 1 1 0 N/A 1 0 0 0 N/A 1 0 1 0 N/A 1 1 0 0 N/A 1 1 1 0 N/A 2 0 0 0 N/A 2 0 1 0 N/A 2 1 0 0 N/A 2 1 1 0 N/A 0 0 0 1 N/A 0 0 1 1 N/A 0 1 0 1 N/A 0 1 1 1 N/A 1 0 0 1 N/A 1 0 1 1 N/A 1 1 0 1 N/A 1 1 1 1 N/A 2 0 0 1 N/A 2 0 1 1 N/A 2 1 0 1 N/A 2 1 1 1 N/A _TUPLE2AXES N/A dict N/A N/A v k N/A N/A k v N/A N/A _AXES2TUPLE items vector_norm N/A N/A data axis out N/A None None N/A N/A Return length, i.e. eucledian norm, of ndarray along axis.

    >>> v = numpy.random.random(3)
    >>> n = vector_norm(v)
    >>> numpy.allclose(n, numpy.linalg.norm(v))
    True
    >>> v = numpy.random.rand(6, 5, 3)
    >>> n = vector_norm(v, axis=-1)
    >>> numpy.allclose(n, numpy.sqrt(numpy.sum(v*v, axis=2)))
    True
    >>> n = vector_norm(v, axis=1)
    >>> numpy.allclose(n, numpy.sqrt(numpy.sum(v*v, axis=1)))
    True
    >>> v = numpy.random.rand(5, 4, 3)
    >>> n = numpy.empty((5, 3), dtype=numpy.float64)
    >>> vector_norm(v, axis=1, out=n)
    >>> numpy.allclose(n, numpy.sqrt(numpy.sum(v*v, axis=1)))
    True
    >>> vector_norm([])
    0.0
    >>> vector_norm([1.0])
    1.0

     N/A data N/A N/A numpy array data dtype N/A numpy float64 copy True N/A N/A out None N/A N/A N/A N/A data ndim 1 N/A N/A N/A N/A math sqrt N/A N/A numpy dot data data N/A data data N/A out N/A N/A numpy atleast_1d N/A N/A numpy sum data axis axis N/A N/A N/A numpy sqrt out out N/A out N/A N/A data data N/A N/A N/A numpy sum data axis axis out out N/A N/A N/A numpy sqrt out out N/A unit_vector N/A N/A data axis out N/A None None N/A N/A Return ndarray normalized by length, i.e. eucledian norm, along axis.

    >>> v0 = numpy.random.random(3)
    >>> v1 = unit_vector(v0)
    >>> numpy.allclose(v1, v0 / numpy.linalg.norm(v0))
    True
    >>> v0 = numpy.random.rand(5, 4, 3)
    >>> v1 = unit_vector(v0, axis=-1)
    >>> v2 = v0 / numpy.expand_dims(numpy.sqrt(numpy.sum(v0*v0, axis=2)), 2)
    >>> numpy.allclose(v1, v2)
    True
    >>> v1 = unit_vector(v0, axis=1)
    >>> v2 = v0 / numpy.expand_dims(numpy.sqrt(numpy.sum(v0*v0, axis=1)), 1)
    >>> numpy.allclose(v1, v2)
    True
    >>> v1 = numpy.empty((5, 4, 3), dtype=numpy.float64)
    >>> unit_vector(v0, axis=1, out=v1)
    >>> numpy.allclose(v1, v2)
    True
    >>> list(unit_vector([]))
    []
    >>> list(unit_vector([1.0]))
    [1.0]

     N/A N/A out None N/A N/A data N/A N/A numpy array data dtype N/A numpy float64 copy True N/A N/A N/A data ndim 1 N/A N/A data N/A N/A math sqrt N/A N/A numpy dot data data N/A data N/A N/A N/A out data N/A N/A N/A out N/A N/A N/A numpy array data copy False N/A data out N/A length N/A N/A numpy atleast_1d N/A N/A numpy sum N/A data data axis N/A N/A N/A numpy sqrt length length N/A N/A axis None N/A N/A length N/A N/A numpy expand_dims length axis N/A data length N/A N/A out None N/A N/A data N/A random_vector N/A N/A size N/A N/A N/A Return array of random doubles in the half-open interval [0.0, 1.0).

    >>> v = random_vector(10000)
    >>> numpy.all(v >= 0.0) and numpy.all(v < 1.0)
    True
    >>> v0 = random_vector(10)
    >>> v1 = random_vector(10)
    >>> numpy.any(v0 == v1)
    False

     N/A N/A N/A N/A numpy random random size N/A inverse_matrix N/A N/A matrix N/A N/A N/A Return inverse of square transformation matrix.

    >>> M0 = random_rotation_matrix()
    >>> M1 = inverse_matrix(M0.T)
    >>> numpy.allclose(M1, numpy.linalg.inv(M0.T))
    True
    >>> for size in range(1, 7):
    ...     M0 = numpy.random.rand(size, size)
    ...     M1 = inverse_matrix(M0)
    ...     if not numpy.allclose(M1, numpy.linalg.inv(M0)): print(size)

     N/A N/A N/A N/A numpy linalg inv matrix N/A concatenate_matrices N/A N/A N/A matrices N/A N/A Return concatenation of series of transformation matrices.

    >>> M = numpy.random.rand(16).reshape((4, 4)) - 0.5
    >>> numpy.allclose(M, concatenate_matrices(M))
    True
    >>> numpy.allclose(numpy.dot(M, M.T), concatenate_matrices(M, M.T))
    True

     N/A M N/A N/A numpy identity 4 N/A i matrices N/A N/A M N/A N/A numpy dot M i N/A M N/A is_same_transform N/A N/A matrix0 matrix1 N/A N/A N/A Return True if two matrices perform same transformation.

    >>> is_same_transform(numpy.identity(4), numpy.identity(4))
    True
    >>> is_same_transform(numpy.identity(4), random_rotation_matrix())
    False

     N/A matrix0 N/A N/A numpy array matrix0 dtype N/A numpy float64 copy True N/A matrix0 N/A matrix0 N/A N/A 3 3 N/A matrix1 N/A N/A numpy array matrix1 dtype N/A numpy float64 copy True N/A matrix1 N/A matrix1 N/A N/A 3 3 N/A N/A N/A numpy allclose matrix0 matrix1 N/A _import_module N/A N/A module_name warn prefix ignore N/A True _py_ _ N/A N/A Try import all public attributes from module into global namespace.

    Existing attributes with name clashes are renamed with prefix.
    Attributes starting with underscore are ignored by default.

    Return True on successful import.

     N/A N/A N/A module N/A __import__ module_name N/A N/A N/A ImportError N/A N/A warn N/A N/A N/A N/A warnings warn N/A Failed to import module  module_name N/A N/A attr N/A dir module N/A N/A N/A ignore N/A N/A attr startswith ignore N/A N/A N/A prefix N/A N/A N/A attr N/A globals N/A N/A N/A N/A globals N/A N/A prefix attr N/A N/A globals N/A attr N/A N/A warn N/A N/A N/A N/A warnings warn N/A No Python implementation of  attr N/A N/A N/A globals N/A attr N/A getattr module attr N/A True N/A