Module ImportFrom alias ImportFrom alias Import alias identifier Import alias ImportFrom alias ImportFrom alias ClassDef bases body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr ListLoad Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str AugAssignAdd NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str Return NameLoad decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Num Num Num Num Num Num Num Num Num Num Num Num Num Num Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr orelse If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Num For NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore BinOpAdd BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body For NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareIn Str NameLoad body Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr Str For NameStore NameLoad body If CompareIn Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad keyword NameLoad keyword AttributeLoad Call NameLoad BinOpAdd BinOpAdd NameLoad Str NameLoad attr keyword NameLoad keyword ListLoad Assign NameStore BinOpAdd SubscriptLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Slice Num Str Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr keyword AttributeLoad Call NameLoad BinOpAdd BinOpAdd NameLoad Str NameLoad attr AugAssignAdd NameStore Num Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr Expr Str Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Str NameLoad body Expr Str For NameStore AttributeLoad NameLoad attr body Assign NameStore BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr SubscriptLoad Call NameLoad NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num AugAssignDiv NameStore Call NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index NameLoad keyword NameLoad keyword BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index NameLoad keyword NameLoad keyword BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Str If CompareIn NameLoad Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr ListComp TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign AttributeStore NameLoad attr ListComp Call NameLoad keyword NameLoad keyword SubscriptLoad NameLoad Index Num keyword SubscriptLoad NameLoad Index Num keyword SubscriptLoad NameLoad Index Num keyword SubscriptLoad NameLoad Index Num keyword Call AttributeLoad SubscriptLoad NameLoad Index Num attr keyword Call AttributeLoad SubscriptLoad NameLoad Index Num attr comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Assign AttributeStore NameLoad attr Call NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num body Assign NameStore Call AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Str keyword AttributeLoad AttributeLoad NameLoad attr attr If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr keyword SubscriptLoad NameLoad Index Num keyword SubscriptLoad NameLoad Index Num keyword NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr BinOpDiv Call NameLoad BinOpDiv Num AttributeLoad AttributeLoad NameLoad attr attr Num Num If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword Num orelse If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call NameLoad BinOpAdd AttributeLoad AttributeLoad NameLoad attr attr Str Str If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad Num body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore ListLoad If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore ListComp BinOpDiv NameLoad Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore NameLoad If Call NameLoad SubscriptLoad NameLoad Index Num TupleLoad NameLoad AttributeLoad NameLoad attr body For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Num orelse ImportFrom alias Assign NameStore Call NameLoad NameLoad NameLoad Num NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIsNot NameLoad ListLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body Expr Call AttributeLoad NameLoad attr BinOpMult Call NameLoad BinOpMult UnaryOpUSub AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad BinOpMult UnaryOpUSub NameLoad NameLoad orelse If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body If CompareEq SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpMult NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMult BinOpDiv Call NameLoad BinOpMult UnaryOpUSub NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpMult UnaryOpUSub NameLoad NameLoad TryExcept body AugAssignDiv NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Print NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Num orelse ImportFrom alias Assign NameStore Call NameLoad NameLoad NameLoad Num NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Expr Str Expr Call AttributeLoad NameLoad attr BinOpMult Call NameLoad BinOpMult UnaryOpUSub AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad BinOpSub NameLoad SubscriptLoad NameLoad Index NameLoad Call NameLoad BinOpMult UnaryOpUSub NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad BinOpMult UnaryOpUSub NameLoad NameLoad TryExcept body AugAssignDiv NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Print NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Num Str ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num For NameStore AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr Num If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Index Num orelse Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Index Num AugAssignAdd NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad Num keyword Str keyword Dict Str Num Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Return Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If Call NameLoad SubscriptLoad NameLoad Index Num TupleLoad NameLoad AttributeLoad NameLoad attr body For NameStore NameLoad body Assign NameStore CompareGt NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore CompareGt NameLoad AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore ListLoad Assign NameStore ListLoad If Call NameLoad SubscriptLoad NameLoad Index Num TupleLoad NameLoad AttributeLoad NameLoad attr body For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Assign NameStore BinOpMult ListLoad BinOpDiv Num NameLoad NameLoad orelse Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Assign NameStore ListComp BinOpDiv NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr keyword NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr keyword NameLoad orelse If CompareIs NameLoad NameLoad body Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Index Num Assign NameStore BinOpMult ListLoad BinOpDiv Num NameLoad NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore ListComp BinOpDiv NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad keyword NameLoad keyword Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return TupleLoad Call NameLoad keyword NameLoad Call NameLoad keyword NameLoad decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad If CompareEq Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num body Assign AttributeStore NameLoad attr ListComp Call NameLoad keyword NameLoad keyword NameLoad keyword ListLoad comprehension TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num orelse If CompareEq Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num body Assign AttributeStore NameLoad attr ListLoad Call NameLoad keyword Num keyword AttributeLoad NameLoad attr keyword ListLoad Assign AttributeStore NameLoad attr Num If BoolOpAnd CompareIsNot NameLoad NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str If BoolOpAnd CompareIsNot NameLoad NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr orelse Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num If CompareEq AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Num body Expr Call AttributeLoad NameLoad attr keyword Num keyword Str Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str If AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore ListLoad For NameStore NameLoad body If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr keyword Call NameLoad Call NameLoad BinOpDiv Call NameLoad NameLoad Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr keyword Num orelse If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr keyword Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad CompareGt Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Num attr NameLoad Expr Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad CompareGt Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num attr NameLoad Assign NameStore Str Assign NameStore BinOpAdd BinOpAdd BinOpAdd NameLoad Str Call NameLoad NameLoad SubscriptLoad Call NameLoad NameLoad Index Num Expr Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str Expr Call NameLoad AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot NameLoad body Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body If UnaryOpNot AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr For NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Assign NameStore BinOpAdd BinOpAdd BinOpAdd NameLoad Str Call NameLoad NameLoad SubscriptLoad Call NameLoad NameLoad Index Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr keyword NameLoad orelse For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body If CompareEq AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad keyword NameLoad keyword NameLoad keyword Num keyword SubscriptLoad NameLoad Index Num keyword SubscriptLoad NameLoad Index Num keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad keyword NameLoad keyword NameLoad keyword Num keyword SubscriptLoad NameLoad Index Num keyword SubscriptLoad NameLoad Index Num keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str For TupleStore NameStore NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num Num body Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Num Print Call NameLoad BinOpMult NameLoad NameLoad For NameStore Call NameLoad Call NameLoad BinOpMult NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index BinOpSub NameLoad Num attr Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index BinOpAdd NameLoad Num attr Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index BinOpSub NameLoad Num attr Expr Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index BinOpAdd NameLoad Num attr For NameStore Call NameLoad BinOpSub NameLoad BinOpMult Num Call NameLoad BinOpMult NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword Num Assign NameStore Call NameLoad NameLoad keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num Num body Expr Str Expr IfExp CompareIsNot AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad If CompareEq NameLoad Str body For NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr keyword TupleLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Expr IfExp CompareIsNot AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad NameLoad attr keyword TupleLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr ListComp TupleLoad AttributeLoad NameLoad attr SubscriptLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Index AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call NameLoad BinOpAdd NameLoad Str Str If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr orelse If CompareEq AttributeLoad NameLoad attr Num body For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad SubscriptLoad NameLoad Index SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr keyword Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body If CompareLt Call NameLoad NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad orelse Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Str AugAssignAdd NameStore BinOpAdd Str AttributeLoad NameLoad attr For NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body AugAssignAdd NameStore BinOpAdd Str NameLoad If AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body AugAssignAdd NameStore BinOpAdd Str Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr orelse AugAssignAdd NameStore Str If AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body AugAssignAdd NameStore Str Assign NameStore BinOpAdd BinOpAdd SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Str NameLoad Assign NameStore BinOpAdd BinOpAdd SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Str NameLoad If CompareEq Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num body Assign AttributeStore NameLoad attr Call NameLoad keyword Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num attr keyword BinOpAdd NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad keyword Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num attr keyword BinOpAdd NameLoad Str orelse Assign AttributeStore NameLoad attr Call NameLoad keyword Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr keyword BinOpAdd NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad keyword Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr keyword BinOpAdd NameLoad Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Assign NameStore NameLoad Assign NameStore NameLoad If AttributeLoad NameLoad attr body Print Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr Str orelse Assign NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr keyword Str keyword ListLoad ListLoad Str Str keyword Str keyword NameLoad keyword ListLoad Str keyword ListLoad Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword Num Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Str keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword NameLoad keyword Num keyword ListLoad Str Str Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad keyword NameLoad keyword Num If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad Print CompareEq AttributeLoad NameLoad attr Num If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr
N/A msct_pca PCA msct_gmseg_utils * N/A sct_utils sct N/A pickle math sqrt math exp Param N/A N/A __init__ N/A N/A self N/A N/A N/A N/A self debug 0 N/A N/A self path_dictionary None N/A N/A self todo_model None N/A N/A self model_dir ./gm_seg_model_data N/A N/A self reg N/A Affine N/A N/A self reg_metric MI N/A N/A self target_denoising True N/A N/A self first_reg False N/A N/A self use_levels True N/A N/A self weight_gamma 1.2 N/A N/A self equation_id 1 N/A N/A self weight_label_fusion False N/A N/A self mode_weight_similarity False N/A N/A self z_regularisation False N/A N/A self res_type binary N/A N/A self verbose 1 N/A __repr__ N/A N/A self N/A N/A N/A s N/A s N/A N/A path_dictionary:  N/A str N/A self path_dictionary N/A s N/A N/A todo_model:  N/A str N/A self todo_model N/A s N/A N/A model_dir:  N/A str N/A self model_dir N/A s N/A N/A reg:  N/A str N/A self reg N/A s N/A N/A reg_metric:  N/A str N/A self reg_metric N/A s N/A N/A target_denoising:  N/A str N/A self target_denoising  ***WARNING: used in sct_segment_gray_matter not in sct_asman***
 N/A s N/A N/A first_reg:  N/A str N/A self first_reg N/A s N/A N/A use_levels:  N/A str N/A self use_levels N/A s N/A N/A weight_gamma:  N/A str N/A self weight_gamma N/A s N/A N/A equation_id:  N/A str N/A self equation_id N/A s N/A N/A weight_label_fusion:  N/A str N/A self weight_label_fusion N/A s N/A N/A mode_weight_similarity:  N/A str N/A self mode_weight_similarity N/A s N/A N/A z_regularisation:  N/A str N/A self z_regularisation N/A s N/A N/A res_type:  N/A str N/A self res_type N/A s N/A N/A verbose:  N/A str N/A self verbose N/A s N/A N/A ModelDictionary N/A N/A N/A 
    Dictionary used by the supervised gray matter segmentation method
     __init__ N/A N/A self dic_param N/A None N/A N/A 
        model dictionary constructor

        :param dic_param: dictionary parameters, type: Param
         N/A N/A dic_param None N/A N/A N/A self param N/A Param N/A N/A N/A self param dic_param N/A N/A self level_label N/A 0 1 2 3 4 5 6 7 8 9 10 11 12 13 C1 C2 C3 C4 C5 C6 C7 T1 T2 T3 T4 T5 T6 N/A N/A self coregistration_transfos None N/A N/A self slices None N/A N/A self J None N/A N/A self N None N/A N/A self mean_seg None N/A N/A self mean_image None N/A N/A self coregistration_transfos N/A N/A self param reg N/A N/A N/A N/A self param todo_model compute N/A N/A N/A N/A self compute_model N/A N/A N/A N/A N/A self param todo_model load N/A N/A N/A N/A self load_model N/A compute_model N/A N/A self N/A N/A N/A N/A N/A sct printv 
Computing the model dictionary ... N/A N/A self param verbose normal N/A N/A N/A sct run N/A mkdir  N/A N/A self param model_dir N/A param_fic N/A open N/A N/A N/A self param model_dir /info.txt w N/A N/A N/A param_fic write N/A str N/A self param N/A N/A N/A param_fic close N/A N/A N/A sct printv 
Loading data dictionary ... N/A N/A self param verbose normal N/A N/A self slices N/A N/A self load_data_dictionary N/A N/A self J N/A len N/A N/A dic_slice im N/A dic_slice N/A self slices N/A N/A self N N/A len N/A N/A N/A N/A N/A self slices N/A 0 im flatten N/A N/A N/A self invert_seg N/A N/A N/A sct printv 
Computing the transformation to co-register all the data into a common groupwise space (using the white matter segmentations) ... N/A N/A self param verbose normal N/A N/A self mean_seg N/A N/A self seg_coregistration transfo_to_apply N/A self coregistration_transfos N/A N/A N/A sct printv 
Co-registering all the data into the common groupwise space ... N/A N/A self param verbose normal N/A N/A N/A self coregister_data transfo_to_apply N/A self coregistration_transfos N/A N/A self mean_image N/A N/A self compute_mean_dic_image N/A N/A np asarray N/A N/A dic_slice im_M N/A dic_slice N/A self slices N/A N/A N/A self save_model N/A load_data_dictionary N/A N/A self N/A N/A N/A 
        each slice of each subject will be loaded separately in a Slice object containing :

        - a slice id

        - the original T2star image crop around the spinal cord: im

        - a manual segmentation of the gray matter: seg

        :return slices: numpy array of all the slices of the data dictionary
         N/A slices N/A N/A j 0 N/A subject_dir N/A N/A os listdir N/A N/A self param path_dictionary N/A N/A subject_path N/A N/A N/A N/A self param path_dictionary / subject_dir N/A N/A N/A N/A os path isdir subject_path N/A N/A file_name N/A N/A os listdir subject_path N/A N/A N/A im file_name N/A N/A slice_level 0 N/A name_list N/A N/A file_name split _ N/A word name_list N/A N/A N/A N/A N/A word upper N/A N/A N/A self level_label values N/A N/A slice_level N/A get_key_from_val N/A self level_label N/A N/A word upper N/A N/A N/A slices append N/A Slice slice_id j im N/A N/A Image N/A N/A subject_path / file_name data level slice_level reg_to_m N/A N/A seg_file N/A N/A N/A N/A N/A sct extract_fname file_name N/A 1 N/A -3 _seg.nii.gz N/A N/A N/A N/A slices N/A j set gm_seg N/A N/A Image N/A N/A subject_path / seg_file data N/A j 1 N/A N/A N/A np asarray slices N/A invert_seg N/A N/A self N/A N/A N/A 
        Invert the gray matter segmentation to get segmentation of the white matter instead
        keeps more information, better results
         N/A dic_slice N/A self slices N/A N/A im_dic N/A Image param N/A dic_slice im N/A sc N/A N/A im_dic copy N/A nz_coord_sc N/A N/A sc getNonZeroCoordinates N/A im_seg N/A Image param N/A dic_slice gm_seg N/A 
            nz_coord_d = im_seg.getNonZeroCoordinates()
            for coord in nz_coord_sc:
                sc.data[coord.x, coord.y] = 1
            for coord in nz_coord_d:
                im_seg.data[coord.x, coord.y] = 1
            # cast of the -1 values (-> GM pixel at the exterior of the SC pixels) to +1 --> WM pixel
            inverted_slice_decision = np.absolute(sc.data - im_seg.data).astype(int)
             N/A inverted_slice_decision N/A inverse_gmseg_to_wmseg im_seg im_dic save False N/A N/A N/A dic_slice set wm_seg N/A inverted_slice_decision data N/A seg_coregistration N/A N/A self transfo_to_apply N/A None N/A N/A 
        For all the segmentation slices, do a registration of the segmentation slice to the mean segmentation
         applying all the transformations in transfo_to_apply

        Compute, apply and save each transformation warping field for all the segmentation slices

        Compute the new mean segmentation at each step and update self.mean_seg

        :param transfo_to_apply: list of string
        :return resulting_mean_seg:
         N/A current_mean_seg N/A compute_majority_vote_mean_seg N/A N/A np asarray N/A N/A dic_slice wm_seg N/A dic_slice N/A self slices N/A first True N/A transfo transfo_to_apply N/A N/A N/A N/A sct printv N/A N/A Doing a  transfo  registration of each segmentation slice to the mean segmentation ... N/A N/A self param verbose normal N/A current_mean_seg N/A N/A self find_coregistration mean_seg current_mean_seg transfo_type transfo first first N/A first False N/A resulting_mean_seg current_mean_seg N/A resulting_mean_seg N/A find_coregistration N/A N/A self mean_seg transfo_type first N/A None Affine True N/A N/A 
        For each segmentation slice, apply and save a registration of the specified type of transformation
        the name of the registration file (usually a matlab matrix) is saved in self.RtoM

        :param mean_seg: current mean segmentation

        :param transfo_type: type of transformation for the registration

        :return mean seg: updated mean segmentation
         N/A dic_slice N/A self slices N/A N/A name_j_transform N/A N/A transform_slice_ N/A str N/A dic_slice id N/A N/A find_ants_transfo_name transfo_type N/A 0 N/A new_reg_list N/A N/A N/A dic_slice reg_to_M append name_j_transform N/A N/A N/A dic_slice set reg_to_m new_reg_list N/A first N/A N/A seg_m N/A apply_ants_transfo mean_seg N/A dic_slice wm_seg transfo_name name_j_transform path N/A N/A N/A self param model_dir / transfo_type transfo_type metric N/A N/A self param reg_metric N/A N/A seg_m N/A apply_ants_transfo mean_seg N/A dic_slice wm_seg_M transfo_name name_j_transform path N/A N/A N/A self param model_dir / transfo_type transfo_type metric N/A N/A self param reg_metric N/A N/A N/A dic_slice set wm_seg_m N/A N/A seg_m astype int N/A N/A N/A dic_slice set wm_seg_m_flat N/A N/A N/A N/A seg_m flatten astype int N/A mean_seg N/A compute_majority_vote_mean_seg N/A N/A dic_slice wm_seg_M N/A dic_slice N/A self slices N/A mean_seg N/A compute_mean_dic_image N/A N/A self im_data_set N/A N/A N/A 
        Compute the mean image of the dictionary

        Used to co-register the dictionary images into teh common groupwise space

        :param im_data_set:
        :return mean: mean image of the input data set
         N/A mean N/A N/A np sum im_data_set axis 0 N/A mean N/A float N/A len im_data_set N/A mean N/A coregister_data N/A N/A self transfo_to_apply N/A None N/A N/A 
        Apply to each image slice of the dictionary the transformations found registering the segmentation slices.
        The co_registered images are saved for each slice as im_M

        Delete the directories containing the transformation matrix : not needed after the coregistration of the data.

        :param transfo_to_apply: list of string
        :return:
         N/A list_im N/A N/A dic_slice im N/A dic_slice N/A self slices N/A list_gm_seg N/A N/A dic_slice gm_seg N/A dic_slice N/A self slices N/A dic_slice N/A self slices N/A N/A N/A n_transfo transfo N/A enumerate transfo_to_apply N/A N/A im_m N/A apply_ants_transfo N/A N/A self compute_mean_dic_image list_im N/A dic_slice im search_reg False transfo_name N/A N/A dic_slice reg_to_M N/A n_transfo binary False path N/A N/A N/A self param model_dir / transfo_type transfo metric N/A N/A self param reg_metric N/A gm_seg_m N/A apply_ants_transfo N/A compute_majority_vote_mean_seg list_gm_seg N/A dic_slice gm_seg search_reg False transfo_name N/A N/A dic_slice reg_to_M N/A n_transfo binary True path N/A N/A N/A self param model_dir / transfo_type transfo metric N/A N/A self param reg_metric N/A N/A N/A dic_slice set im_m im_m N/A N/A N/A dic_slice set gm_seg_m gm_seg_m N/A N/A N/A dic_slice set im_m_flat N/A N/A im_m flatten N/A transfo_type transfo_to_apply N/A N/A transfo_dir N/A N/A N/A transfo_type lower _transformations N/A N/A transfo_dir N/A N/A os listdir N/A N/A N/A self param model_dir / N/A N/A N/A N/A sct run N/A N/A N/A N/A rm -rf  N/A N/A self param model_dir / transfo_dir / N/A save_model N/A N/A self N/A N/A N/A model_slices N/A N/A np asarray N/A N/A N/A dic_slice im_M N/A dic_slice wm_seg_M N/A dic_slice gm_seg_M N/A dic_slice level N/A dic_slice N/A self slices N/A N/A N/A pickle dump model_slices N/A open N/A N/A N/A self param model_dir /dictionary_slices.pkl wb protocol 2 N/A load_model N/A N/A self N/A N/A N/A model_slices N/A N/A pickle load N/A open N/A N/A N/A self param path_dictionary /dictionary_slices.pkl rb N/A N/A self slices N/A N/A Slice slice_id i_slice level N/A dic_slice N/A 3 im_m N/A dic_slice N/A 0 wm_seg_m N/A dic_slice N/A 1 gm_seg_m N/A dic_slice N/A 2 im_m_flat N/A N/A N/A dic_slice N/A 0 flatten wm_seg_m_flat N/A N/A N/A dic_slice N/A 1 flatten N/A N/A i_slice dic_slice N/A enumerate model_slices N/A N/A self J N/A len N/A N/A dic_slice im_M N/A dic_slice N/A self slices N/A N/A self N N/A len N/A N/A N/A self slices N/A 0 im_M_flat N/A N/A self mean_seg N/A compute_majority_vote_mean_seg N/A N/A dic_slice wm_seg_M N/A dic_slice N/A self slices N/A show_dictionary_data N/A N/A self N/A N/A N/A 
        show the 10 first slices of the model dictionary
         N/A dic_slice N/A N/A self slices N/A 10 N/A N/A fig N/A N/A plt figure N/A N/A N/A dic_slice wm_seg None N/A N/A seg_subplot N/A N/A fig add_subplot 2 3 1 N/A N/A N/A seg_subplot set_title Original space - seg N/A im_seg N/A N/A seg_subplot imshow N/A dic_slice wm_seg N/A N/A N/A im_seg set_interpolation nearest N/A N/A N/A im_seg set_cmap gray N/A seg_m_subplot N/A N/A fig add_subplot 2 3 2 N/A N/A N/A seg_m_subplot set_title Common groupwise space - seg N/A im_seg_m N/A N/A seg_m_subplot imshow N/A dic_slice wm_seg_M N/A N/A N/A im_seg_m set_interpolation nearest N/A N/A N/A im_seg_m set_cmap gray N/A N/A N/A self mean_seg None N/A N/A mean_seg_subplot N/A N/A fig add_subplot 2 3 3 N/A N/A N/A mean_seg_subplot set_title Mean seg N/A im_mean_seg N/A N/A mean_seg_subplot imshow N/A N/A np asarray N/A self mean_seg N/A N/A N/A im_mean_seg set_interpolation nearest N/A N/A N/A im_mean_seg set_cmap gray N/A N/A N/A dic_slice im None N/A N/A slice_im_subplot N/A N/A fig add_subplot 2 3 4 N/A N/A N/A slice_im_subplot set_title Original space - data  N/A im_slice_im N/A N/A slice_im_subplot imshow N/A dic_slice im N/A N/A N/A im_slice_im set_interpolation nearest N/A N/A N/A im_slice_im set_cmap gray N/A slice_im_m_subplot N/A N/A fig add_subplot 2 3 5 N/A N/A N/A slice_im_m_subplot set_title Common groupwise space - data  N/A im_slice_im_m N/A N/A slice_im_m_subplot imshow N/A dic_slice im_M N/A N/A N/A im_slice_im_m set_interpolation nearest N/A N/A N/A im_slice_im_m set_cmap gray N/A N/A N/A plt suptitle N/A Slice  N/A str N/A dic_slice id N/A N/A N/A plt show N/A N/A Model N/A N/A N/A 
    Model used by the supervised gray matter segmentation method

     __init__ N/A N/A self model_param k N/A None 0.8 N/A N/A 
        Model constructor

        :param model_param: model parameters, type: Param

        :param k: Amount of variability to keep in the PCA reduced space, type: float
         N/A N/A model_param None N/A N/A N/A self param N/A Param N/A N/A N/A self param model_param N/A N/A self dictionary N/A ModelDictionary dic_param N/A self param N/A N/A N/A sct printv N/A N/A N/A N/A The shape of the dictionary used for the PCA is ( N/A str N/A N/A self dictionary N , N/A str N/A N/A self dictionary J ) verbose N/A N/A self param verbose N/A N/A N/A N/A self param todo_model compute N/A N/A N/A N/A sct printv 
Creating a reduced common space (using a PCA) ... N/A N/A self param verbose normal N/A N/A self pca N/A PCA N/A N/A np asarray N/A N/A self dictionary slices k k N/A N/A N/A N/A self pca save_data N/A N/A self param model_dir N/A N/A N/A N/A N/A self param todo_model load N/A N/A N/A N/A sct printv 
Loading a reduced common space (using a PCA) ... N/A N/A self param verbose normal N/A pca_data N/A N/A pickle load N/A open N/A N/A N/A self param path_dictionary /pca_data.pkl rb N/A N/A self pca N/A PCA N/A N/A np asarray N/A N/A self dictionary slices mean_vect N/A pca_data N/A 0 eig_pairs N/A pca_data N/A 1 k k N/A N/A N/A self dictionary mean_image N/A N/A self pca mean_image N/A N/A self epsilon N/A N/A round N/A 1.0 N/A N/A self dictionary J 4 2 N/A N/A N/A N/A self param todo_model compute N/A N/A N/A self tau N/A N/A self compute_tau N/A N/A N/A pickle dump N/A self tau N/A open N/A N/A N/A self param model_dir /tau.txt w protocol 0 N/A N/A N/A N/A N/A self param todo_model load N/A N/A N/A self tau N/A N/A pickle load N/A open N/A N/A N/A self param path_dictionary /tau.txt r N/A N/A N/A N/A self param verbose 2 N/A N/A N/A N/A N/A self pca plot_projected_dic N/A compute_beta N/A N/A self coord_target target_levels dataset_coord dataset_levels tau N/A None None None 0.006 N/A N/A 
        Compute the model similarity (beta) between each model slice and each target image slice

        beta_j = (1/Z)exp(-tau*square_norm(target_coordinate - slice_j_coordinate))

        Z is the partition function that enforces the constraint that sum(beta)=1

        :param coord_target: coordinates of the target image in the reduced model space

        :param tau: weighting parameter indicating the decay constant associated with a geodesic distance
        between a given dictionary slice and a projected target image slice

        :return:
         N/A N/A dataset_coord None N/A N/A dataset_coord N/A N/A N/A self pca dataset_coord T N/A dataset_levels N/A N/A dic_slice level N/A dic_slice N/A N/A self dictionary slices N/A beta N/A N/A N/A N/A self param mode_weight_similarity N/A N/A mode_weight N/A N/A val N/A sum N/A N/A self pca kept_eigenval N/A val N/A N/A self pca kept_eigenval N/A N/A mode_weight None N/A N/A isinstance N/A coord_target N/A 0 N/A list N/A np ndarray N/A N/A N/A i_target coord_projected_slice N/A enumerate coord_target N/A N/A beta_slice N/A N/A N/A j_slice coord_slice_j N/A enumerate dataset_coord N/A N/A N/A mode_weight None N/A N/A square_norm N/A N/A N/A np linalg norm N/A coord_projected_slice coord_slice_j 2 N/A scipy.spatial.distance wminkowski N/A square_norm N/A wminkowski coord_projected_slice coord_slice_j 2 mode_weight N/A N/A N/A target_levels None N/A target_levels N/A None N/A N/A self param use_levels N/A N/A N/A N/A N/A self param equation_id 1 N/A N/A N/A N/A beta_slice append N/A N/A exp N/A N/A N/A N/A self param weight_gamma N/A abs N/A N/A target_levels N/A i_target N/A dataset_levels N/A j_slice N/A exp N/A N/A tau square_norm N/A N/A N/A N/A N/A self param equation_id 2 N/A N/A N/A N/A target_levels N/A i_target N/A dataset_levels N/A j_slice N/A N/A N/A N/A beta_slice append N/A exp N/A tau square_norm N/A N/A N/A N/A beta_slice append N/A N/A N/A exp N/A N/A tau square_norm N/A N/A self param weight_gamma N/A abs N/A N/A target_levels N/A i_target N/A dataset_levels N/A j_slice N/A N/A N/A N/A beta_slice append N/A exp N/A N/A tau square_norm N/A N/A N/A beta_slice N/A N/A np sum beta_slice N/A N/A N/A ZeroDivisionError N/A N/A N/A N/A sct printv WARNING : similarities are null N/A N/A self param verbose warning N/A beta_slice N/A N/A N/A beta append beta_slice N/A N/A N/A j_slice coord_slice_j N/A enumerate dataset_coord N/A N/A N/A mode_weight None N/A N/A square_norm N/A N/A N/A np linalg norm N/A coord_target coord_slice_j 2 N/A scipy.spatial.distance wminkowski N/A square_norm N/A wminkowski coord_target coord_slice_j 2 mode_weight N/A N/A N/A target_levels None N/A N/A self param use_levels N/A N/A 
                    if target_levels == dataset_levels[j_slice]:
                        beta.append(exp(tau*square_norm))
                    else:
                        beta.append(exp(-tau*square_norm)/self.param.weight_gamma*abs(target_levels - dataset_levels[j_slice]))
                     N/A N/A N/A beta append N/A N/A exp N/A N/A N/A N/A self param weight_gamma N/A abs N/A target_levels N/A dataset_levels N/A j_slice N/A exp N/A N/A tau square_norm N/A N/A N/A N/A beta append N/A exp N/A N/A tau square_norm N/A N/A N/A beta N/A N/A np sum beta N/A N/A N/A ZeroDivisionError N/A N/A N/A N/A sct printv WARNING : similarities are null N/A N/A self param verbose warning N/A beta N/A N/A N/A np asarray beta N/A compute_tau N/A N/A self N/A N/A N/A 
        Compute the weighting parameter indicating the decay constant associated with a geodesic distance
        between a given dictionary slice and a projected target image slice
        :return:
         N/A N/A N/A sct printv 
Computing Tau ... 
(Tau is a weighting parameter indicating the decay constant associated with a geodesic distance between a given atlas and a projected target image, see Asman paper, eq (16)) 1 normal scipy.optimize minimize to_minimize N/A N/A tau N/A N/A N/A 
            Compute the sum of the L0 norm between a slice segmentation and the resulting segmentation that would be
            found if the slice was a target image for a given tau

            For a given model, Tau is the parameter that would minimize this function

            :param tau:

            :return sum_norm:

             N/A sum_norm 0 N/A dic_slice N/A N/A self dictionary slices N/A N/A projected_dic_slice_coord N/A N/A N/A self pca project_array N/A dic_slice im_M_flat N/A coord_dic_slice_dataset N/A N/A np delete N/A N/A N/A self pca dataset_coord T N/A dic_slice id 0 N/A N/A N/A self param use_levels N/A N/A dic_slice_dataset_levels N/A N/A np delete N/A N/A np asarray dic_levels N/A dic_slice id 0 N/A beta_dic_slice N/A N/A self compute_beta projected_dic_slice_coord target_levels N/A dic_slice level dataset_coord coord_dic_slice_dataset dataset_levels dic_slice_dataset_levels tau tau N/A N/A beta_dic_slice N/A N/A self compute_beta projected_dic_slice_coord target_levels None dataset_coord coord_dic_slice_dataset dataset_levels None tau tau N/A kj N/A N/A self select_k_slices beta_dic_slice N/A N/A N/A self param weight_label_fusion N/A N/A est_segm_j N/A N/A N/A self label_fusion dic_slice kj beta beta_dic_slice N/A 0 N/A N/A est_segm_j N/A N/A N/A self label_fusion dic_slice kj N/A 0 N/A sum_norm N/A l0_norm N/A dic_slice wm_seg_M N/A est_segm_j data N/A sum_norm N/A N/A dic_levels N/A N/A dic_slice level N/A dic_slice N/A N/A self dictionary slices N/A est_tau N/A minimize to_minimize 0.001 method Nelder-Mead options N/A xtol 0.0005 N/A N/A N/A sct printv N/A Estimated tau :  N/A str N/A N/A est_tau x N/A 0 N/A N/A float N/A N/A est_tau x N/A 0 N/A select_k_slices N/A N/A self beta N/A N/A N/A 
        Select the K dictionary slices most similar to the target slice

        :param beta: Dictionary similarities

        :return selected: numpy array of segmentation of the selected dictionary slices
         N/A kept_slice_index N/A N/A N/A isinstance N/A beta N/A 0 N/A list N/A np ndarray N/A N/A beta_slice beta N/A N/A selected_index N/A beta_slice N/A self epsilon N/A N/A N/A kept_slice_index append selected_index N/A N/A kept_slice_index N/A beta N/A self epsilon N/A N/A N/A np asarray kept_slice_index N/A label_fusion N/A N/A self target selected_index beta type N/A None binary N/A N/A 
        Compute the resulting segmentation by label fusion of the segmentation of the selected dictionary slices

        :param selected_index: array of indexes (as a boolean array) of the selected dictionary slices

        :return res_seg_model_space: Image of the resulting segmentation for the target image (in the model space)
         N/A wm_segmentation_slices N/A N/A np asarray N/A N/A dic_slice wm_seg_M N/A dic_slice N/A N/A self dictionary slices N/A gm_segmentation_slices N/A N/A np asarray N/A N/A dic_slice gm_seg_M N/A dic_slice N/A N/A self dictionary slices N/A res_wm_seg_model_space N/A N/A res_gm_seg_model_space N/A N/A N/A isinstance N/A selected_index N/A 0 N/A list N/A np ndarray N/A N/A N/A i selected_ind_by_slice N/A enumerate selected_index N/A N/A N/A beta None N/A N/A n_selected_dic_slices N/A N/A N/A wm_segmentation_slices N/A selected_ind_by_slice shape N/A 0 N/A weights N/A N/A N/A 1.0 n_selected_dic_slices n_selected_dic_slices N/A N/A weights N/A N/A beta N/A i N/A selected_ind_by_slice N/A weights N/A N/A w N/A sum weights N/A w weights N/A wm_slice_seg N/A compute_majority_vote_mean_seg N/A wm_segmentation_slices N/A selected_ind_by_slice weights weights type type threshold 0.50001 N/A N/A N/A res_wm_seg_model_space append wm_slice_seg N/A N/A N/A N/A target N/A i set wm_seg_m wm_slice_seg N/A gm_slice_seg N/A compute_majority_vote_mean_seg N/A gm_segmentation_slices N/A selected_ind_by_slice weights weights type type N/A N/A N/A res_gm_seg_model_space append gm_slice_seg N/A N/A N/A N/A target N/A i set gm_seg_m gm_slice_seg N/A N/A N/A beta None N/A N/A n_selected_dic_slices N/A N/A N/A wm_segmentation_slices N/A selected_index shape N/A 0 N/A weights N/A N/A N/A 1.0 n_selected_dic_slices n_selected_dic_slices N/A N/A weights N/A beta N/A selected_index N/A weights N/A N/A w N/A sum weights N/A w weights N/A res_wm_seg_model_space N/A compute_majority_vote_mean_seg N/A wm_segmentation_slices N/A selected_index weights weights type type threshold 0.50001 N/A res_gm_seg_model_space N/A compute_majority_vote_mean_seg N/A gm_segmentation_slices N/A selected_index weights weights type type N/A res_wm_seg_model_space N/A N/A np asarray res_wm_seg_model_space N/A res_gm_seg_model_space N/A N/A np asarray res_gm_seg_model_space N/A N/A N/A Image param res_wm_seg_model_space N/A Image param res_gm_seg_model_space N/A N/A TargetSegmentationPairwise N/A N/A N/A 
    Contains all the function to segment the gray matter an a target image given a model

        - registration of the target to the model space

        - projection of the target slices on the reduced model space

        - selection of the model slices most similar to the target slices

        - computation of the resulting target segmentation by label fusion of their segmentation
     __init__ N/A N/A self model target_image levels_image epsilon N/A None None None N/A N/A 
        Target gray matter segmentation constructor

        :param model: Model used to compute the segmentation, type: Model

        :param target_image: Target image to segment gray matter on, type: Image

         N/A N/A self model model N/A N/A N/A len N/A N/A target_image data shape 3 N/A N/A N/A self target N/A N/A Slice slice_id i_slice im target_slice reg_to_m N/A N/A N/A i_slice target_slice N/A enumerate N/A target_image data N/A N/A self target_dim 3 N/A N/A N/A N/A len N/A N/A target_image data shape 2 N/A N/A N/A self target N/A N/A Slice slice_id 0 im N/A target_image data reg_to_m N/A N/A N/A self target_dim 2 N/A N/A N/A levels_image None N/A N/A N/A self model param use_levels N/A N/A N/A N/A self load_level levels_image N/A N/A N/A N/A self model param first_reg N/A N/A N/A N/A self first_reg N/A N/A N/A self target_pairwise_registration N/A N/A N/A sct printv 
Projecting the target image in the reduced common space ... N/A N/A model param verbose normal N/A N/A self coord_projected_target N/A N/A N/A model pca project N/A N/A target_slice im_M N/A target_slice N/A self target N/A N/A N/A sct printv 
Computing the similarities between the target and the model slices ... N/A N/A model param verbose normal N/A N/A N/A levels_image None N/A N/A N/A self model param use_levels N/A N/A N/A self beta N/A N/A N/A self model compute_beta N/A self coord_projected_target target_levels N/A N/A np asarray N/A N/A target_slice level N/A target_slice N/A self target tau N/A N/A self model tau N/A N/A N/A self beta N/A N/A N/A self model compute_beta N/A self coord_projected_target tau N/A N/A self model tau N/A N/A N/A sct printv 
Selecting the dictionary slices most similar to the target ... N/A N/A model param verbose normal N/A N/A self selected_k_slices N/A N/A N/A self model select_k_slices N/A self beta N/A N/A N/A self save_selected_slices N/A N/A target_image file_name N/A -3 N/A N/A N/A N/A N/A self model param verbose 2 N/A N/A N/A N/A self plot_projected_dic nb_modes 3 to_highlight all N/A N/A N/A sct printv 
Computing the result gray matter segmentation ... N/A N/A model param verbose normal N/A N/A N/A N/A self model param weight_label_fusion N/A N/A use_beta N/A self beta N/A N/A use_beta None N/A N/A N/A N/A self model label_fusion N/A self target N/A self selected_k_slices beta use_beta type N/A N/A N/A self model param res_type N/A N/A N/A N/A self model param z_regularisation N/A N/A N/A N/A sct printv 
Regularisation of the segmentation along the Z axis ... N/A N/A model param verbose normal N/A N/A N/A self z_regularisation_2d_iteration N/A N/A N/A sct printv 
Registering the result gray matter segmentation back into the target original space... N/A N/A model param verbose normal N/A N/A N/A self target_pairwise_registration inverse True N/A load_level N/A N/A self level_image N/A N/A N/A 
        Find the vertebral level of the target image slice(s) for a level image (or a string if the target is 2D)
        :param level_image: image (or a string if the target is 2D) containing level information
        :return None: the target level is set in the function
         N/A N/A isinstance level_image Image N/A N/A nz_coord N/A N/A level_image getNonZeroCoordinates N/A N/A i_level_slice level_slice N/A enumerate N/A level_image data N/A N/A nz_val N/A N/A coord nz_coord N/A N/A N/A N/A coord x i_level_slice N/A N/A N/A N/A nz_val append N/A level_slice N/A N/A N/A coord y N/A coord z N/A N/A N/A N/A N/A N/A N/A self target N/A i_level_slice set level N/A int N/A round N/A N/A sum nz_val N/A len nz_val N/A N/A N/A ZeroDivisionError N/A N/A N/A N/A sct printv N/A N/A WARNING: No level label for slice  N/A str i_level_slice  of target N/A N/A N/A self model param verbose warning N/A N/A N/A N/A N/A self target N/A i_level_slice set level 0 N/A N/A N/A isinstance level_image str N/A N/A N/A N/A N/A N/A self target N/A 0 set level N/A get_key_from_val N/A N/A N/A self model dictionary level_label N/A N/A level_image upper N/A first_reg N/A N/A self N/A N/A N/A 
        Do a registration of rhe target image on the mean spinal cord segmentation to hhelp the target registration
        WARNING: DOESN'T IMPROVE THE GM SEGMENTATION RESULT

        :return None: the target moved image is set in the function
         N/A mean_sc_seg N/A N/A N/A N/A N/A np asarray N/A N/A N/A self model pca mean_image 0 astype int N/A N/A save_image N/A N/A N/A self model pca mean_image mean_image N/A N/A i target_slice N/A enumerate N/A self target N/A N/A moving_target_seg N/A N/A N/A N/A N/A np asarray N/A target_slice im 0 astype int N/A transfo BSplineSyN N/A transfo_name N/A N/A N/A transfo _first_reg_slice_ N/A str i N/A N/A find_ants_transfo_name transfo N/A 0 N/A N/A apply_ants_transfo mean_sc_seg moving_target_seg binary True apply_transfo False transfo_type transfo transfo_name transfo_name metric N/A N/A N/A self model param reg_metric N/A moved_target_slice N/A apply_ants_transfo mean_sc_seg N/A target_slice im binary False search_reg False transfo_type transfo transfo_name transfo_name metric N/A N/A N/A self model param reg_metric N/A N/A N/A target_slice set im_m moved_target_slice N/A N/A N/A N/A target_slice reg_to_M append N/A transfo transfo_name N/A N/A save_image N/A target_slice im N/A N/A slice N/A str N/A target_slice id _original_im N/A N/A save_image N/A target_slice im_M N/A N/A slice N/A str N/A target_slice id _moved_im N/A target_pairwise_registration N/A N/A self inverse N/A False N/A N/A 
        Register the target image into the model space

        Affine (or rigid + affine) registration of the target on the mean model image --> pairwise

        :param inverse: if True, apply the inverse warping field of the registration target -> model space
        to the result gray matter segmentation of the target
        (put it back in it's original space)

        :return None: the target attributes are set in the function
         N/A N/A inverse N/A N/A mean_dic_im N/A N/A N/A self model pca mean_image N/A N/A i target_slice N/A enumerate N/A self target N/A N/A N/A N/A N/A N/A self model param first_reg N/A N/A moving_target_slice N/A target_slice im N/A N/A moving_target_slice N/A target_slice im_M N/A transfo N/A N/A N/A self model dictionary coregistration_transfos N/A N/A transfo_name N/A N/A N/A transfo _transfo_target2model_space_slice_ N/A str i N/A N/A find_ants_transfo_name transfo N/A 0 N/A N/A N/A N/A target_slice reg_to_M append N/A transfo transfo_name N/A moving_target_slice N/A apply_ants_transfo mean_dic_im moving_target_slice binary False transfo_type transfo transfo_name transfo_name metric N/A N/A N/A self model param reg_metric N/A N/A N/A N/A N/A self target N/A i set im_m moving_target_slice N/A N/A N/A i target_slice N/A enumerate N/A self target N/A N/A moving_wm_seg_slice N/A target_slice wm_seg_M N/A moving_gm_seg_slice N/A target_slice gm_seg_M N/A transfo N/A target_slice reg_to_M N/A N/A N/A N/A N/A N/A self model param res_type binary N/A N/A bin True N/A N/A bin False N/A moving_wm_seg_slice N/A apply_ants_transfo N/A N/A N/A self model dictionary mean_seg moving_wm_seg_slice search_reg False binary bin inverse 1 transfo_type N/A transfo N/A 0 transfo_name N/A transfo N/A 1 metric N/A N/A N/A self model param reg_metric N/A moving_gm_seg_slice N/A apply_ants_transfo N/A N/A N/A self model dictionary mean_seg moving_gm_seg_slice search_reg False binary bin inverse 1 transfo_type N/A transfo N/A 0 transfo_name N/A transfo N/A 1 metric N/A N/A N/A self model param reg_metric N/A N/A N/A target_slice set wm_seg moving_wm_seg_slice N/A N/A N/A target_slice set gm_seg moving_gm_seg_slice N/A z_regularisation_2d_iteration N/A N/A self coeff N/A 0.4 N/A N/A 
        Z regularisation option WARNING: DOESN'T IMPROVE THE GM SEGMENTATION RESULT
        Use the result segmentation of the first iteration, the segmentation of slice i is the weighted average of the segmentations of slices i-1 and i+1 and the segmentation of slice i
        :param coeff: weight on each adjacent slice
        :return:
         N/A N/A i target_slice N/A enumerate N/A N/A self target N/A 1 -1 N/A N/A adjacent_wm_seg N/A N/A adjacent_gm_seg N/A N/A precision 100 N/A N/A int N/A precision coeff N/A k N/A range N/A int N/A precision coeff N/A N/A N/A N/A adjacent_wm_seg append N/A N/A N/A self target N/A N/A i 1 wm_seg_M N/A N/A N/A adjacent_wm_seg append N/A N/A N/A self target N/A N/A i 1 wm_seg_M N/A N/A N/A adjacent_gm_seg append N/A N/A N/A self target N/A N/A i 1 gm_seg_M N/A N/A N/A adjacent_gm_seg append N/A N/A N/A self target N/A N/A i 1 gm_seg_M N/A k N/A range N/A precision N/A 2 N/A int N/A precision coeff N/A N/A N/A N/A adjacent_wm_seg append N/A target_slice wm_seg_M N/A N/A N/A adjacent_gm_seg append N/A target_slice gm_seg_M N/A adjacent_wm_seg N/A N/A np asarray adjacent_wm_seg N/A adjacent_gm_seg N/A N/A np asarray adjacent_gm_seg N/A new_wm_seg N/A compute_majority_vote_mean_seg adjacent_wm_seg type N/A N/A N/A self model param res_type threshold 0.50001 N/A new_gm_seg N/A compute_majority_vote_mean_seg adjacent_gm_seg type N/A N/A N/A self model param res_type N/A N/A N/A target_slice set wm_seg_m new_wm_seg N/A N/A N/A target_slice set gm_seg_m new_gm_seg N/A plot_projected_dic N/A N/A self nb_modes to_highlight N/A 3 1 N/A N/A 
        plot the pca first modes and the target projection if target is provided.

        on a second plot, highlight the selected dictionary slices for one target slice in particular

        :param nb_modes:
        :return:
         N/A N/A N/A N/A self coord_projected_target None N/A N/A N/A N/A self model pca plot_projected_dic nb_modes nb_modes target_coord N/A self coord_projected_target target_levels N/A N/A t_slice level N/A t_slice N/A self target N/A N/A N/A N/A self model pca plot_projected_dic nb_modes nb_modes N/A N/A to_highlight all N/A N/A i N/A range N/A len N/A self target N/A N/A N/A N/A N/A N/A self model pca plot_projected_dic nb_modes nb_modes target_coord N/A self coord_projected_target target_levels N/A N/A t_slice level N/A t_slice N/A self target to_highlight N/A i N/A N/A self selected_k_slices N/A i N/A N/A N/A N/A N/A self coord_projected_target None N/A N/A N/A N/A self model pca plot_projected_dic nb_modes nb_modes target_coord N/A self coord_projected_target target_levels N/A N/A t_slice level N/A t_slice N/A self target to_highlight N/A to_highlight N/A N/A self selected_k_slices N/A to_highlight N/A N/A N/A N/A self model pca plot_projected_dic N/A save_selected_slices N/A N/A self target_name N/A N/A N/A slice_levels N/A N/A np asarray N/A N/A N/A dic_slice id N/A N/A N/A N/A self model dictionary level_label N/A N/A dic_slice level N/A dic_slice N/A N/A N/A self model dictionary slices N/A fic_selected_slices N/A open N/A target_name _selected_slices.txt w N/A N/A N/A self target_dim 2 N/A N/A N/A N/A fic_selected_slices write N/A str N/A slice_levels N/A N/A N/A N/A self selected_k_slices reshape N/A N/A N/A self model dictionary J N/A N/A N/A N/A self target_dim 3 N/A N/A target_slice N/A self target N/A N/A N/A N/A fic_selected_slices write N/A N/A N/A N/A slice  N/A str N/A target_slice id :  N/A str N/A slice_levels N/A N/A N/A self selected_k_slices N/A N/A target_slice id N/A N/A N/A fic_selected_slices close N/A N/A GMsegSupervisedMethod N/A N/A N/A 
    Gray matter segmentation supervised method:

    Load a dictionary (training data set), compute or load a model from this dictionary
sct_Image
    Load a target image to segment and do the segmentation using the model
     __init__ N/A N/A self target_fname level_fname model gm_seg_param N/A None N/A N/A N/A self model model N/A N/A N/A sct printv 
Constructing target image ... verbose N/A gm_seg_param verbose type normal N/A N/A self target_image N/A Image target_fname N/A original_hdr N/A N/A self target_image hdr N/A level_im None N/A N/A level_fname None N/A N/A N/A N/A len level_fname 3 N/A N/A level_im level_fname N/A N/A level_im N/A Image level_fname N/A N/A level_im None N/A N/A N/A self target_seg_methods N/A TargetSegmentationPairwise N/A self model target_image N/A self target_image levels_image level_im N/A N/A N/A self target_seg_methods N/A TargetSegmentationPairwise N/A self model target_image N/A self target_image N/A suffix _ N/A suffix N/A _ N/A gm_seg_param res_type N/A transfo N/A N/A N/A self model dictionary coregistration_transfos N/A N/A suffix N/A _ transfo N/A N/A N/A N/A self model param use_levels N/A N/A suffix N/A _with_levels_ N/A str N/A N/A N/A self model param weight_gamma N/A N/A suffix _no_levels N/A N/A N/A N/A self model param z_regularisation N/A N/A suffix _Zregularisation N/A name_res_wmseg N/A N/A N/A N/A N/A sct extract_fname target_fname N/A 1 _res_wmseg suffix N/A name_res_gmseg N/A N/A N/A N/A N/A sct extract_fname target_fname N/A 1 _res_gmseg suffix N/A N/A N/A len N/A N/A self target_seg_methods target 1 N/A N/A N/A self res_wm_seg N/A Image param N/A N/A np asarray N/A N/A N/A N/A self target_seg_methods target N/A 0 wm_seg absolutepath N/A name_res_wmseg .nii.gz N/A N/A self res_gm_seg N/A Image param N/A N/A np asarray N/A N/A N/A N/A self target_seg_methods target N/A 0 gm_seg absolutepath N/A name_res_gmseg .nii.gz N/A N/A N/A self res_wm_seg N/A Image param N/A N/A np asarray N/A N/A target_slice wm_seg N/A target_slice N/A N/A self target_seg_methods target absolutepath N/A name_res_wmseg .nii.gz N/A N/A self res_gm_seg N/A Image param N/A N/A np asarray N/A N/A target_slice gm_seg N/A target_slice N/A N/A self target_seg_methods target absolutepath N/A name_res_gmseg .nii.gz N/A N/A N/A self res_wm_seg hdr original_hdr N/A N/A N/A self res_wm_seg file_name name_res_wmseg N/A N/A N/A N/A self res_wm_seg save type minimize N/A N/A N/A self res_gm_seg hdr original_hdr N/A N/A N/A self res_gm_seg file_name name_res_gmseg N/A N/A N/A N/A self res_gm_seg save type minimize N/A N/A self corrected_wm_seg N/A correct_wmseg N/A self res_gm_seg N/A self target_image name_res_wmseg original_hdr N/A show N/A N/A self N/A N/A N/A N/A N/A sct printv 
Showing the pca modes ... N/A N/A N/A N/A N/A self model pca show_all_modes N/A N/A N/A sct printv 
Ploting the projected dictionary ... N/A N/A N/A N/A self target_seg_methods plot_projected_dic nb_modes 3 N/A N/A N/A sct printv 
Showing PCA mode graphs ... N/A N/A N/A N/A N/A self model pca show_mode_variation N/A N/A N/A N/A __name__ __main__ N/A N/A param N/A Param N/A input_target_fname None N/A input_level_fname None N/A N/A param debug N/A N/A 
*** WARNING: DEBUG MODE ON ***
 N/A fname_input N/A N/A param path_dictionary /errsm_34.nii.gz N/A fname_input N/A N/A param path_dictionary /errsm_34_seg_in.nii.gz N/A N/A param_default N/A Param N/A parser N/A Parser __file__ N/A N/A N/A N/A parser usage set_description Project all the input image slices on a PCA generated from set of t2star images N/A N/A N/A parser add_option name -i type_value file description T2star image you want to segmentif -i isn't used, only the model is computed/loaded mandatory False example t2star.nii.gz N/A N/A N/A parser add_option name -dic type_value folder description Path to the dictionary of images mandatory True example /home/jdoe/data/dictionary N/A N/A N/A parser add_option name -model type_value multiple_choice description Load or compute the model mandatory True example N/A load compute N/A N/A N/A parser add_option name -l type_value str description Image containing level labels for the target or str indicating the level mandatory False example MNI-Poly-AMU_level_IRP.nii.gz N/A N/A N/A parser add_option name -reg type_value N/A N/A , str description list of transformations to apply to co-register the dictionary data mandatory False default_value N/A Affine example N/A SyN N/A N/A N/A parser add_option name -weight type_value float description weight parameter on the level differences to compute the similarities (beta) mandatory False default_value 1.2 example 2.0 N/A N/A N/A parser add_option name -use-levels type_value multiple_choice description 1: Use vertebral level information, 0: no  mandatory False default_value 1 example N/A 0 1 N/A N/A N/A parser add_option name -z type_value multiple_choice description 1: Z regularisation, 0: no  mandatory False default_value 0 example N/A 0 1 N/A N/A N/A parser add_option name -denoising type_value multiple_choice description 1: Adaptative denoising from F. Coupe algorithm, 0: no  WARNING: It affects the model you should use (if denoising is applied to the target, the model should have been coputed with denoising too mandatory False default_value 1 example N/A 0 1 N/A N/A N/A parser add_option name -first-reg type_value multiple_choice description Apply a Bspline registration using the spinal cord edges target --> model first mandatory False default_value 0 example N/A 0 1 N/A N/A N/A parser add_option name -weighted-label-fusion type_value multiple_choice description Use the similarities as a weights for the label fusion mandatory False default_value 0 example N/A 0 1 N/A N/A N/A parser add_option name -weighted-similarity type_value multiple_choice description Use a PCA mode weighted norm for the computation of the similarities instead of the euclidean square norm mandatory False default_value 0 example N/A 0 1 N/A N/A N/A parser add_option name -res-type type_value multiple_choice description Type of result segmentation : binary or probabilistic mandatory False default_value binary example N/A binary prob N/A N/A N/A parser add_option name -v type_value multiple_choice description verbose: 0 = nothing, 1 = classic, 2 = expended mandatory False default_value 0 example N/A 0 1 2 N/A arguments N/A N/A parser parse N/A N/A sys argv N/A 1 N/A N/A param path_dictionary N/A arguments N/A -dic N/A N/A param todo_model N/A arguments N/A -model N/A N/A -i arguments N/A N/A input_target_fname N/A arguments N/A -i N/A N/A -reg arguments N/A N/A N/A param reg N/A arguments N/A -reg N/A N/A -l arguments N/A N/A input_level_fname N/A arguments N/A -l N/A N/A -weight arguments N/A N/A N/A param weight_gamma N/A arguments N/A -weight N/A N/A -use-levels arguments N/A N/A N/A param use_levels N/A bool N/A int N/A arguments N/A -use-levels N/A N/A -weighted-label-fusion arguments N/A N/A N/A param weight_label_fusion N/A bool N/A int N/A arguments N/A -weighted-label-fusion N/A N/A -weighted-similarity arguments N/A N/A N/A param mode_weight_similarity N/A bool N/A int N/A arguments N/A -weighted-similarity N/A N/A -z arguments N/A N/A N/A param z_regularisation N/A bool N/A int N/A arguments N/A -z N/A N/A -denoising arguments N/A N/A N/A param target_denoising N/A bool N/A int N/A arguments N/A -denoising N/A N/A -first-reg arguments N/A N/A N/A param first_reg N/A bool N/A int N/A arguments N/A -first-reg N/A N/A -res-type arguments N/A N/A N/A param res_type N/A arguments N/A -res-type N/A N/A -v arguments N/A N/A N/A param verbose N/A int N/A arguments N/A -v N/A model N/A Model model_param param k 0.8 N/A N/A input_target_fname None N/A N/A gm_seg_method N/A GMsegSupervisedMethod input_target_fname input_level_fname model gm_seg_param param N/A N/A N/A param verbose 2 N/A N/A N/A param verbose 2 N/A N/A N/A N/A gm_seg_method show