Module Expr Str Import alias identifier Import alias identifier Import alias identifier ImportFrom alias Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad Num body Return BinOpMult BinOpMult Num BinOpPow NameLoad Num Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num orelse If CompareEq NameLoad Num body Return UnaryOpUSub NameLoad orelse Raise NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad NameLoad Return BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body Assign NameStore BinOpSub SubscriptLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad ExtSlice Slice Index NameLoad SubscriptLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad ExtSlice Index NameLoad Slice Assign SubscriptStore NameLoad ExtSlice Slice Slice Index NameLoad BinOpSub SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Index NameLoad Call AttributeLoad NameLoad attr Call NameLoad BinOpDiv NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assign NameStore BinOpSub SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Slice SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Slice Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad ExtSlice Slice Slice Index NameLoad BinOpSub SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Index NameLoad Call AttributeLoad NameLoad attr Call NameLoad BinOpDiv SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad NameLoad NameLoad Assign NameStore BinOpMult UnaryOpUSub Call NameLoad BinOpDiv SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad Slice Index NameLoad SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad Index NameLoad Index NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Slice Index NameLoad Slice Assign NameStore BinOpAdd NameLoad Call AttributeLoad NameLoad attr Num Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad BinOpPow NameLoad Num BinOpMult NameLoad NameLoad Assign NameStore BinOpMult SubscriptLoad Call AttributeLoad NameLoad attr NameLoad ExtSlice Index NameLoad Slice Index NameLoad Slice Index NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Slice Index NameLoad Slice Assign NameStore BinOpAdd NameLoad Call AttributeLoad NameLoad attr Num Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr BinOpMult NameLoad BinOpPow NameLoad Num BinOpMult NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpMult NameLoad BinOpPow NameLoad Num NameLoad If NameLoad body Return TupleLoad NameLoad NameLoad NameLoad orelse Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpSub Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign NameStore Call AttributeLoad BinOpMult SubscriptLoad NameLoad ExtSlice Slice Index NameLoad BinOpPow BinOpSub NameLoad NameLoad Num attr Assign NameStore BinOpMult NameLoad Call NameLoad GeneratorExp Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad comprehension NameStore Call NameLoad NameLoad If NameLoad body Return TupleLoad NameLoad NameLoad BinOpAdd NameLoad NameLoad orelse Return BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign NameStore Call AttributeLoad BinOpPow BinOpSub NameLoad NameLoad Num attr Assign NameStore BinOpMult NameLoad Call NameLoad GeneratorExp Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad comprehension NameStore Call NameLoad NameLoad Assign NameStore BinOpMult NameLoad Call AttributeLoad BinOpPow Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Num attr If NameLoad body Return TupleLoad NameLoad NameLoad NameLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad orelse Return BinOpAdd BinOpAdd NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assert CompareEq NameLoad BinOpAdd NameLoad BinOpMult Num NameLoad Assign NameStore BoolOpOr NameLoad Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore BinOpAdd BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign NameStore Call AttributeLoad BinOpPow BinOpSub NameLoad NameLoad Num attr Assign NameStore BinOpMult NameLoad Call NameLoad GeneratorExp Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad comprehension NameStore Call NameLoad NameLoad Assign NameStore BinOpMult NameLoad Call AttributeLoad BinOpPow Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Num attr If NameLoad body Return TupleLoad NameLoad NameLoad NameLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad orelse Return BinOpAdd BinOpAdd NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore IfExp CompareIs NameLoad NameLoad Call NameLoad NameLoad NameLoad Assign NameStore IfExp CompareGt NameLoad Num BinOpDiv NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpAdd BinOpAdd NameLoad NameLoad Num BinOpAdd BinOpAdd NameLoad NameLoad Num Assign SubscriptStore NameLoad ExtSlice Slice NameLoad Slice NameLoad NameLoad AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Index BinOpMult Call AttributeLoad NameLoad attr Num NameLoad BinOpAdd BinOpAdd NameLoad NameLoad Num BinOpDiv NameLoad IfExp CompareIsNot NameLoad NameLoad NameLoad Num Assign SubscriptStore NameLoad ExtSlice Slice NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice NameLoad Index BinOpAdd NameLoad NameLoad Num Assign SubscriptStore NameLoad ExtSlice Slice NameLoad BinOpAdd NameLoad NameLoad Slice NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad ExtSlice Index BinOpAdd NameLoad NameLoad Slice NameLoad Num Assign SubscriptStore NameLoad ExtSlice Slice NameLoad BinOpAdd NameLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpAdd BinOpAdd NameLoad NameLoad Num NameLoad Assign SubscriptStore NameLoad Slice NameLoad NameLoad Assign SubscriptStore NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index BinOpAdd NameLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice NameLoad Slice Assign NameStore SubscriptLoad NameLoad ExtSlice Slice NameLoad BinOpAdd NameLoad NameLoad Slice Assign NameStore SubscriptLoad NameLoad ExtSlice Index BinOpAdd NameLoad NameLoad Slice Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore UnaryOpUSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num NameLoad NameLoad Assign NameStore IfExp Call AttributeLoad NameLoad attr NameLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num BinOpAdd NameLoad Num SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num NameLoad attr Assign NameStore BoolOpOr UnaryOpNot Call AttributeLoad NameLoad attr NameLoad BoolOpAnd CompareGt AttributeLoad NameLoad attr Num CompareGt SubscriptLoad AttributeLoad NameLoad attr Index Num Num If UnaryOpNot NameLoad body Assign NameStore BinOpMult SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Slice BinOpAdd NameLoad Num Slice BinOpAdd NameLoad Num BinOpMult NameLoad NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num BinOpAdd NameLoad Num Slice Num BinOpAdd NameLoad Num Call AttributeLoad NameLoad attr NameLoad Assign NameStore UnaryOpUSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AugAssignSub SubscriptStore NameLoad ExtSlice Slice Num BinOpAdd NameLoad Num Slice Num NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore IfExp Call AttributeLoad NameLoad attr NameLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareEq AttributeLoad NameLoad attr Num body Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index NameLoad If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpAdd BinOpAdd Num NameLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMult SubscriptLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad ExtSlice Slice Index NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Slice BinOpAdd NameLoad Num Slice BinOpAdd NameLoad Num BinOpMult SubscriptLoad NameLoad Index NameLoad NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num BinOpAdd NameLoad Num Slice Num BinOpAdd NameLoad Num Call AttributeLoad NameLoad attr NameLoad Assign NameStore UnaryOpUSub Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad AugAssignSub SubscriptStore NameLoad Index BinOpAdd Num NameLoad SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad Call NameLoad NameLoad NameLoad NameLoad Return TupleLoad SubscriptLoad NameLoad Slice Num BinOpAdd NameLoad Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body If CompareIsNot NameLoad NameLoad body Raise NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num keyword NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Num Assign NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpMult NameLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpMult NameLoad Call AttributeLoad NameLoad attr Num AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpMult NameLoad Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice NameLoad Slice Assign NameStore SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice BinOpAdd NameLoad Num Slice Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num keyword NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Num Assign NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Slice Num UnaryOpUSub Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad If NameLoad body Print Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Str If NameLoad body Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd BinOpAdd BinOpMult NameLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore BinOpAdd BinOpMult NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad BinOpSub NameLoad Num Num Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad BinOpAdd BinOpAdd BinOpMult BinOpMult Num NameLoad Call AttributeLoad NameLoad attr NameLoad BinOpMult Num Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad BinOpMult BinOpMult Num NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore UnaryOpUSub NameLoad Assign NameStore NameLoad For NameStore BinOpPow Num Call AttributeLoad NameLoad attr Num Num Num body Assign NameStore BinOpAdd NameLoad BinOpMult NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If NameLoad body Print BinOpMod Str TupleLoad NameLoad NameLoad If CompareLt NameLoad NameLoad body Assign NameStore NameLoad Break If UnaryOpNot NameLoad body If NameLoad body Print Str Break Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpAdd NameLoad BinOpMult Num NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore BinOpSub BinOpAdd NameLoad BinOpMult Num NameLoad Num Assign NameStore Num Assign NameStore BinOpDiv Num BinOpMult Num Call AttributeLoad NameLoad attr Num Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpMult NameLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Num Num UnaryOpUSub NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpMult NameLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad UnaryOpUAdd Num Num UnaryOpUSub NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpMult NameLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Num Num UnaryOpUAdd NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpMult NameLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Num UnaryOpUAdd Num UnaryOpUAdd NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num keyword Num Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad BinOpMult Num NameLoad NameLoad Assert CompareGtE SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad Assert CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice SubscriptLoad AttributeLoad NameLoad attr Index Num Assert CompareEq AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assert CompareEq NameLoad BinOpAdd NameLoad BinOpMult Num NameLoad Assert CompareEq NameLoad BinOpAdd NameLoad Num Assign NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice NameLoad Slice Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Slice Num UnaryOpUSub Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Assert CompareEq AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assert CompareEq AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad If NameLoad body Print Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Str If NameLoad body Print BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Slice NameLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd BinOpAdd BinOpMult NameLoad NameLoad NameLoad BinOpMult NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore BinOpAdd BinOpMult NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore NameLoad For NameStore BinOpPow Num Call AttributeLoad NameLoad attr Num Num Num body Assign NameStore BinOpAdd NameLoad BinOpMult NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad If NameLoad body Print BinOpMod Str TupleLoad NameLoad NameLoad If CompareLt NameLoad NameLoad body Assign NameStore NameLoad Break If UnaryOpNot NameLoad body If NameLoad body Print Str Break Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIsNot NameLoad NameLoad body Raise NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num keyword NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Slice Num Assign NameStore Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Num Slice Num BinOpMult NameLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Index Num Slice Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Num Slice Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num Num NameLoad NameLoad body Expr Str If CompareIsNot NameLoad NameLoad body Raise NameLoad If CompareIsNot NameLoad NameLoad body Raise NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad Num NameLoad orelse Assign NameStore NameLoad If NameLoad body Print Str NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad BinOpDiv Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpSub NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr NameLoad Assign NameStore Call AttributeLoad BinOpPow BinOpSub NameLoad Call AttributeLoad NameLoad attr keyword Num Num attr keyword Num FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Num Num Assign NameStore BinOpAdd Call NameLoad ListComp BinOpAdd BinOpSub Call AttributeLoad Call AttributeLoad AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr attr NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad BinOpMult Num Call AttributeLoad AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad Num Call NameLoad NameLoad Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword Call NameLoad NameLoad keyword NameLoad keyword NameLoad If UnaryOpNot Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr body Print Str Assign NameStore SubscriptLoad NameLoad Index Num If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad Print Str Assign NameStore Call AttributeLoad NameLoad attr Num Num Assert Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad If NameLoad body Print Str NameLoad Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIsNot NameLoad NameLoad body Raise NameLoad Return BinOpAdd Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Call NameLoad NameLoad decorator_list
N/A N/A 
Functions for fitting and applying thin plate spline transformations
 N/A numpy np N/A scipy.spatial.distance ssd N/A scipy.optimize opt lfd.util colorize N/A VERBOSE False N/A ENABLE_SLOW_TESTS False nan2zero N/A N/A x N/A N/A N/A N/A N/A np putmask x N/A N/A np isnan x 0 N/A x N/A tps_apply_kernel N/A N/A distmat dim N/A N/A N/A 
    if d=2: 
        k(r) = 4 * r^2 log(r)
       d=3:
        k(r) = -r
            
    import numpy as np, scipy.spatial.distance as ssd
    x = np.random.rand(100,2)
    d=ssd.squareform(ssd.pdist(x))
    print np.clip(np.linalg.eigvalsh( 4 * d**2 * log(d+1e-9) ),0,inf).mean()
    print np.clip(np.linalg.eigvalsh(-d),0,inf).mean()
    
    Note the actual coefficients (from http://www.geometrictools.com/Documentation/ThinPlateSplines.pdf)
    d=2: 1/(8*sqrt(pi)) = 0.070523697943469535
    d=3: gamma(-.5)/(16*pi**1.5) = -0.039284682964880184
     N/A N/A dim 2 N/A N/A N/A N/A 4 N/A distmat 2 N/A N/A np log N/A distmat 1e-20 N/A N/A N/A dim 3 N/A N/A N/A distmat N/A N/A NotImplementedError N/A tps_kernel_matrix N/A N/A x_na N/A N/A N/A dim N/A N/A x_na shape N/A 1 N/A distmat N/A N/A ssd squareform N/A N/A ssd pdist x_na N/A N/A tps_apply_kernel distmat dim N/A tps_kernel_matrix2 N/A N/A x_na y_ma N/A N/A N/A dim N/A N/A x_na shape N/A 1 N/A distmat N/A N/A ssd cdist x_na y_ma N/A N/A tps_apply_kernel distmat dim N/A tps_eval N/A N/A x_ma lin_ag trans_g w_ng x_na N/A N/A N/A K_mn N/A tps_kernel_matrix2 x_ma x_na N/A N/A N/A N/A N/A np dot K_mn w_ng N/A N/A np dot x_ma lin_ag N/A trans_g N/A N/A None N/A N/A tps_grad N/A N/A x_ma lin_ag _trans_g w_ng x_na N/A N/A N/A N/A _N D N/A x_na shape N/A M N/A N/A x_ma shape N/A 0 N/A N/A N/A N/A x_ma shape N/A 1 3 N/A dist_mn N/A N/A ssd cdist x_ma x_na euclidean N/A grad_mga N/A N/A np empty N/A M D D N/A lin_ga N/A lin_ag T N/A a N/A xrange D N/A N/A diffa_mn N/A N/A N/A x_ma N/A N/A N/A a N/A N/A N/A None N/A N/A x_na N/A N/A N/A a N/A N/A None N/A N/A N/A grad_mga N/A N/A N/A N/A a N/A N/A lin_ga N/A N/A None N/A N/A a N/A N/A np dot N/A nan2zero N/A diffa_mn dist_mn w_ng N/A grad_mga N/A tps_nr_grad N/A N/A x_ma lin_ag _trans_g w_ng x_na return_tuple N/A False N/A N/A 
    gradient of green's strain
     N/A N/A N D N/A x_na shape N/A M N/A N/A x_ma shape N/A 0 N/A N/A N/A N/A x_ma shape N/A 1 3 N/A dists_mn N/A N/A ssd cdist x_ma x_na euclidean N/A diffs_mna N/A N/A x_ma N/A N/A N/A None N/A N/A x_na N/A N/A None N/A N/A N/A grad_mga N/A N/A np empty N/A M D D N/A lin_ga N/A lin_ag T N/A a N/A xrange D N/A N/A N/A grad_mga N/A N/A N/A N/A a N/A N/A lin_ga N/A N/A None N/A N/A a N/A N/A np dot N/A nan2zero N/A N/A diffs_mna N/A N/A N/A N/A a dists_mn w_ng N/A Jw_mngab N/A N/A N/A nan2zero N/A N/A diffs_mna N/A N/A N/A N/A None N/A N/A None N/A dists_mn N/A N/A N/A N/A None N/A None N/A None N/A grad_mga N/A N/A N/A None N/A N/A None N/A N/A Jw_mngab N/A Jw_mngab N/A N/A Jw_mngab transpose 0 1 2 4 3 N/A Jw_mabng N/A N/A Jw_mngab transpose 0 3 4 1 2 N/A Jw N/A N/A Jw_mabng reshape N/A M N/A D 2 N/A N D N/A Jl_mcgab N/A N/A N/A N/A np eye D N/A N/A None N/A N/A None N/A N/A None N/A grad_mga N/A N/A N/A None N/A N/A None N/A N/A Jl_mcgab N/A Jl_mcgab N/A N/A Jl_mcgab transpose 0 1 2 4 3 N/A Jl_mabcg N/A N/A Jl_mcgab transpose 0 3 4 1 2 N/A Jl N/A N/A Jl_mabcg reshape N/A M N/A D 2 N/A D D N/A Jt N/A N/A np zeros N/A N/A M N/A D 2 D N/A return_tuple N/A N/A N/A Jl Jt Jw N/A N/A J N/A N/A np c_ N/A N/A Jl Jt Jw N/A J N/A tps_nr_err N/A N/A x_ma lin_ag trans_g w_ng x_na N/A N/A N/A 
    green's strain    
     N/A N/A M D N/A x_ma shape N/A grad_mga N/A tps_grad x_ma lin_ag trans_g w_ng x_na N/A err_mab N/A N/A np empty N/A M D D N/A m N/A xrange M N/A N/A N/A err_mab N/A m N/A N/A N/A np dot N/A N/A grad_mga N/A m T N/A grad_mga N/A m N/A N/A np eye D N/A N/A N/A err_mab flatten N/A tps_cost N/A N/A lin_ag trans_g w_ng x_na y_ng bend_coef K_nn return_tuple wt_n N/A None False None N/A N/A 
    XXX doesn't include rotation cost
     N/A D N/A N/A lin_ag shape N/A 0 N/A N/A K_nn None N/A N/A K_nn N/A tps_kernel_matrix x_na N/A N/A wt_n None N/A N/A wt_n N/A N/A np ones N/A len x_na N/A ypred_ng N/A N/A N/A N/A np dot K_nn w_ng N/A N/A np dot x_na lin_ag N/A trans_g N/A N/A None N/A N/A res_cost N/A N/A N/A N/A wt_n N/A N/A N/A None N/A N/A ypred_ng y_ng 2 sum N/A bend_cost N/A bend_coef N/A sum N/A N/A N/A np dot N/A w_ng N/A N/A N/A g N/A N/A np dot K_nn N/A w_ng N/A N/A N/A g N/A g N/A xrange D N/A return_tuple N/A N/A N/A res_cost bend_cost N/A res_cost bend_cost N/A N/A N/A res_cost bend_cost N/A tps_nr_cost_eval N/A N/A lin_ag trans_g w_ng x_na y_ng xnr_ma bend_coef nr_coef K_nn return_tuple N/A None False N/A N/A D N/A N/A lin_ag shape N/A 0 N/A N/A K_nn None N/A N/A K_nn N/A tps_kernel_matrix x_na N/A ypred_ng N/A N/A N/A N/A np dot K_nn w_ng N/A N/A np dot x_na lin_ag N/A trans_g N/A N/A None N/A N/A res_cost N/A N/A N/A N/A ypred_ng y_ng 2 sum N/A bend_cost N/A bend_coef N/A sum N/A N/A N/A np dot N/A w_ng N/A N/A N/A g N/A N/A np dot K_nn N/A w_ng N/A N/A N/A g N/A g N/A xrange D N/A nr_cost N/A nr_coef N/A N/A N/A N/A tps_nr_err xnr_ma lin_ag trans_g w_ng x_na 2 sum N/A return_tuple N/A N/A N/A res_cost bend_cost nr_cost N/A N/A res_cost bend_cost nr_cost N/A N/A N/A N/A res_cost bend_cost nr_cost N/A tps_nr_cost_eval_general N/A N/A lin_ag trans_g w_eg x_ea y_ng nr_ma bend_coef nr_coef K_ee return_tuple N/A None True N/A N/A N/A E D N/A x_ea shape N/A N N/A N/A y_ng shape N/A 0 N/A M N/A N/A nr_ma shape N/A 0 N/A N/A E N/A N N/A 4 M N/A K_ee N/A K_ee N/A tps_kernel_matrix x_ea N/A K_ne N/A K_ee N/A N N/A x_na N/A x_ea N/A N N/A ypred_ng N/A N/A N/A N/A np dot K_ne w_eg N/A N/A np dot x_na lin_ag N/A trans_g N/A N/A None N/A N/A res_cost N/A N/A N/A N/A ypred_ng y_ng 2 sum N/A bend_cost N/A bend_coef N/A sum N/A N/A N/A np dot N/A w_eg N/A N/A N/A g N/A N/A np dot N/A K_ee N/A w_eg N/A N/A N/A g N/A g N/A xrange D N/A nr_cost N/A nr_coef N/A N/A N/A N/A tps_nr_err nr_ma lin_ag trans_g w_eg x_ea 2 sum N/A return_tuple N/A N/A N/A res_cost bend_cost nr_cost N/A N/A res_cost bend_cost nr_cost N/A N/A N/A N/A res_cost bend_cost nr_cost N/A tps_fit N/A N/A x_na y_ng bend_coef rot_coef wt_n K_nn N/A None None N/A N/A N/A N D N/A x_na shape N/A K_nn N/A N/A K_nn None N/A tps_kernel_matrix x_na K_nn N/A coef_ratio N/A N/A rot_coef 0 N/A bend_coef rot_coef 0 N/A A N/A N/A np zeros N/A N/A N/A N D 1 N/A N/A N D 1 N/A N/A A N/A N/A N N/A N K_nn N/A N/A N/A A flat N/A N/A N/A N/A np arange 0 N N/A N/A N D 2 N/A bend_coef N/A N/A wt_n None wt_n 1 N/A N/A A N/A N/A N N/A N N/A N D x_na N/A N/A A N/A N/A N N/A N/A N D 1 N/A N/A A N/A N/A N N/A N D N/A N N/A x_na T N/A N/A A N/A N/A N/A N D N/A N 1 N/A N/A A N/A N/A N N/A N D N/A N N/A N D N/A coef_ratio N/A N/A np eye D N/A B N/A N/A np empty N/A N/A N/A N D 1 D N/A N/A B N/A N y_ng N/A N/A B N/A N N/A N D N/A coef_ratio N/A N/A np eye D N/A N/A B N/A N/A N D 0 N/A X N/A N/A N/A np linalg solve A B N/A w_ng N/A X N/A N/A N N/A N/A lin_ag N/A X N/A N/A N N/A N D N/A N/A trans_g N/A X N/A N/A N/A N D N/A N/A N/A lin_ag trans_g w_ng N/A solve_eqp1 N/A N/A H f A N/A N/A N/A solve equality-constrained qp
    min tr(x'Hx) + sum(f'x)
    s.t. Ax = 0
     N/A n_vars N/A N/A H shape N/A 0 N/A N/A N/A N/A H shape N/A 1 n_vars N/A N/A N/A N/A f shape N/A 0 n_vars N/A N/A N/A N/A A shape N/A 1 n_vars N/A n_cnts N/A N/A A shape N/A 0 N/A N/A _u _s _vh N/A N/A N/A np linalg svd N/A A T N/A N N/A _u N/A N/A N/A n_cnts N/A L N/A N/A N/A N T dot N/A N/A H dot N N/A R N/A N/A N/A N/A N T dot f N/A z N/A N/A N/A np linalg solve L R N/A x N/A N/A N dot z N/A x N/A tps_fit3 N/A N/A x_na y_ng bend_coef rot_coef wt_n N/A N/A N/A N/A wt_n None N/A N/A wt_n N/A N/A np ones N/A len x_na N/A N/A n d N/A x_na shape N/A K_nn N/A tps_kernel_matrix x_na N/A Q N/A N/A np c_ N/A N/A N/A N/A np ones N/A n 1 x_na K_nn N/A rot_coefs N/A N/A N/A np isscalar rot_coef N/A N/A N/A np ones d rot_coef rot_coef N/A A N/A N/A N/A np r_ N/A N/A N/A N/A np zeros N/A N/A d 1 N/A d 1 N/A N/A np c_ N/A N/A N/A N/A np ones N/A n 1 x_na T N/A solve_dim_separately N/A N/A N/A N/A np isscalar bend_coef N/A N/A N/A wt_n ndim 1 N/A N/A N/A wt_n shape N/A 1 1 N/A N/A solve_dim_separately N/A N/A WQ N/A N/A wt_n N/A N/A N/A None Q N/A QWQ N/A N/A N/A Q T dot WQ N/A H QWQ N/A N/A H N/A N/A N/A d 1 N/A N/A d 1 N/A bend_coef K_nn N/A N/A H N/A N/A 1 N/A d 1 N/A 1 N/A d 1 N/A N/A np diag rot_coefs N/A f N/A N/A N/A N/A WQ T dot y_ng N/A N/A f N/A N/A 1 N/A d 1 N/A 0 d N/A N/A np diag rot_coefs N/A Theta N/A solve_eqp1 H f A N/A N/A bend_coefs N/A N/A N/A np isscalar bend_coef N/A N/A N/A np ones d bend_coef bend_coef N/A N/A N/A wt_n ndim 1 N/A N/A wt_n N/A wt_n N/A N/A N/A None N/A N/A N/A N/A wt_n shape N/A 1 1 N/A N/A wt_n N/A N/A np tile wt_n N/A 1 d N/A Theta N/A N/A np empty N/A N/A N/A 1 d n d N/A i N/A range d N/A N/A WQ N/A N/A N/A wt_n N/A N/A N/A i N/A N/A N/A None Q N/A QWQ N/A N/A N/A Q T dot WQ N/A H QWQ N/A N/A H N/A N/A N/A d 1 N/A N/A d 1 N/A N/A bend_coefs N/A i K_nn N/A N/A H N/A N/A 1 N/A d 1 N/A 1 N/A d 1 N/A N/A np diag rot_coefs N/A f N/A N/A N/A N/A WQ T dot N/A y_ng N/A N/A N/A i N/A N/A f N/A N/A 1 i N/A rot_coefs N/A i N/A N/A Theta N/A N/A N/A i N/A solve_eqp1 H f A N/A N/A N/A Theta N/A 1 N/A d 1 N/A Theta N/A 0 N/A Theta N/A N/A d 1 N/A tps_fit2 N/A N/A x_na y_ng bend_coef rot_coef wt_n N/A None N/A N/A N/A wt_n None N/A N/A NotImplementedError N/A N/A N D N/A x_na shape N/A N/A _u _s _vh N/A N/A N/A np linalg svd N/A N/A np c_ N/A N/A x_na N/A N/A np ones N/A N 1 full_matrices True N/A N_nq N/A _u N/A N/A N/A 4 N/A K_nn N/A tps_kernel_matrix x_na N/A Q_nn N/A N/A np c_ N/A N/A x_na N/A N/A np ones N/A N 1 N/A N/A K_nn dot N_nq N/A QQ_nn N/A N/A np dot N/A Q_nn T Q_nn N/A A QQ_nn N/A N/A A N/A N/A 4 N/A 4 N/A bend_coef N/A N/A N/A N/A N/A N_nq T dot K_nn dot N_nq N/A B N/A N/A N/A Q_nn T dot y_ng N/A N/A A N/A N/A 3 N/A 3 N/A rot_coef N/A N/A np eye 3 N/A N/A B N/A N/A 3 N/A 3 N/A rot_coef N/A N/A np eye 3 N/A X N/A N/A N/A np linalg solve A B N/A lin_ag N/A X N/A N/A D N/A N/A trans_g N/A X N/A N/A D N/A N/A w_ng N/A N/A N_nq dot N/A X N/A N/A N/A D 1 N/A N/A N/A lin_ag trans_g w_ng N/A tps_nr_fit N/A N/A x_na y_ng bend_coef nr_ma nr_coef method N/A newton N/A N/A N/A N D N/A x_na shape N/A N/A lin_ag trans_g w_ng N/A tps_fit2 x_na y_ng bend_coef 0.001 N/A N/A _u _s _vh N/A N/A N/A np linalg svd N/A N/A np c_ N/A N/A x_na N/A N/A np ones N/A N 1 full_matrices True N/A N_nq N/A _u N/A N/A N/A 4 N/A K_nn N/A tps_kernel_matrix x_na N/A Q_nn N/A N/A np c_ N/A N/A x_na N/A N/A np ones N/A N 1 N/A N/A K_nn dot N_nq N/A QQ_nn N/A N/A np dot N/A Q_nn T Q_nn N/A Bend_nn N/A N/A np zeros N/A N N N/A N/A Bend_nn N/A N/A 4 N/A 4 N/A N/A N/A N/A N_nq T dot N/A N/A K_nn dot N_nq N/A n_iter 60 N/A i N/A xrange n_iter N/A N/A X_ng N/A N/A np r_ N/A N/A lin_ag N/A trans_g N/A N/A None N/A N/A N/A N/A N_nq T dot w_ng N/A N/A res_cost bend_cost nr_cost fval N/A tps_nr_cost_eval lin_ag trans_g w_ng x_na y_ng nr_ma bend_coef nr_coef return_tuple True N/A VERBOSE N/A N/A N/A colorize N/A iteration %i, cost %.3e N/A i fval red N/A VERBOSE N/A N/A N/A = %.3e (res) + %.3e (bend) + %.3e (nr) N/A res_cost bend_cost nr_cost N/A N/A Jl_zcg Jt_zg Jw_zng N/A tps_nr_grad nr_ma lin_ag trans_g w_ng x_na return_tuple True N/A nrerr_z N/A tps_nr_err nr_ma lin_ag trans_g w_ng x_na N/A N/A method newton N/A N/A fullstep_ng N/A N/A np empty N/A N D N/A g N/A xrange D N/A N/A J_zn N/A N/A np c_ N/A N/A N/A Jl_zcg N/A N/A N/A g D N/A Jt_zg N/A N/A N/A g D N/A N/A N/A Jw_zng N/A N/A N/A g D dot N_nq N/A JJ_nn N/A N/A np dot N/A J_zn T J_zn N/A A N/A N/A N/A nr_coef JJ_nn QQ_nn N/A bend_coef Bend_nn N/A X0 N/A X_ng N/A N/A N/A g N/A B N/A N/A nr_coef N/A N/A np dot N/A J_zn T N/A N/A N/A np dot J_zn X0 nrerr_z N/A N/A N/A Q_nn T dot N/A y_ng N/A N/A N/A g N/A N/A fullstep_ng N/A N/A N/A g N/A N/A N/A N/A np linalg solve A B N/A X_ng N/A N/A N/A g N/A N/A N/A method gradient N/A N/A grad_ng N/A N/A np empty N/A N D N/A g N/A xrange N/A D 1 -1 -1 N/A N/A Jnr_zn N/A N/A np c_ N/A N/A N/A Jl_zcg N/A N/A N/A g D N/A Jt_zg N/A N/A N/A g D N/A N/A N/A Jw_zng N/A N/A N/A g D dot N_nq N/A N/A grad_ng N/A N/A N/A g N/A N/A N/A N/A 2 nr_coef N/A N/A nrerr_z dot Jnr_zn N/A 2 N/A N/A N/A Q_nn T dot N/A N/A N/A Q_nn dot N/A X_ng N/A N/A N/A g N/A y_ng N/A N/A N/A g N/A N/A 2 bend_coef N/A N/A Bend_nn dot N/A X_ng N/A N/A N/A g N/A fullstep_ng N/A grad_ng N/A cost_improved False N/A stepsize N/A 3.0 N/A N/A np arange 0 -10 -1 N/A N/A cand_X_ng N/A X_ng N/A fullstep_ng stepsize N/A N/A cand_lin_ag cand_trans_g cand_w_ng N/A N/A cand_X_ng N/A D N/A cand_X_ng N/A D N/A N/A N_nq dot N/A cand_X_ng N/A N/A D 1 N/A fval_cand N/A tps_nr_cost_eval cand_lin_ag cand_trans_g cand_w_ng x_na y_ng nr_ma bend_coef nr_coef N/A VERBOSE N/A N/A N/A stepsize: %.1g, fval: %.3e N/A stepsize fval_cand N/A N/A fval_cand fval N/A N/A cost_improved True N/A N/A N/A cost_improved N/A N/A VERBOSE N/A N/A couldn't improve objective N/A N/A lin_ag cand_lin_ag N/A trans_g cand_trans_g N/A w_ng cand_w_ng N/A N/A lin_ag trans_g w_ng N/A tps_nr_fit_enhanced N/A N/A x_na y_ng bend_coef nr_ma nr_coef N/A N/A N/A N/A N D N/A x_na shape N/A M N/A N/A nr_ma shape N/A 0 N/A E N/A N N/A 4 M N/A F N/A E M N/A Q N/A N/A N N/A 3 M 4 N/A s 0.1 N/A u N/A 1 N/A 2 N/A N/A np sqrt 2 N/A tetra_pts N/A N/A pt nr_ma N/A N/A N/A N/A tetra_pts append N/A N/A s N/A N/A np r_ N/A N/A -0.5 0 N/A u pt N/A N/A N/A tetra_pts append N/A N/A s N/A N/A np r_ N/A N/A N/A 0.5 0 N/A u pt N/A N/A N/A tetra_pts append N/A N/A s N/A N/A np r_ N/A N/A 0 -0.5 N/A u pt N/A N/A N/A tetra_pts append N/A N/A s N/A N/A np r_ N/A N/A 0 N/A 0.5 N/A u pt N/A x_ea N/A N/A np r_ N/A N/A x_na tetra_pts N/A badsub_ex N/A N/A np c_ N/A N/A x_ea N/A N/A np ones N/A E 1 N/A N/A np r_ N/A N/A N/A N/A np zeros N/A N M N/A N/A np repeat N/A N/A np eye M 4 axis 0 N/A N/A lin_ag trans_g w_ng N/A tps_fit2 x_na y_ng bend_coef 0.001 N/A w_eg N/A N/A np r_ N/A N/A w_ng N/A N/A np zeros N/A N/A 4 M D N/A N/A N/A N/A badsub_ex shape N/A 0 N/A N/A badsub_ex shape N/A 1 N/A N/A _u _s _vh N/A N/A N/A np linalg svd badsub_ex full_matrices True N/A N/A N/A N/A badsub_ex shape N/A 1 N/A _s size N/A N_eq N/A _u N/A N/A N/A N/A N/A badsub_ex shape N/A 1 N/A N/A N/A N_eq shape N/A E Q N/A N/A E N/A N N/A 4 M N/A N/A F N/A Q 4 N/A K_ee N/A tps_kernel_matrix x_ea N/A K_ne N/A K_ee N/A N/A N N/A N/A Q_nf N/A N/A np c_ N/A N/A x_na N/A N/A np ones N/A N 1 N/A N/A K_ne dot N_eq N/A QQ_ff N/A N/A np dot N/A Q_nf T Q_nf N/A Bend_ff N/A N/A np zeros N/A F F N/A N/A Bend_ff N/A N/A 4 N/A 4 N/A N/A N/A N/A N_eq T dot N/A N/A K_ee dot N_eq N/A N/A N/A Q_nf shape N/A N F N/A N/A N/A w_eg shape N/A E D N/A n_iter 40 N/A i N/A xrange n_iter N/A N/A X_fg N/A N/A np r_ N/A N/A lin_ag N/A trans_g N/A N/A None N/A N/A N/A N/A N_eq T dot w_eg N/A N/A res_cost bend_cost nr_cost fval N/A tps_nr_cost_eval_general lin_ag trans_g w_eg x_ea y_ng nr_ma bend_coef nr_coef return_tuple True N/A VERBOSE N/A N/A N/A colorize N/A iteration %i, cost %.3e N/A i fval red N/A VERBOSE N/A N/A N/A = %.3e (res) + %.3e (bend) + %.3e (nr) N/A res_cost bend_cost nr_cost N/A N/A Jl_zcg Jt_zg Jw_zeg N/A tps_nr_grad nr_ma lin_ag trans_g w_eg x_ea return_tuple True N/A nrerr_z N/A tps_nr_err nr_ma lin_ag trans_g w_eg x_ea N/A fullstep_fg N/A N/A np empty N/A F D N/A g N/A xrange D N/A N/A J_zf N/A N/A np c_ N/A N/A N/A Jl_zcg N/A N/A N/A g D N/A Jt_zg N/A N/A N/A g D N/A N/A N/A Jw_zeg N/A N/A N/A g D dot N_eq N/A JJ_ff N/A N/A np dot N/A J_zf T J_zf N/A A_ff N/A N/A N/A nr_coef JJ_ff QQ_ff N/A bend_coef Bend_ff N/A X0 N/A X_fg N/A N/A N/A g N/A B_f N/A N/A nr_coef N/A N/A np dot N/A J_zf T N/A N/A N/A np dot J_zf X0 nrerr_z N/A N/A N/A Q_nf T dot N/A y_ng N/A N/A N/A g N/A N/A fullstep_fg N/A N/A N/A g N/A N/A N/A N/A np linalg solve A_ff B_f N/A X_fg N/A N/A N/A g N/A cost_improved False N/A stepsize N/A 3.0 N/A N/A np arange 0 -10 -1 N/A N/A cand_X_fg N/A X_fg N/A fullstep_fg stepsize N/A N/A cand_lin_ag cand_trans_g cand_w_eg N/A N/A cand_X_fg N/A D N/A cand_X_fg N/A D N/A N/A N_eq dot N/A cand_X_fg N/A N/A D 1 N/A fval_cand N/A tps_nr_cost_eval_general cand_lin_ag cand_trans_g cand_w_eg x_ea y_ng nr_ma bend_coef nr_coef return_tuple False N/A VERBOSE N/A N/A N/A stepsize: %.1g, fval: %.3e N/A stepsize fval_cand N/A N/A fval_cand fval N/A N/A cost_improved True N/A N/A N/A cost_improved N/A N/A VERBOSE N/A N/A couldn't improve objective N/A N/A lin_ag cand_lin_ag N/A trans_g cand_trans_g N/A w_eg cand_w_eg N/A N/A lin_ag trans_g w_eg x_ea N/A tps_fit_fixedrot N/A N/A x_na y_ng bend_coef lin_ag K_nn wt_n N/A None None N/A N/A 
    minimize (Y-KA-XB-1C)'W(Y-KA-XB-1C) + tr(A'KA) + r(B)
     N/A N/A wt_n None N/A N/A NotImplementedError N/A N/A N _D N/A x_na shape N/A N/A _u _s _vh N/A N/A N/A np linalg svd N/A N/A np c_ N/A N/A x_na N/A N/A np ones N/A N 1 full_matrices True N/A N_nq N/A _u N/A N/A N/A 4 N/A K_nn N/A tps_kernel_matrix x_na N/A Q_nn N/A N/A np c_ N/A N/A N/A N/A np ones N/A N 1 N/A N/A K_nn dot N_nq N/A QQ_nn N/A N/A np dot N/A Q_nn T Q_nn N/A A QQ_nn N/A N/A A N/A N/A 1 N/A 1 N/A bend_coef N/A N/A N/A N/A N/A N_nq T dot K_nn dot N_nq N/A B N/A N/A N/A Q_nn T dot N/A y_ng N/A N/A x_na dot lin_ag N/A X N/A N/A N/A np linalg solve A B N/A trans_g N/A X N/A N/A 0 N/A N/A w_ng N/A N/A N_nq dot N/A X N/A N/A 1 N/A N/A N/A trans_g w_ng N/A tps_fit_regrot N/A N/A x_na y_ng bend_coef rfunc wt_n max_iter inner_max_iter rgrad l_init N/A None 1 100 None None N/A N/A 
    minimize (Y-KA-XB-1C)' W (Y-KA-XB-1C) + tr(A'KA) + r(B)
    subject to A'(X 1) = 0
     N/A N/A rgrad None N/A N/A NotImplementedError N/A N/A wt_n None N/A N/A NotImplementedError N/A N/A N _D N/A x_na shape N/A K_nn N/A tps_kernel_matrix x_na N/A N/A l_init None N/A N/A N/A lin_ag trans_g w_ng N/A tps_fit3 x_na y_ng bend_coef 0.01 wt_n N/A N/A lin_ag l_init N/A True N/A N/A initializing rotation with
  lin_ag N/A N/A trans_g w_ng N/A tps_fit_fixedrot x_na y_ng bend_coef lin_ag K_nn wt_n N/A Q_nn N/A N/A N/A np eye N N/A N/A N/A np outer N/A N/A np ones N N/A N/A np ones N N N/A _ N/A xrange max_iter N/A N/A e_ng N/A y_ng N/A N/A K_nn dot w_ng N/A xQe_ag N/A N/A N/A N/A N/A x_na T dot Q_nn dot e_ng N/A xQx_aa N/A N/A N/A N/A N/A x_na T dot Q_nn dot x_na N/A eQe_g N/A N/A N/A N/A e_ng N/A N/A e_ng mean axis 0 2 sum axis 0 f N/A N/A x N/A N/A N/A b_ag N/A N/A x reshape 3 3 N/A out N/A N/A sum N/A N/A N/A N/A N/A N/A N/A N/A N/A b_ag N/A N/A N/A i T dot xQx_aa dot N/A b_ag N/A N/A N/A i N/A 2 N/A N/A N/A N/A b_ag N/A N/A N/A i T dot N/A xQe_ag N/A N/A N/A i N/A eQe_g N/A i N/A i N/A xrange 3 N/A rfunc b_ag N/A out N/A N/A x0 N/A N/A lin_ag flatten N/A N/A soln fopt _ _ _ _ allsolns N/A N/A opt fmin_powell f x0 maxiter inner_max_iter disp N/A bool VERBOSE retall True full_output True N/A N/A N/A N/A N/A N/A np isfinite soln all N/A N/A warning, optimization gave infinite result N/A soln N/A allsolns N/A -2 N/A N/A N/A N/A np isfinite fopt N/A N/A soln lin_ag N/A warning, optimization gave fopt=infinity N/A lin_ag N/A N/A soln reshape 3 3 N/A N/A N/A N/A N/A np isfinite lin_ag all N/A N/A trans_g w_ng N/A tps_fit_fixedrot x_na y_ng bend_coef lin_ag K_nn wt_n N/A VERBOSE N/A N/A rotation result lin_ag N/A N/A lin_ag trans_g w_ng N/A tps_cost_regrot N/A N/A lin_ag trans_g w_ng x_na y_ng bend_coef rfunc K_nn wt_n N/A None None N/A N/A 
    (Y-KA-XB-1C)' W (Y-KA-XB-1C) + tr(A'KA) + r(B)
    subject to A'(X 1) = 0
     N/A N/A wt_n None N/A N/A NotImplementedError N/A N/A N/A tps_cost lin_ag trans_g w_ng x_na y_ng bend_coef K_nn N/A rfunc lin_ag N/A