Module ImportFrom alias alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias alias alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Return ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore NameStore NameLoad Return ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore NameStore NameStore NameLoad Return ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameLoad Return ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore NameLoad Return ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore NameStore NameLoad Return ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore NameStore NameStore NameLoad Return ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Num body Return SubscriptLoad SubscriptLoad NameLoad Index Num Slice If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore NameLoad Return ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Num body Raise Call NameLoad Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice BinOpFloorDiv NameLoad Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice BinOpFloorDiv NameLoad Num Return ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpMult ListLoad Num NameLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body If CompareEq SubscriptLoad NameLoad Index NameLoad Num body AugAssignAdd NameStore Num Assign SubscriptStore NameLoad Index NameLoad Num Assign NameStore NameLoad While CompareNotEq SubscriptLoad NameLoad Index NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Index NameLoad Num Return BinOpMod BinOpSub NameLoad NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMult ListLoad Num Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq NameLoad Num body Return Call NameLoad Call NameLoad Call NameLoad NameLoad If CompareLt NameLoad Num body Return Call NameLoad Call NameLoad NameLoad UnaryOpUSub NameLoad If CompareEq NameLoad Num body Return SubscriptLoad NameLoad Slice orelse If CompareEq NameLoad Num body Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad orelse If CompareEq NameLoad Num body Assign NameStore ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad orelse If CompareEq NameLoad Num body Assign NameStore ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad orelse Assign NameStore Call NameLoad Call NameLoad Call NameLoad NameLoad While Num body If BinOpBitAnd NameLoad Num body Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad AugAssignSub NameStore Num If UnaryOpNot NameLoad body Break If CompareEq BinOpMod NameLoad Num Num body Assign NameStore ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Assign NameStore BinOpFloorDiv NameLoad Num orelse If CompareEq BinOpMod NameLoad Num Num body Assign NameStore ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad Assign NameStore BinOpFloorDiv NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return UnaryOpNot Call NameLoad GeneratorExp CompareNotEq SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad BinOpSub Call NameLoad NameLoad Num decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore Call AttributeLoad NameLoad attr body Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Assign NameStore Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If BoolOpAnd UnaryOpNot NameLoad CompareIs NameLoad NameLoad body Raise Call NameLoad Str If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad BinOpAdd ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr CompareNotEq SubscriptLoad NameLoad Index NameLoad NameLoad ListLoad Num Assign NameStore Call NameLoad NameLoad BinOpAdd NameLoad Num orelse Assign NameStore AttributeLoad NameLoad attr Return ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return Str Assign NameStore AttributeLoad Call NameLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr GeneratorExp Call NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore BinOpSub AttributeLoad NameLoad attr Num If UnaryOpNot Call NameLoad GeneratorExp CompareEq NameLoad NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Return BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return Str Assign NameStore AttributeLoad Call NameLoad NameLoad attr Assign NameStore Call AttributeLoad Str attr GeneratorExp Call NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore BinOpSub AttributeLoad NameLoad attr Num If UnaryOpNot Call NameLoad GeneratorExp CompareEq NameLoad NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str If UnaryOpNot NameLoad body Return If CompareEq Call NameLoad NameLoad Num body If Call NameLoad SubscriptLoad NameLoad Index Num NameLoad body For NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return orelse If Call NameLoad SubscriptLoad NameLoad Index Num NameLoad body For TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad If Call NameLoad GeneratorExp CompareLt NameLoad Num comprehension NameStore NameLoad body Raise Call NameLoad Str If Call NameLoad NameLoad body Raise Call NameLoad Str For NameStore Call NameLoad UnaryOpUSub Call NameLoad NameLoad Num body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot NameLoad body Return Num Return BinOpAdd Call NameLoad Call AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore NameLoad If UnaryOpNot NameLoad body Return Call NameLoad Call NameLoad Call NameLoad BoolOpOr NameLoad Num orelse If CompareGt Call NameLoad NameLoad Num body Return Call NameLoad Call AttributeLoad Call NameLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num If Call NameLoad NameLoad NameLoad body If BoolOpOr CompareIs NameLoad NameLoad CompareEq NameLoad AttributeLoad NameLoad attr body Return NameLoad Return Call NameLoad AttributeLoad NameLoad attr keyword NameLoad If Call NameLoad NameLoad NameLoad body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad body Return Call NameLoad Call NameLoad Call NameLoad BinOpAdd NameLoad Num If Call NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore BoolOpAnd NameLoad Call NameLoad SubscriptLoad NameLoad Index Num If NameLoad body Assign NameStore ListComp ListComp Call NameLoad NameLoad comprehension NameStore NameLoad comprehension NameStore NameLoad orelse Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad If Call NameLoad NameLoad body If NameLoad body Raise Call NameLoad BinOpMod Str Call AttributeLoad Str attr ListComp Call NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad orelse Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad If BoolOpAnd UnaryOpNot NameLoad Call NameLoad GeneratorExp CompareNotIn NameLoad NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad body Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad If NameLoad body Assign NameStore Call NameLoad For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad NameLoad If BoolOpAnd NameLoad CompareGt NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return SubscriptLoad AttributeLoad NameLoad attr Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body ImportFrom alias alias If AttributeLoad NameLoad attr body If UnaryOpNot AttributeLoad NameLoad attr body Return Str Assign NameStore SubscriptLoad Call AttributeLoad Call Call NameLoad NameLoad BinOpSub AttributeLoad NameLoad attr Num attr Slice Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpAnd UnaryOpNot CompareEq NameLoad Num CompareNotIn Str SubscriptLoad NameLoad Slice NameLoad body Assign NameStore BinOpAdd SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Return BinOpMod Str NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body If CompareLt AttributeLoad NameLoad attr Num body Return BinOpMod Str Call NameLoad AttributeLoad NameLoad attr Return BinOpMod Str AttributeLoad NameLoad attr Assign NameStore BinOpAdd Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice BinOpAdd SubscriptLoad NameLoad Index Num Num BinOpMod Str AttributeLoad NameLoad attr Assign NameStore NameStore Call NameLoad AttributeLoad NameLoad attr If CompareLt Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore NameLoad Return BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If BoolOpAnd UnaryOpNot NameLoad CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body If CompareGt NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad orelse Assign NameStore BinOpSub AttributeLoad NameLoad attr Num While NameLoad body If CompareNotEq SubscriptLoad NameLoad Index Num NameLoad body Break Expr Call AttributeLoad NameLoad attr AugAssignSub NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpMult ListLoad NameLoad Call NameLoad NameLoad Assign NameStore ListLoad For NameStore Call NameLoad Call NameLoad NameLoad body If SubscriptLoad NameLoad Index NameLoad body Assign NameStore ListLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore NameLoad While SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad If CompareGt Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad Assert CompareEq NameLoad Call NameLoad Call NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Slice Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpSub Call NameLoad Call NameLoad AttributeLoad NameLoad attr Call NameLoad Call NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr ListComp ListLoad NameLoad comprehension NameStore NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Return ListComp NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad CompareNotEq SubscriptLoad NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore BinOpMod BinOpAdd Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str Assign NameStore SubscriptLoad NameLoad Index Num For NameStore Call NameLoad Num Call NameLoad NameLoad body Assign NameStore BinOpMult SubscriptLoad NameLoad Index NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args defaults vararg body Expr Str Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Return Call NameLoad Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpMult Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Assign NameStore NameLoad orelse Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore BinOpAdd ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad SubscriptLoad NameLoad Slice Call NameLoad NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad NameLoad body Return Call NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore BinOpMult ListLoad NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Num body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad orelse If CompareGt NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num For NameStore SubscriptLoad NameLoad Slice BinOpSub NameLoad Num Num Num body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Call NameLoad NameLoad Call NameLoad Call NameLoad Call NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults Call NameLoad SubscriptLoad NameLoad Index Num orelse Expr Call AttributeLoad NameLoad attr Return UnaryOpInvert Call NameLoad ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore AttributeLoad NameLoad attr body Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str If CompareEq Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num TryExcept body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body TryExcept body Return ListComp SubscriptLoad NameLoad Index NameLoad comprehension NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Raise Call NameLoad Str orelse Return BinOpMult NameLoad Call NameLoad Call NameLoad NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpSub NameLoad Num While CompareLt SubscriptLoad NameLoad Index BinOpAdd NameLoad Num SubscriptLoad NameLoad Index NameLoad body AugAssignSub NameStore Num If CompareEq NameLoad Num body Return NameLoad orelse Assign NameStore BinOpSub NameLoad Num While CompareLt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body AugAssignSub NameStore Num Assign TupleStore SubscriptStore NameLoad Index NameLoad SubscriptStore NameLoad Index NameLoad TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num Assign NameStore BinOpSub NameLoad Num While CompareLt NameLoad NameLoad body Assign TupleStore SubscriptStore NameLoad Index NameLoad SubscriptStore NameLoad Index NameLoad TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num AugAssignSub NameStore Num Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareGt NameLoad Num body Assign TupleStore SubscriptStore NameLoad Index BinOpSub NameLoad Num SubscriptStore NameLoad Index BinOpMod NameLoad NameLoad TupleLoad SubscriptLoad NameLoad Index BinOpMod NameLoad NameLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Expr Call NameLoad BinOpSub NameLoad Num BinOpFloorDiv NameLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpMod NameLoad Call NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad Num body Return Num Assign NameStore SubscriptLoad NameLoad Index BinOpSub NameLoad Num Assign NameStore SubscriptLoad NameLoad Index BinOpSub NameLoad Num Assign TupleStore SubscriptStore NameLoad Index BinOpSub NameLoad Num SubscriptStore NameLoad Index NameLoad TupleLoad SubscriptLoad NameLoad Index NameLoad NameLoad Assign TupleStore SubscriptStore NameLoad Index BinOpSub NameLoad Num SubscriptStore NameLoad Index NameLoad TupleLoad SubscriptLoad NameLoad Index NameLoad NameLoad Return BinOpAdd NameLoad BinOpMult NameLoad Call NameLoad BinOpSub NameLoad Num NameLoad NameLoad decorator_list If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad UnaryOpInvert NameLoad attr If UnaryOpNot NameLoad body Return Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad BinOpSub Call NameLoad AttributeLoad NameLoad attr Num body Return NameLoad Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot CompareIs AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr Assign NameStore Num Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Assign NameStore BinOpSub AttributeLoad NameLoad attr Num Assign NameStore BinOpAdd NameLoad Num Assign NameStore Call NameLoad Call NameLoad NameLoad For NameStore Call NameLoad BinOpSub NameLoad Num body AugAssignAdd NameStore BinOpMult SubscriptLoad NameLoad Index NameLoad NameLoad For NameStore Call NameLoad BinOpAdd NameLoad Num NameLoad body If CompareGt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body AugAssignSub SubscriptStore NameLoad Index NameLoad Num AugAssignFloorDiv NameStore NameLoad AugAssignSub NameStore Num Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return BinOpMod BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return UnaryOpNot AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad BinOpMod Call AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return CompareEq AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return CompareEq AttributeLoad NameLoad attr Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Return BoolOpOr UnaryOpNot NameLoad Call NameLoad GeneratorExp CompareEq NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp NameLoad comprehension NameStore Call NameLoad BinOpSub Call NameLoad NameLoad Num CompareLt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp NameLoad comprehension NameStore Call NameLoad BinOpSub Call NameLoad NameLoad Num CompareGt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad Call NameLoad NameLoad body If BoolOpAnd CompareNotEq SubscriptLoad NameLoad Index NameLoad NameLoad CompareGt SubscriptLoad NameLoad Index NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad For NameStore Call NameLoad Call NameLoad NameLoad body If BoolOpAnd CompareNotEq SubscriptLoad NameLoad Index NameLoad NameLoad CompareLt SubscriptLoad NameLoad Index NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad If CompareLt NameLoad Num body For NameStore Call NameLoad BinOpSub NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index NameLoad For NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num body If CompareGt NameLoad NameLoad body AugAssignAdd NameStore Num orelse Assign NameStore Num Assign NameStore Num Assign NameStore SubscriptLoad NameLoad Slice Assign NameStore SubscriptLoad NameLoad Slice While CompareLt NameLoad NameLoad body Assign NameStore Num While CompareLt BinOpAdd NameLoad NameLoad NameLoad body Assign NameStore BinOpSub BinOpAdd NameLoad BinOpMult NameLoad Num Num If CompareGtE NameLoad NameLoad body Assign NameStore BinOpSub NameLoad Num AugAssignAdd NameStore Call NameLoad NameLoad NameLoad NameLoad BinOpAdd NameLoad NameLoad NameLoad Assign NameStore BinOpAdd NameLoad BinOpMult NameLoad Num Assign NameStore BinOpMult NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad If CompareNotEq Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore BinOpMult ListLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index NameLoad NameLoad Assign NameStore BinOpMult ListLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index NameLoad NameLoad Return Call NameLoad ListComp SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Return Num Return Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad ListComp Call NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body AugAssignAdd SubscriptStore NameLoad Index Call NameLoad NameLoad Num AugAssignSub NameStore Call NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Num NameLoad Assign AttributeStore NameLoad attr NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Return Call NameLoad ListComp NameLoad comprehension NameStore Call NameLoad BinOpSub Call NameLoad NameLoad Num CompareGt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpMult ListLoad Num BinOpSub NameLoad Num For NameStore Call NameLoad BinOpSub NameLoad Num body Assign NameStore Num For NameStore Call NameLoad BinOpAdd NameLoad Num NameLoad body If CompareLt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body AugAssignAdd NameStore Num Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr CompareEq AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr body Return Num If CompareEq AttributeLoad NameLoad attr ListLoad Num Num body Return Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Num For NameStore Call NameLoad Num NameLoad body Assign NameStore Num Assign NameStore Num While CompareNotEq SubscriptLoad NameLoad Index NameLoad NameLoad body If CompareLt SubscriptLoad NameLoad Index NameLoad NameLoad body AugAssignAdd NameStore Num AugAssignAdd NameStore Num Assign NameStore BinOpAdd NameLoad Num If CompareEq BinOpMod NameLoad Num Num body Assign NameStore BinOpSub BinOpAdd BinOpMult NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore BinOpSub BinOpAdd BinOpMult NameLoad NameLoad NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpMult ListLoad Num NameLoad Assign NameStore Num Assign NameStore Call NameLoad NameLoad Assign NameStore Num For NameStore Call NameLoad Num BinOpAdd NameLoad Num body AugAssignMult NameStore NameLoad Assign NameStore BinOpFloorDiv BinOpMult NameLoad NameLoad NameLoad Assign NameStore BinOpSub NameLoad BinOpMult NameLoad NameLoad If CompareEq BinOpMod NameLoad Num Num body For NameStore Call NameLoad BinOpSub NameLoad Num BinOpSub BinOpSub NameLoad NameLoad Num Num body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Assign SubscriptStore NameLoad Index BinOpSub BinOpSub NameLoad NameLoad Num BinOpSub NameLoad Num orelse For NameStore Call NameLoad BinOpSub NameLoad Num NameLoad Num body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpSub NameLoad Num Assign SubscriptStore NameLoad Index NameLoad BinOpSub NameLoad Num Assign NameStore NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Assign NameStore Call NameLoad NameLoad Assign NameStore Num Assign NameStore SubscriptLoad NameLoad Slice Assign NameStore NameLoad Assign NameStore BinOpSub NameLoad Num While BoolOpAnd CompareGt NameLoad Num UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice NameLoad If CompareEq NameLoad Num body If CompareEq NameLoad NameLoad body AugAssignSub NameStore Num orelse Assign TupleStore SubscriptStore NameLoad Index BinOpAdd NameLoad NameLoad SubscriptStore NameLoad Index BinOpAdd BinOpAdd NameLoad NameLoad Num TupleLoad SubscriptLoad NameLoad Index BinOpAdd BinOpAdd NameLoad NameLoad Num SubscriptLoad NameLoad Index BinOpAdd NameLoad NameLoad Assign NameStore NameLoad orelse If CompareEq NameLoad Num body AugAssignSub NameStore Num AugAssignAdd NameStore Num orelse Assign TupleStore SubscriptStore NameLoad Index BinOpAdd NameLoad NameLoad SubscriptStore NameLoad Index BinOpSub BinOpAdd NameLoad NameLoad Num TupleLoad SubscriptLoad NameLoad Index BinOpSub BinOpAdd NameLoad NameLoad Num SubscriptLoad NameLoad Index BinOpAdd NameLoad NameLoad Assign NameStore NameLoad If CompareEq NameLoad Num body Return NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad AttributeLoad NameLoad attr body For NameStore Call NameLoad BinOpAdd NameLoad Num AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Num For NameStore Call NameLoad AttributeLoad NameLoad attr body For NameStore Call NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Continue If CompareEq BinOpMult SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignAdd NameStore Num Assign NameStore BinOpSub BinOpFloorDiv BinOpMult AttributeLoad NameLoad attr BinOpSub AttributeLoad NameLoad attr Num Num NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad BinOpSub AttributeLoad NameLoad attr Num body Assign SubscriptStore NameLoad Index TupleLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Num For NameStore Call NameLoad AttributeLoad NameLoad attr body For NameStore Call NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Continue If CompareEq BinOpMult SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Num body AugAssignAdd NameStore Num Assign NameStore BinOpSub BinOpSub AttributeLoad NameLoad attr NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Raise Call NameLoad Str Return Call NameLoad ListComp Call NameLoad BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Expr Str ImportFrom alias AugAssignSub NameStore Num Assign NameStore Call NameLoad Call NameLoad Call NameLoad NameLoad Assign NameStore ListLoad While CompareGt Call NameLoad NameLoad Call NameLoad NameLoad Num body For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad BinOpAdd NameLoad Num Assign NameStore ListLoad TryExcept body For NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpMult ListLoad Num NameLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body Assign NameStore BinOpMult NameLoad BinOpAdd NameLoad Num Assign NameStore BinOpFloorDiv BinOpMod NameLoad NameLoad NameLoad AugAssignSub NameStore BinOpMult NameLoad NameLoad Assign SubscriptStore NameLoad Index BinOpSub BinOpSub NameLoad NameLoad Num NameLoad For NameStore Call NameLoad BinOpSub NameLoad NameLoad NameLoad body If CompareGt SubscriptLoad NameLoad Index NameLoad BinOpSub NameLoad Num body AugAssignAdd SubscriptStore NameLoad Index NameLoad Num Assign NameStore NameLoad Return Call NameLoad NameLoad decorator_list NameLoad Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore NameStore NameLoad Assign NameStore NameLoad Assign NameStore Num While BoolOpAnd CompareLt NameLoad NameLoad CompareLtE NameLoad NameLoad body If CompareLt SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num AugAssignAdd NameStore Num orelse Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num AugAssignAdd NameStore Num AugAssignAdd NameStore BinOpSub NameLoad NameLoad While CompareLt NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore Num AugAssignAdd NameStore Num If CompareLtE NameLoad NameLoad body AugAssignAdd NameStore BinOpAdd BinOpSub NameLoad NameLoad Num AugAssignAdd NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign SubscriptStore NameLoad Slice NameLoad BinOpAdd NameLoad Num SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad Num orelse Assign SubscriptStore NameLoad Slice NameLoad BinOpAdd NameLoad Num SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad Num Return NameLoad decorator_list Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr
N/A __future__ print_function division N/A random collections defaultdict sympy.core Basic sympy.core.compatibility is_sequence reduce range as_int sympy.utilities.iterables flatten has_variety minlex has_dups runs sympy.polys.polytools lcm sympy.matrices zeros mpmath.libmp.libintmath ifac _af_rmul N/A N/A a b N/A N/A N/A 
    Return the product b*a; input and output are array forms. The ith value
    is a[b[i]].

    Examples
    ========

    >>> from sympy.combinatorics.permutations import _af_rmul, Permutation
    >>> Permutation.print_cyclic = False

    >>> a, b = [1, 0, 2], [0, 2, 1]
    >>> _af_rmul(a, b)
    [1, 2, 0]
    >>> [a[b[i]] for i in range(3)]
    [1, 2, 0]

    This handles the operands in reverse order compared to the ``*`` operator:

    >>> a = Permutation(a)
    >>> b = Permutation(b)
    >>> list(a*b)
    [2, 0, 1]
    >>> [b(a(i)) for i in range(3)]
    [2, 0, 1]

    See Also
    ========
    rmul, _af_rmuln
     N/A N/A N/A a N/A i N/A i b N/A _af_rmuln N/A N/A N/A abc N/A N/A 
    Given [a, b, c, ...] return the product of ...*c*b*a using array forms.
    The ith value is a[b[c[i]]].

    Examples
    ========

    >>> from sympy.combinatorics.permutations import _af_rmul, Permutation
    >>> Permutation.print_cyclic = False

    >>> a, b = [1, 0, 2], [0, 2, 1]
    >>> _af_rmul(a, b)
    [1, 2, 0]
    >>> [a[b[i]] for i in range(3)]
    [1, 2, 0]

    This handles the operands in reverse order compared to the ``*`` operator:

    >>> a = Permutation(a); b = Permutation(b)
    >>> list(a*b)
    [2, 0, 1]
    >>> [b(a(i)) for i in range(3)]
    [2, 0, 1]

    See Also
    ========
    rmul, _af_rmul
     N/A a abc N/A m N/A len a N/A N/A m 3 N/A N/A N/A p0 p1 p2 a N/A N/A N/A p0 N/A N/A p1 N/A i N/A i p2 N/A N/A m 4 N/A N/A N/A p0 p1 p2 p3 a N/A N/A N/A p0 N/A N/A p1 N/A N/A p2 N/A i N/A i p3 N/A N/A m 5 N/A N/A N/A p0 p1 p2 p3 p4 a N/A N/A N/A p0 N/A N/A p1 N/A N/A p2 N/A N/A p3 N/A i N/A i p4 N/A N/A m 6 N/A N/A N/A p0 p1 p2 p3 p4 p5 a N/A N/A N/A p0 N/A N/A p1 N/A N/A p2 N/A N/A p3 N/A N/A p4 N/A i N/A i p5 N/A N/A m 7 N/A N/A N/A p0 p1 p2 p3 p4 p5 p6 a N/A N/A N/A p0 N/A N/A p1 N/A N/A p2 N/A N/A p3 N/A N/A p4 N/A N/A p5 N/A i N/A i p6 N/A N/A m 8 N/A N/A N/A p0 p1 p2 p3 p4 p5 p6 p7 a N/A N/A N/A p0 N/A N/A p1 N/A N/A p2 N/A N/A p3 N/A N/A p4 N/A N/A p5 N/A N/A p6 N/A i N/A i p7 N/A N/A m 1 N/A N/A N/A N/A a N/A 0 N/A N/A N/A m 2 N/A N/A N/A a b a N/A N/A N/A a N/A i N/A i b N/A N/A m 0 N/A N/A N/A ValueError String must not be empty N/A p0 N/A _af_rmuln N/A a N/A N/A m 2 N/A p1 N/A _af_rmuln N/A a N/A N/A m 2 N/A N/A N/A p0 N/A i N/A i p1 N/A _af_parity N/A N/A pi N/A N/A N/A 
    Computes the parity of a permutation in array form.

    The parity of a permutation reflects the parity of the
    number of inversions in the permutation, i.e., the
    number of pairs of x and y such that x > y but p[x] < p[y].

    Examples
    ========

    >>> from sympy.combinatorics.permutations import _af_parity
    >>> _af_parity([0, 1, 2, 3])
    0
    >>> _af_parity([3, 2, 0, 1])
    1

    See Also
    ========

    Permutation
     N/A n N/A len pi N/A a N/A N/A 0 n N/A c 0 N/A j N/A range n N/A N/A N/A N/A a N/A j 0 N/A N/A c 1 N/A N/A a N/A j 1 N/A i j N/A N/A N/A pi N/A i j N/A N/A i N/A pi N/A i N/A N/A a N/A i 1 N/A N/A N/A n c 2 N/A _af_invert N/A N/A a N/A N/A N/A 
    Finds the inverse, ~A, of a permutation, A, given in array form.

    Examples
    ========

    >>> from sympy.combinatorics.permutations import _af_invert, _af_rmul
    >>> A = [1, 2, 0, 3]
    >>> _af_invert(A)
    [2, 0, 1, 3]
    >>> _af_rmul(_, A)
    [0, 1, 2, 3]

    See Also
    ========

    Permutation, __invert__
     N/A inv_form N/A N/A 0 N/A len a N/A N/A i ai N/A enumerate a N/A N/A N/A inv_form N/A ai i N/A inv_form N/A _af_pow N/A N/A a n N/A N/A N/A 
    Routine for finding powers of a permutation.

    Examples
    ========

    >>> from sympy.combinatorics.permutations import Permutation, _af_pow
    >>> Permutation.print_cyclic = False
    >>> p = Permutation([2, 0, 3, 1])
    >>> p.order()
    4
    >>> _af_pow(p._array_form, 4)
    [0, 1, 2, 3]
     N/A N/A n 0 N/A N/A N/A list N/A range N/A len a N/A N/A n 0 N/A N/A N/A _af_pow N/A _af_invert a N/A n N/A N/A n 1 N/A N/A N/A a N/A N/A N/A N/A n 2 N/A N/A b N/A N/A a N/A i N/A i a N/A N/A N/A n 3 N/A N/A b N/A N/A a N/A N/A a N/A i N/A i a N/A N/A N/A n 4 N/A N/A b N/A N/A a N/A N/A a N/A N/A a N/A i N/A i a N/A N/A b N/A list N/A range N/A len a N/A 1 N/A N/A N/A n 1 N/A N/A b N/A N/A b N/A i N/A i a N/A n 1 N/A N/A n N/A N/A N/A N/A N/A n 4 0 N/A N/A a N/A N/A a N/A N/A a N/A N/A a N/A i N/A i a N/A n N/A n 4 N/A N/A N/A N/A n 2 0 N/A N/A a N/A N/A a N/A i N/A i a N/A n N/A n 2 N/A b N/A _af_commutes_with N/A N/A a b N/A N/A N/A 
    Checks if the two permutations with array forms
    given by ``a`` and ``b`` commute.

    Examples
    ========

    >>> from sympy.combinatorics.permutations import _af_commutes_with
    >>> _af_commutes_with([1, 2, 0], [0, 2, 1])
    False

    See Also
    ========

    Permutation, commutes_with
     N/A N/A N/A any N/A N/A N/A a N/A N/A b N/A i N/A b N/A N/A a N/A i N/A i N/A range N/A N/A len a 1 N/A Cycle N/A dict N/A N/A 
    Wrapper around dict which provides the functionality of a disjoint cycle.

    A cycle shows the rule to use to move subsets of elements to obtain
    a permutation. The Cycle class is more flexible than Permutation in
    that 1) all elements need not be present in order to investigate how
    multiple cycles act in sequence and 2) it can contain singletons:

    >>> from sympy.combinatorics.permutations import Perm, Cycle

    A Cycle will automatically parse a cycle given as a tuple on the rhs:

    >>> Cycle(1, 2)(2, 3)
    (1 3 2)

    The identity cycle, Cycle(), can be used to start a product:

    >>> Cycle()(1, 2)(2, 3)
    (1 3 2)

    The array form of a Cycle can be obtained by calling the list
    method (or passing it to the list function) and all elements from
    0 will be shown:

    >>> a = Cycle(1, 2)
    >>> a.list()
    [0, 2, 1]
    >>> list(a)
    [0, 2, 1]

    If a larger (or smaller) range is desired use the list method and
    provide the desired size -- but the Cycle cannot be truncated to
    a size smaller than the largest element that is out of place:

    >>> b = Cycle(2, 4)(1, 2)(3, 1, 4)(1, 3)
    >>> b.list()
    [0, 2, 1, 3, 4]
    >>> b.list(b.size + 1)
    [0, 2, 1, 3, 4, 5]
    >>> b.list(-1)
    [0, 2, 1]

    Singletons are not shown when printing with one exception: the largest
    element is always shown -- as a singleton if necessary:

    >>> Cycle(1, 4, 10)(4, 5)
    (1 5 4 10)
    >>> Cycle(1, 2)(4)(5)(10)
    (1 2)(10)

    The array form can be used to instantiate a Permutation so other
    properties of the permutation can be investigated:

    >>> Perm(Cycle(1, 2)(3, 4).list()).transpositions()
    [(1, 2), (3, 4)]

    Notes
    =====

    The underlying structure of the Cycle is a dictionary and although
    the __iter__ method has been redefined to give the array form of the
    cycle, the underlying dictionary items are still available with the
    such methods as items():

    >>> list(Cycle(1, 2).items())
    [(1, 2), (2, 1)]

    See Also
    ========

    Permutation
     __missing__ N/A N/A self arg N/A N/A N/A Enter arg into dictionary and return arg. N/A arg N/A as_int arg N/A N/A self N/A arg arg N/A arg N/A __iter__ N/A N/A self N/A N/A N/A i N/A N/A self list N/A N/A N/A i N/A __call__ N/A N/A self N/A other N/A N/A Return product of cycles processed from R to L.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Cycle as C
        >>> from sympy.combinatorics.permutations import Permutation as Perm
        >>> C(1, 2)(2, 3)
        (1 3 2)

        An instance of a Cycle will automatically parse list-like
        objects and Permutations that are on the right. It is more
        flexible than the Permutation in that all elements need not
        be present:

        >>> a = C(1, 2)
        >>> a(2, 3)
        (1 3 2)
        >>> a(2, 3)(4, 5)
        (1 3 2)(4 5)

         N/A rv N/A Cycle other N/A N/A k v N/A zip N/A list N/A N/A self keys N/A N/A rv N/A N/A self N/A k N/A k N/A N/A self keys N/A N/A N/A rv N/A k v N/A rv N/A list N/A N/A self size N/A None N/A N/A Return the cycles as an explicit list starting from 0 up
        to the greater of the largest value in the cycles and size.

        Truncation of trailing unmoved items will occur when size
        is less than the maximum element in the cycle; if this is
        desired, setting ``size=-1`` will guarantee such trimming.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Cycle
        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Cycle(2, 3)(4, 5)
        >>> p.list()
        [0, 1, 3, 2, 5, 4]
        >>> p.list(10)
        [0, 1, 3, 2, 5, 4, 6, 7, 8, 9]

        Passing a length too small will trim trailing, unchanged elements
        in the permutation:

        >>> Cycle(2, 4)(1, 2, 4).list(-1)
        [0, 2, 1]
         N/A N/A N/A self N/A size None N/A N/A N/A ValueError must give size for empty Cycle N/A N/A size None N/A N/A big N/A max N/A N/A i N/A i N/A N/A self keys N/A N/A self N/A i i N/A 0 N/A size N/A max size N/A big 1 N/A N/A size N/A self size N/A N/A N/A self N/A i N/A i N/A range size N/A __repr__ N/A N/A self N/A N/A N/A We want it to print as a Cycle, not as a dict.

        Examples
        ========

        >>> from sympy.combinatorics import Cycle
        >>> Cycle(1, 2)
        (1 2)
        >>> print(_)
        (1 2)
        >>> list(Cycle(1, 2).items())
        [(1, 2), (2, 1)]
         N/A N/A self N/A N/A Cycle() N/A cycles N/A N/A Permutation self cyclic_form N/A s N/A N/A join N/A N/A str N/A tuple c N/A c cycles N/A big N/A N/A self size 1 N/A N/A N/A any N/A N/A i big N/A c cycles N/A i c N/A N/A s N/A (%s) big N/A N/A Cycle%s s N/A __str__ N/A N/A self N/A N/A N/A We want it to be printed in a Cycle notation with no
        comma in-between.

        Examples
        ========

        >>> from sympy.combinatorics import Cycle
        >>> Cycle(1, 2)
        (1 2)
        >>> Cycle(1, 2, 4)(5, 6)
        (1 2 4)(5 6)
         N/A N/A self N/A N/A () N/A cycles N/A N/A Permutation self cyclic_form N/A s N/A N/A join N/A N/A str N/A tuple c N/A c cycles N/A big N/A N/A self size 1 N/A N/A N/A any N/A N/A i big N/A c cycles N/A i c N/A N/A s N/A (%s) big N/A s N/A N/A s replace , N/A s N/A __init__ N/A N/A self N/A args N/A N/A Load up a Cycle instance with the values for the cycle.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Cycle
        >>> Cycle(1, 2, 6)
        (1 2 6)
         N/A N/A args N/A N/A N/A N/A N/A len args 1 N/A N/A N/A isinstance N/A args N/A 0 Permutation N/A N/A c N/A N/A args N/A 0 cyclic_form N/A N/A N/A N/A self update N/A self c N/A N/A N/A N/A isinstance N/A args N/A 0 Cycle N/A N/A N/A k v N/A N/A N/A args N/A 0 items N/A N/A N/A self N/A k v N/A N/A args N/A N/A as_int a N/A a args N/A N/A any N/A N/A i 0 N/A i args N/A N/A N/A ValueError negative integers are not allowed in a cycle. N/A N/A has_dups args N/A N/A N/A ValueError All elements must be unique in a cycle. N/A i N/A range N/A N/A len args 0 N/A N/A N/A self N/A N/A args N/A i N/A args N/A N/A i 1 N/A size N/A N/A self N/A N/A N/A N/A self N/A N/A 0 N/A N/A N/A max N/A N/A self keys 1 N/A property copy N/A N/A self N/A N/A N/A N/A Cycle self N/A N/A Permutation N/A Basic N/A N/A 
    A permutation, alternatively known as an 'arrangement number' or 'ordering'
    is an arrangement of the elements of an ordered list into a one-to-one
    mapping with itself. The permutation of a given arrangement is given by
    indicating the positions of the elements after re-arrangement [2]_. For
    example, if one started with elements [x, y, a, b] (in that order) and
    they were reordered as [x, y, b, a] then the permutation would be
    [0, 1, 3, 2]. Notice that (in SymPy) the first element is always referred
    to as 0 and the permutation uses the indices of the elements in the
    original ordering, not the elements (a, b, etc...) themselves.

    >>> from sympy.combinatorics import Permutation
    >>> Permutation.print_cyclic = False

    Permutations Notation
    =====================

    Permutations are commonly represented in disjoint cycle or array forms.

    Array Notation and 2-line Form
    ------------------------------------

    In the 2-line form, the elements and their final positions are shown
    as a matrix with 2 rows:

    [0    1    2     ... n-1]
    [p(0) p(1) p(2)  ... p(n-1)]

    Since the first line is always range(n), where n is the size of p,
    it is sufficient to represent the permutation by the second line,
    referred to as the "array form" of the permutation. This is entered
    in brackets as the argument to the Permutation class:

    >>> p = Permutation([0, 2, 1]); p
    Permutation([0, 2, 1])

    Given i in range(p.size), the permutation maps i to i^p

    >>> [i^p for i in range(p.size)]
    [0, 2, 1]

    The composite of two permutations p*q means first apply p, then q, so
    i^(p*q) = (i^p)^q which is i^p^q according to Python precedence rules:

    >>> q = Permutation([2, 1, 0])
    >>> [i^p^q for i in range(3)]
    [2, 0, 1]
    >>> [i^(p*q) for i in range(3)]
    [2, 0, 1]

    One can use also the notation p(i) = i^p, but then the composition
    rule is (p*q)(i) = q(p(i)), not p(q(i)):

    >>> [(p*q)(i) for i in range(p.size)]
    [2, 0, 1]
    >>> [q(p(i)) for i in range(p.size)]
    [2, 0, 1]
    >>> [p(q(i)) for i in range(p.size)]
    [1, 2, 0]

    Disjoint Cycle Notation
    -----------------------

    In disjoint cycle notation, only the elements that have shifted are
    indicated. In the above case, the 2 and 1 switched places. This can
    be entered in two ways:

    >>> Permutation(1, 2) == Permutation([[1, 2]]) == p
    True

    Only the relative ordering of elements in a cycle matter:

    >>> Permutation(1,2,3) == Permutation(2,3,1) == Permutation(3,1,2)
    True

    The disjoint cycle notation is convenient when representing permutations
    that have several cycles in them:

    >>> Permutation(1, 2)(3, 5) == Permutation([[1, 2], [3, 5]])
    True

    It also provides some economy in entry when computing products of
    permutations that are written in disjoint cycle notation:

    >>> Permutation(1, 2)(1, 3)(2, 3)
    Permutation([0, 3, 2, 1])
    >>> _ == Permutation([[1, 2]])*Permutation([[1, 3]])*Permutation([[2, 3]])
    True

    Entering a singleton in a permutation is a way to indicate the size of the
    permutation. The ``size`` keyword can also be used.

    Array-form entry:

    >>> Permutation([[1, 2], [9]])
    Permutation([0, 2, 1], size=10)
    >>> Permutation([[1, 2]], size=10)
    Permutation([0, 2, 1], size=10)

    Cyclic-form entry:

    >>> Permutation(1, 2, size=10)
    Permutation([0, 2, 1], size=10)
    >>> Permutation(9)(1, 2)
    Permutation([0, 2, 1], size=10)

    Caution: no singleton containing an element larger than the largest
    in any previous cycle can be entered. This is an important difference
    in how Permutation and Cycle handle the __call__ syntax. A singleton
    argument at the start of a Permutation performs instantiation of the
    Permutation and is permitted:

    >>> Permutation(5)
    Permutation([], size=6)

    A singleton entered after instantiation is a call to the permutation
    -- a function call -- and if the argument is out of range it will
    trigger an error. For this reason, it is better to start the cycle
    with the singleton:

    The following fails because there is is no element 3:

    >>> Permutation(1, 2)(3)
    Traceback (most recent call last):
    ...
    IndexError: list index out of range

    This is ok: only the call to an out of range singleton is prohibited;
    otherwise the permutation autosizes:

    >>> Permutation(3)(1, 2)
    Permutation([0, 2, 1, 3])
    >>> Permutation(1, 2)(3, 4) == Permutation(3, 4)(1, 2)
    True


    Equality testing
    ----------------

    The array forms must be the same in order for permutations to be equal:

    >>> Permutation([1, 0, 2, 3]) == Permutation([1, 0])
    False


    Identity Permutation
    --------------------

    The identity permutation is a permutation in which no element is out of
    place. It can be entered in a variety of ways. All the following create
    an identity permutation of size 4:

    >>> I = Permutation([0, 1, 2, 3])
    >>> all(p == I for p in [
    ... Permutation(3),
    ... Permutation(range(4)),
    ... Permutation([], size=4),
    ... Permutation(size=4)])
    True

    Watch out for entering the range *inside* a set of brackets (which is
    cycle notation):

    >>> I == Permutation([range(4)])
    False


    Permutation Printing
    ====================

    There are a few things to note about how Permutations are printed.

    1) If you prefer one form (array or cycle) over another, you can set that
    with the print_cyclic flag.

    >>> Permutation(1, 2)(4, 5)(3, 4)
    Permutation([0, 2, 1, 4, 5, 3])
    >>> p = _

    >>> Permutation.print_cyclic = True
    >>> p
    (1 2)(3 4 5)
    >>> Permutation.print_cyclic = False

    2) Regardless of the setting, a list of elements in the array for cyclic
    form can be obtained and either of those can be copied and supplied as
    the argument to Permutation:

    >>> p.array_form
    [0, 2, 1, 4, 5, 3]
    >>> p.cyclic_form
    [[1, 2], [3, 4, 5]]
    >>> Permutation(_) == p
    True

    3) Printing is economical in that as little as possible is printed while
    retaining all information about the size of the permutation:

    >>> Permutation([1, 0, 2, 3])
    Permutation([1, 0, 2, 3])
    >>> Permutation([1, 0, 2, 3], size=20)
    Permutation([1, 0], size=20)
    >>> Permutation([1, 0, 2, 4, 3, 5, 6], size=20)
    Permutation([1, 0, 2, 4, 3], size=20)

    >>> p = Permutation([1, 0, 2, 3])
    >>> Permutation.print_cyclic = True
    >>> p
    (3)(0 1)
    >>> Permutation.print_cyclic = False

    The 2 was not printed but it is still there as can be seen with the
    array_form and size methods:

    >>> p.array_form
    [1, 0, 2, 3]
    >>> p.size
    4

    Short introduction to other methods
    ===================================

    The permutation can act as a bijective function, telling what element is
    located at a given position

    >>> q = Permutation([5, 2, 3, 4, 1, 0])
    >>> q.array_form[1] # the hard way
    2
    >>> q(1) # the easy way
    2
    >>> {i: q(i) for i in range(q.size)} # showing the bijection
    {0: 5, 1: 2, 2: 3, 3: 4, 4: 1, 5: 0}

    The full cyclic form (including singletons) can be obtained:

    >>> p.full_cyclic_form
    [[0, 1], [2], [3]]

    Any permutation can be factored into transpositions of pairs of elements:

    >>> Permutation([[1, 2], [3, 4, 5]]).transpositions()
    [(1, 2), (3, 5), (3, 4)]
    >>> Permutation.rmul(*[Permutation([ti], size=6) for ti in _]).cyclic_form
    [[1, 2], [3, 4, 5]]

    The number of permutations on a set of n elements is given by n! and is
    called the cardinality.

    >>> p.size
    4
    >>> p.cardinality
    24

    A given permutation has a rank among all the possible permutations of the
    same elements, but what that rank is depends on how the permutations are
    enumerated. (There are a number of different methods of doing so.) The
    lexicographic rank is given by the rank method and this rank is used to
    increment a permutation with addition/subtraction:

    >>> p.rank()
    6
    >>> p + 1
    Permutation([1, 0, 3, 2])
    >>> p.next_lex()
    Permutation([1, 0, 3, 2])
    >>> _.rank()
    7
    >>> p.unrank_lex(p.size, rank=7)
    Permutation([1, 0, 3, 2])

    The product of two permutations p and q is defined as their composition as
    functions, (p*q)(i) = q(p(i)) [6]_.

    >>> p = Permutation([1, 0, 2, 3])
    >>> q = Permutation([2, 3, 1, 0])
    >>> list(q*p)
    [2, 3, 0, 1]
    >>> list(p*q)
    [3, 2, 1, 0]
    >>> [q(p(i)) for i in range(p.size)]
    [3, 2, 1, 0]

    The permutation can be 'applied' to any list-like object, not only
    Permutations:

    >>> p(['zero', 'one', 'four', 'two'])
     ['one', 'zero', 'four', 'two']
    >>> p('zo42')
    ['o', 'z', '4', '2']

    If you have a list of arbitrary elements, the corresponding permutation
    can be found with the from_sequence method:

    >>> Permutation.from_sequence('SymPy')
    Permutation([1, 3, 2, 0, 4])

    See Also
    ========

    Cycle

    References
    ==========

    .. [1] Skiena, S. 'Permutations.' 1.1 in Implementing Discrete Mathematics
           Combinatorics and Graph Theory with Mathematica.  Reading, MA:
           Addison-Wesley, pp. 3-16, 1990.

    .. [2] Knuth, D. E. The Art of Computer Programming, Vol. 4: Combinatorial
           Algorithms, 1st ed. Reading, MA: Addison-Wesley, 2011.

    .. [3] Wendy Myrvold and Frank Ruskey. 2001. Ranking and unranking
           permutations in linear time. Inf. Process. Lett. 79, 6 (September 2001),
           281-284. DOI=10.1016/S0020-0190(01)00141-7

    .. [4] D. L. Kreher, D. R. Stinson 'Combinatorial Algorithms'
           CRC Press, 1999

    .. [5] Graham, R. L.; Knuth, D. E.; and Patashnik, O.
           Concrete Mathematics: A Foundation for Computer Science, 2nd ed.
           Reading, MA: Addison-Wesley, 1994.

    .. [6] http://en.wikipedia.org/wiki/Permutation#Product_and_inverse

    .. [7] http://en.wikipedia.org/wiki/Lehmer_code

     N/A is_Permutation True N/A _array_form None N/A _cyclic_form None N/A _cycle_structure None N/A _size None N/A _rank None __new__ N/A N/A cls N/A args kwargs N/A N/A 
        Constructor for the Permutation object from a list or a
        list of lists in which all elements of the permutation may
        appear only once.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False

        Permutations entered in array-form are left unaltered:

        >>> Permutation([0, 2, 1])
        Permutation([0, 2, 1])

        Permutations entered in cyclic form are converted to array form;
        singletons need not be entered, but can be entered to indicate the
        largest element:

        >>> Permutation([[4, 5, 6], [0, 1]])
        Permutation([1, 0, 2, 3, 5, 6, 4])
        >>> Permutation([[4, 5, 6], [0, 1], [19]])
        Permutation([1, 0, 2, 3, 5, 6, 4], size=20)

        All manipulation of permutations assumes that the smallest element
        is 0 (in keeping with 0-based indexing in Python) so if the 0 is
        missing when entering a permutation in array form, an error will be
        raised:

        >>> Permutation([2, 1])
        Traceback (most recent call last):
        ...
        ValueError: Integers 0 through 2 must be present.

        If a permutation is entered in cyclic form, it can be entered without
        singletons and the ``size`` specified so those values can be filled
        in, otherwise the array form will only extend to the maximum value
        in the cycles:

        >>> Permutation([[1, 4], [3, 5, 2]], size=10)
        Permutation([0, 4, 3, 5, 1, 2], size=10)
        >>> _.array_form
        [0, 4, 3, 5, 1, 2, 6, 7, 8, 9]
         N/A size N/A N/A kwargs pop size None N/A N/A size None N/A N/A size N/A int size N/A ok True N/A N/A args N/A N/A N/A _af_new N/A list N/A range N/A size 0 N/A N/A N/A N/A len args 1 N/A N/A N/A _af_new N/A N/A N/A Cycle args list size N/A N/A N/A len args 1 N/A N/A a N/A args N/A 0 N/A N/A isinstance a Perm N/A N/A N/A N/A size None N/A size N/A a size N/A N/A a N/A N/A Perm N/A a array_form size size N/A N/A isinstance a Cycle N/A N/A N/A _af_new N/A N/A a list size N/A N/A N/A is_sequence a N/A N/A N/A _af_new N/A list N/A range N/A a 1 N/A N/A has_variety N/A N/A is_sequence ai N/A ai a N/A N/A ok False N/A N/A ok False N/A N/A ok N/A N/A N/A ValueError Permutation argument must be a list of ints, a list of lists, Permutation or Cycle. N/A args N/A list N/A args N/A 0 N/A is_cycle N/A args N/A is_sequence N/A args N/A 0 N/A is_cycle N/A N/A args N/A N/A N/A int i N/A i c N/A c args N/A N/A args N/A N/A int i N/A i args N/A temp N/A flatten args N/A N/A has_dups temp N/A N/A is_cycle N/A N/A N/A ValueError N/A there were repeated elements; to resolve cycles use Cycle%s. N/A N/A join N/A N/A str N/A tuple c N/A c args N/A N/A N/A ValueError there were repeated elements. N/A temp N/A set temp N/A N/A N/A is_cycle N/A any N/A N/A i temp N/A i N/A range N/A len temp N/A N/A N/A ValueError N/A Integers 0 through %s must be present. N/A max temp N/A is_cycle N/A N/A c N/A Cycle N/A ci args N/A N/A c N/A c ci N/A aform N/A N/A c list N/A N/A aform N/A list args N/A N/A size N/A size N/A len aform N/A N/A N/A N/A aform extend N/A list N/A range N/A len aform size N/A size N/A len aform N/A obj N/A N/A Basic __new__ cls aform N/A N/A obj _array_form aform N/A N/A obj _size size N/A obj N/A _af_new N/A N/A perm N/A N/A N/A A method to produce a Permutation object from a list;
        the list is bound to the _array_form attribute, so it must
        not be modified; this method is meant for internal use only;
        the list ``a`` is supposed to be generated as a temporary value
        in a method, so p = Perm._af_new(a) is the only object
        to hold a reference to ``a``::

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Perm
        >>> Perm.print_cyclic = False
        >>> a = [2,1,3,0]
        >>> p = Perm._af_new(a)
        >>> p
        Permutation([2, 1, 3, 0])

         N/A p N/A N/A Basic __new__ Perm perm N/A N/A p _array_form perm N/A N/A p _size N/A len perm N/A p N/A staticmethod _hashable_content N/A N/A self N/A N/A N/A N/A tuple N/A self array_form N/A array_form N/A N/A self N/A N/A N/A 
        Return a copy of the attribute _array_form
        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation([[2, 0], [3, 1]])
        >>> p.array_form
        [2, 3, 0, 1]
        >>> Permutation([[2, 0, 3, 1]]).array_form
        [3, 2, 0, 1]
        >>> Permutation([2, 0, 3, 1]).array_form
        [2, 0, 3, 1]
        >>> Permutation([[1, 2], [4, 5]]).array_form
        [0, 2, 1, 3, 5, 4]
         N/A N/A N/A self _array_form N/A N/A property __repr__ N/A N/A self N/A N/A sympy.combinatorics.permutations Permutation Cycle N/A N/A Permutation print_cyclic N/A N/A N/A N/A self size N/A N/A Permutation() N/A s N/A N/A N/A N/A N/A Cycle self N/A N/A self size 1 __repr__ N/A N/A len Cycle N/A last N/A N/A s rfind ( N/A N/A N/A N/A last 0 N/A , N/A s N/A last N/A N/A s N/A N/A s N/A last N/A s N/A last N/A N/A Permutation%s s N/A N/A s N/A N/A self support N/A N/A s N/A N/A N/A N/A self size 5 N/A N/A N/A Permutation(%s) N/A str N/A self array_form N/A N/A Permutation([], size=%s) N/A self size N/A trim N/A N/A str N/A N/A self array_form N/A N/A N/A s N/A -1 1 N/A , size=%s N/A self size N/A use full N/A str N/A self array_form N/A N/A N/A len trim N/A len full N/A N/A use trim N/A N/A Permutation%s use N/A list N/A N/A self size N/A None N/A N/A Return the permutation as an explicit list, possibly
        trimming unmoved elements if size is less than the maximum
        element in the permutation; if this is desired, setting
        ``size=-1`` will guarantee such trimming.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation(2, 3)(4, 5)
        >>> p.list()
        [0, 1, 3, 2, 5, 4]
        >>> p.list(10)
        [0, 1, 3, 2, 5, 4, 6, 7, 8, 9]

        Passing a length too small will trim trailing, unchanged elements
        in the permutation:

        >>> Permutation(2, 4)(1, 2, 4).list(-1)
        [0, 2, 1]
        >>> Permutation(3).list(-1)
        []
         N/A N/A N/A self N/A size None N/A N/A N/A ValueError must give size for empty Cycle N/A rv N/A self array_form N/A N/A size None N/A N/A N/A size N/A self size N/A N/A N/A N/A rv extend N/A list N/A range N/A self size size N/A N/A i N/A N/A self size 1 N/A rv N/A N/A N/A N/A rv N/A -1 i N/A N/A N/A N/A N/A rv pop N/A i 1 N/A rv N/A cyclic_form N/A N/A self N/A N/A N/A 
        This is used to convert to the cyclic notation
        from the canonical notation. Singletons are omitted.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation([0, 3, 1, 2])
        >>> p.cyclic_form
        [[1, 3, 2]]
        >>> Permutation([1, 0, 2, 4, 3, 5]).cyclic_form
        [[0, 1], [3, 4]]

        See Also
        ========

        array_form, full_cyclic_form
         N/A N/A N/A self _cyclic_form None N/A N/A N/A list N/A self _cyclic_form N/A array_form N/A self array_form N/A unchecked N/A N/A True N/A len array_form N/A cyclic_form N/A N/A i N/A range N/A len array_form N/A N/A N/A unchecked N/A i N/A N/A cycle N/A N/A N/A N/A cycle append i N/A N/A unchecked N/A i False N/A j i N/A N/A unchecked N/A N/A array_form N/A j N/A N/A j N/A array_form N/A j N/A N/A N/A cycle append j N/A N/A unchecked N/A j False N/A N/A N/A len cycle 1 N/A N/A N/A N/A cyclic_form append cycle N/A N/A cycle N/A list N/A minlex cycle is_set True N/A N/A N/A cyclic_form sort N/A N/A self _cyclic_form N/A cyclic_form N/A N/A cyclic_form N/A property full_cyclic_form N/A N/A self N/A N/A N/A Return permutation in cyclic form including singletons.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation([0, 2, 1]).full_cyclic_form
        [[0], [1, 2]]
         N/A need N/A N/A set N/A range N/A self size N/A set N/A flatten N/A self cyclic_form N/A rv N/A self cyclic_form N/A N/A N/A rv extend N/A N/A i N/A i need N/A N/A N/A rv sort N/A rv N/A property size N/A N/A self N/A N/A N/A 
        Returns the number of elements in the permutation.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation([[3, 2], [0, 1]]).size
        4

        See Also
        ========

        cardinality, length, order, rank
         N/A N/A self _size N/A property support N/A N/A self N/A N/A N/A Return the elements in permutation, P, for which P[i] != i.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> p = Permutation([[3, 2], [0, 1], [4]])
        >>> p.array_form
        [1, 0, 3, 2, 4]
        >>> p.support()
        [0, 1, 2, 3]
         N/A a N/A self array_form N/A N/A i N/A N/A i e N/A enumerate a N/A N/A a N/A i i N/A __add__ N/A N/A self other N/A N/A N/A Return permutation that is other higher in rank than self.

        The rank is the lexicographical rank, with the identity permutation
        having rank of 0.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> I = Permutation([0, 1, 2, 3])
        >>> a = Permutation([2, 1, 3, 0])
        >>> I + a.rank() == a
        True

        See Also
        ========

        __sub__, inversion_vector

         N/A rank N/A N/A N/A N/A self rank other N/A self cardinality N/A rv N/A N/A Perm unrank_lex N/A self size rank N/A N/A rv _rank rank N/A rv N/A __sub__ N/A N/A self other N/A N/A N/A Return the permutation that is other lower in rank than self.

        See Also
        ========

        __add__
         N/A N/A N/A self __add__ N/A other N/A rmul N/A N/A N/A args N/A N/A 
        Return product of Permutations [a, b, c, ...] as the Permutation whose
        ith value is a(b(c(i))).

        a, b, c, ... can be Permutation objects or tuples.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import _af_rmul, Permutation
        >>> Permutation.print_cyclic = False

        >>> a, b = [1, 0, 2], [0, 2, 1]
        >>> a = Permutation(a); b = Permutation(b)
        >>> list(Permutation.rmul(a, b))
        [1, 2, 0]
        >>> [a(b(i)) for i in range(3)]
        [1, 2, 0]

        This handles the operands in reverse order compared to the ``*`` operator:

        >>> a = Permutation(a); b = Permutation(b)
        >>> list(a*b)
        [2, 0, 1]
        >>> [b(a(i)) for i in range(3)]
        [2, 0, 1]

        Notes
        =====

        All items in the sequence will be parsed by Permutation as
        necessary as long as the first item is a Permutation:

        >>> Permutation.rmul(a, [0, 2, 1]) == Permutation.rmul(a, b)
        True

        The reverse order of arguments will raise a TypeError.

         N/A rv N/A args N/A 0 N/A i N/A range 1 N/A len args N/A N/A rv N/A N/A args N/A i rv N/A rv N/A staticmethod rmul_with_af N/A N/A N/A args N/A N/A 
        same as rmul, but the elements of args are Permutation objects
        which have _array_form
         N/A a N/A N/A x _array_form N/A x args N/A rv N/A _af_new N/A _af_rmuln a N/A rv N/A staticmethod mul_inv N/A N/A self other N/A N/A N/A 
        other*~self, self and other have _array_form
         N/A a N/A _af_invert N/A self _array_form N/A b N/A other _array_form N/A N/A _af_new N/A _af_rmul a b N/A __rmul__ N/A N/A self other N/A N/A N/A This is needed to coerse other to Permutation in rmul. N/A N/A N/A Perm other self N/A __mul__ N/A N/A self other N/A N/A N/A 
        Return the product a*b as a Permutation; the ith value is b(a(i)).

        Examples
        ========

        >>> from sympy.combinatorics.permutations import _af_rmul, Permutation
        >>> Permutation.print_cyclic = False

        >>> a, b = [1, 0, 2], [0, 2, 1]
        >>> a = Permutation(a); b = Permutation(b)
        >>> list(a*b)
        [2, 0, 1]
        >>> [b(a(i)) for i in range(3)]
        [2, 0, 1]

        This handles operands in reverse order compared to _af_rmul and rmul:

        >>> al = list(a); bl = list(b)
        >>> _af_rmul(al, bl)
        [1, 2, 0]
        >>> [al[bl[i]] for i in range(3)]
        [1, 2, 0]

        It is acceptable for the arrays to have different lengths; the shorter
        one will be padded to match the longer one:

        >>> b*Permutation([1, 0])
        Permutation([1, 2, 0])
        >>> Permutation([1, 0])*b
        Permutation([2, 0, 1])

        It is also acceptable to allow coercion to handle conversion of a
        single list to the left of a Permutation:

        >>> [0, 1]*a # no change: 2-element identity
        Permutation([1, 0, 2])
        >>> [[0, 1]]*a # exchange first two elements
        Permutation([0, 1, 2])

        You cannot use more than 1 cycle notation in a product of cycles
        since coercion can only handle one argument to the left. To handle
        multiple cycles it is convenient to use Cycle instead of Permutation:

        >>> [[1, 2]]*[[2, 3]]*Permutation([]) # doctest: +SKIP
        >>> from sympy.combinatorics.permutations import Cycle
        >>> Cycle(1, 2)(2, 3)
        (1 3 2)

         N/A a N/A self array_form N/A b N/A other array_form N/A N/A b N/A N/A perm a N/A N/A N/A N/A b extend N/A list N/A range N/A len b N/A len a N/A perm N/A N/A N/A b N/A i N/A i a N/A b N/A N/A len a N/A N/A _af_new perm N/A commutes_with N/A N/A self other N/A N/A N/A 
        Checks if the elements are commuting.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> a = Permutation([1, 4, 3, 0, 2, 5])
        >>> b = Permutation([0, 1, 2, 3, 4, 5])
        >>> a.commutes_with(b)
        True
        >>> b = Permutation([2, 3, 5, 4, 1, 0])
        >>> a.commutes_with(b)
        False
         N/A a N/A self array_form N/A b N/A other array_form N/A N/A _af_commutes_with a b N/A __pow__ N/A N/A self n N/A N/A N/A 
        Routine for finding powers of a permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation([2,0,3,1])
        >>> p.order()
        4
        >>> p**4
        Permutation([0, 1, 2, 3])
         N/A N/A N/A type n Perm N/A N/A N/A NotImplementedError p**p is not defined; do you mean p^p (conjugate)? N/A n N/A int n N/A N/A _af_new N/A _af_pow N/A self array_form n N/A __rxor__ N/A N/A self i N/A N/A N/A Return self(i) when ``i`` is an int.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> p = Permutation(1, 2, 9)
        >>> 2^p == p(2) == 9
        True
         N/A N/A N/A int i i N/A N/A N/A self i N/A N/A N/A NotImplementedError N/A i^p = p(i) when i is an integer, not %s. i N/A __xor__ N/A N/A self h N/A N/A N/A Return the conjugate permutation ``~h*self*h` `.

        If ``a`` and ``b`` are conjugates, ``a = h*b*~h`` and
        ``b = ~h*a*h`` and both have the same cycle structure.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = True
        >>> p = Permutation(1, 2, 9)
        >>> q = Permutation(6, 9, 8)
        >>> p*q != q*p
        True

        Calculate and check properties of the conjugate:

        >>> c = p^q
        >>> c == ~q*p*q and p == q*c*~q
        True

        The expression q^p^r is equivalent to q^(p*r):

        >>> r = Permutation(9)(4, 6, 8)
        >>> q^p^r == q^(p*r)
        True

        If the term to the left of the conjugate operator, i, is an integer
        then this is interpreted as selecting the ith element from the
        permutation to the right:

        >>> all(i^p == p(i) for i in range(p.size))
        True

        Note that the * operator as higher precedence than the ^ operator:

        >>> q^r*p^r == q^(r*p)^r == Permutation(9)(1, 6, 4)
        True

        Notes
        =====

        In Python the precedence rule is p^q^r = (p^q)^r which differs
        in general from p^(q^r)

        >>> q^p^r
        (9)(1 4 8)
        >>> q^(p^r)
        (9)(1 8 6)

        For a given r and p, both of the following are conjugates of p:
        ~r*p*r and r*p*~r. But these are not necessarily the same:

        >>> ~r*p*r == r*p*~r
        True

        >>> p = Permutation(1, 2, 9)(5, 6)
        >>> ~r*p*r == r*p*~r
        False

        The conjugate ~r*p*r was chosen so that ``p^q^r`` would be equivalent
        to ``p^(q*r)`` rather than ``p^(r*q)``. To obtain r*p*~r, pass ~r to
        this method:

        >>> p^~r == r*p*~r
        True
         N/A N/A N/A self size N/A h size N/A N/A N/A ValueError The permutations must be of equal size. N/A a N/A N/A None N/A self size N/A h N/A h _array_form N/A p N/A self _array_form N/A i N/A range N/A self size N/A N/A N/A a N/A N/A h N/A i N/A h N/A N/A p N/A i N/A N/A _af_new a N/A transpositions N/A N/A self N/A N/A N/A 
        Return the permutation decomposed into a list of transpositions.

        It is always possible to express a permutation as the product of
        transpositions, see [1]

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([[1, 2, 3], [0, 4, 5, 6, 7]])
        >>> t = p.transpositions()
        >>> t
        [(0, 7), (0, 6), (0, 5), (0, 4), (1, 3), (1, 2)]
        >>> print(''.join(str(c) for c in t))
        (0, 7)(0, 6)(0, 5)(0, 4)(1, 3)(1, 2)
        >>> Permutation.rmul(*[Permutation([ti], size=p.size) for ti in t]) == p
        True

        References
        ==========

        1. http://en.wikipedia.org/wiki/Transposition_%28mathematics%29#Properties

         N/A a N/A self cyclic_form N/A res N/A N/A x a N/A N/A nx N/A len x N/A N/A nx 2 N/A N/A N/A N/A res append N/A tuple x N/A N/A N/A nx 2 N/A N/A first N/A x N/A 0 N/A y N/A x N/A N/A nx 1 0 -1 N/A N/A N/A N/A res append N/A first y N/A res N/A from_sequence N/A N/A self i key N/A None N/A N/A Return the permutation needed to obtain ``i`` from the sorted
        elements of ``i``. If custom sorting is desired, a key can be given.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation.print_cyclic = True

        >>> Permutation.from_sequence('SymPy')
        (4)(0 1 3)
        >>> _(sorted("SymPy"))
        ['S', 'y', 'm', 'P', 'y']
        >>> Permutation.from_sequence('SymPy', key=lambda x: x.lower())
        (4)(0 2)(1 3)
         N/A ic N/A list N/A zip i N/A list N/A range N/A len i N/A key N/A N/A N/A N/A ic sort key N/A N/A N/A x N/A N/A key N/A x N/A 0 N/A N/A N/A N/A ic sort N/A N/A N/A Permutation N/A N/A i N/A 1 N/A i ic N/A classmethod __invert__ N/A N/A self N/A N/A N/A 
        Return the inverse of the permutation.

        A permutation multiplied by its inverse is the identity permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([[2,0], [3,1]])
        >>> ~p
        Permutation([2, 3, 0, 1])
        >>> _ == p**-1
        True
        >>> p*~p == ~p*p == Permutation([0, 1, 2, 3])
        True
         N/A N/A _af_new N/A _af_invert N/A self _array_form N/A __iter__ N/A N/A self N/A N/A N/A Yield elements from array form.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> list(Permutation(range(3)))
        [0, 1, 2]
         N/A i N/A self array_form N/A N/A N/A i N/A __call__ N/A N/A self N/A i N/A N/A 
        Allows applying a permutation instance as a bijective function.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([[2, 0], [3, 1]])
        >>> p.array_form
        [2, 3, 0, 1]
        >>> [p(i) for i in range(4)]
        [2, 3, 0, 1]

        If an array is given then the permutation selects the items
        from the array (i.e. the permutation is applied to the array):

        >>> from sympy.abc import x
        >>> p([x, 1, 0, x**2])
        [0, x**2, x, 1]
         N/A N/A N/A len i 1 N/A N/A i N/A i N/A 0 N/A N/A N/A N/A N/A self _array_form N/A i N/A N/A N/A TypeError N/A N/A N/A N/A N/A N/A i N/A j N/A j N/A self _array_form N/A N/A N/A Exception N/A N/A N/A TypeError unrecognized argument N/A N/A N/A self N/A Permutation N/A Cycle i size N/A self size N/A atoms N/A N/A self N/A N/A N/A 
        Returns all the elements of a permutation

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation([0, 1, 2, 3, 4, 5]).atoms()
        set([0, 1, 2, 3, 4, 5])
        >>> Permutation([[0, 1], [2, 3], [4, 5]]).atoms()
        set([0, 1, 2, 3, 4, 5])
         N/A N/A set N/A self array_form N/A next_lex N/A N/A self N/A N/A N/A 
        Returns the next permutation in lexicographical order.
        If self is the last permutation in lexicographical order
        it returns None.
        See [4] section 2.4.


        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([2, 3, 1, 0])
        >>> p = Permutation([2, 3, 1, 0]); p.rank()
        17
        >>> p = p.next_lex(); p.rank()
        18

        See Also
        ========

        rank, unrank_lex
         N/A perm N/A N/A self array_form N/A N/A n N/A len perm N/A i N/A n 2 N/A N/A N/A perm N/A N/A i 1 N/A perm N/A i N/A N/A i 1 N/A N/A i -1 N/A N/A None N/A N/A j N/A n 1 N/A N/A N/A perm N/A j N/A perm N/A i N/A N/A j 1 N/A N/A N/A perm N/A j N/A perm N/A i N/A N/A perm N/A i N/A perm N/A j N/A i 1 N/A j N/A n 1 N/A N/A i j N/A N/A N/A N/A perm N/A j N/A perm N/A i N/A N/A perm N/A i N/A perm N/A j N/A i 1 N/A j 1 N/A N/A _af_new perm N/A unrank_nonlex N/A N/A self n r N/A N/A N/A 
        This is a linear time unranking algorithm that does not
        respect lexicographic order [3].

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> Permutation.unrank_nonlex(4, 5)
        Permutation([2, 0, 3, 1])
        >>> Permutation.unrank_nonlex(4, -1)
        Permutation([0, 1, 2, 3])

        See Also
        ========

        next_nonlex, rank_nonlex
         _unrank1 N/A N/A n r a N/A N/A N/A N/A n 0 N/A N/A N/A N/A a N/A N/A n 1 N/A a N/A N/A r n N/A N/A a N/A N/A r n N/A a N/A N/A n 1 N/A N/A _unrank1 N/A n 1 N/A r n a N/A N/A id_perm N/A list N/A range n N/A n N/A int n N/A r N/A r N/A ifac n N/A N/A _unrank1 n r id_perm N/A N/A _af_new id_perm N/A classmethod rank_nonlex N/A N/A self inv_perm N/A None N/A N/A 
        This is a linear time ranking algorithm that does not
        enforce lexicographic order [3].


        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3])
        >>> p.rank_nonlex()
        23

        See Also
        ========

        next_nonlex, unrank_nonlex
         _rank1 N/A N/A n perm inv_perm N/A N/A N/A N/A n 1 N/A N/A 0 N/A s N/A perm N/A N/A n 1 N/A t N/A inv_perm N/A N/A n 1 N/A N/A N/A perm N/A N/A n 1 N/A perm N/A t N/A N/A perm N/A t s N/A N/A N/A inv_perm N/A N/A n 1 N/A inv_perm N/A s N/A N/A inv_perm N/A s t N/A N/A s N/A n N/A _rank1 N/A n 1 perm inv_perm N/A N/A N/A inv_perm None N/A N/A inv_perm N/A N/A self array_form N/A N/A inv_perm N/A N/A 0 N/A perm N/A N/A self array_form N/A N/A r N/A _rank1 N/A len perm perm inv_perm N/A r N/A next_nonlex N/A N/A self N/A N/A N/A 
        Returns the next permutation in nonlex order [3].
        If self is the last permutation in this order it returns None.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation([2, 0, 3, 1]); p.rank_nonlex()
        5
        >>> p = p.next_nonlex(); p
        Permutation([3, 0, 1, 2])
        >>> p.rank_nonlex()
        6

        See Also
        ========

        rank_nonlex, unrank_nonlex
         N/A r N/A N/A self rank_nonlex N/A N/A r N/A N/A ifac N/A self size 1 N/A N/A None N/A N/A N/A Perm unrank_nonlex N/A self size N/A r 1 N/A rank N/A N/A self N/A N/A N/A 
        Returns the lexicographic rank of the permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3])
        >>> p.rank()
        0
        >>> p = Permutation([3, 2, 1, 0])
        >>> p.rank()
        23

        See Also
        ========

        next_lex, unrank_lex, cardinality, length, order, size
         N/A N/A N/A N/A self _rank None N/A N/A N/A self _rank N/A rank 0 N/A rho N/A N/A self array_form N/A N/A n N/A N/A self size 1 N/A size N/A n 1 N/A psize N/A int N/A ifac n N/A j N/A range N/A size 1 N/A N/A rank N/A N/A rho N/A j psize N/A i N/A range N/A j 1 size N/A N/A N/A N/A rho N/A i N/A rho N/A j N/A N/A N/A rho N/A i 1 N/A psize n N/A n 1 N/A N/A self _rank rank N/A rank N/A cardinality N/A N/A self N/A N/A N/A 
        Returns the number of all possible permutations.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3])
        >>> p.cardinality
        24

        See Also
        ========

        length, order, rank, size
         N/A N/A int N/A ifac N/A self size N/A property parity N/A N/A self N/A N/A N/A 
        Computes the parity of a permutation.

        The parity of a permutation reflects the parity of the
        number of inversions in the permutation, i.e., the
        number of pairs of x and y such that ``x > y`` but ``p[x] < p[y]``.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3])
        >>> p.parity()
        0
        >>> p = Permutation([3, 2, 0, 1])
        >>> p.parity()
        1

        See Also
        ========

        _af_parity
         N/A N/A N/A self _cyclic_form None N/A N/A N/A N/A N/A self size N/A self cycles 2 N/A N/A _af_parity N/A self array_form N/A is_even N/A N/A self N/A N/A N/A 
        Checks if a permutation is even.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3])
        >>> p.is_even
        True
        >>> p = Permutation([3, 2, 1, 0])
        >>> p.is_even
        True

        See Also
        ========

        is_odd
         N/A N/A N/A self is_odd N/A property is_odd N/A N/A self N/A N/A N/A 
        Checks if a permutation is odd.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3])
        >>> p.is_odd
        False
        >>> p = Permutation([3, 2, 0, 1])
        >>> p.is_odd
        True

        See Also
        ========

        is_even
         N/A N/A bool N/A N/A N/A self parity 2 N/A property is_Singleton N/A N/A self N/A N/A N/A 
        Checks to see if the permutation contains only one number and is
        thus the only possible permutation of this set of numbers

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation([0]).is_Singleton
        True
        >>> Permutation([0, 1]).is_Singleton
        False

        See Also
        ========

        is_Empty
         N/A N/A N/A self size 1 N/A property is_Empty N/A N/A self N/A N/A N/A 
        Checks to see if the permutation is a set with zero elements

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation([]).is_Empty
        True
        >>> Permutation([0]).is_Empty
        False

        See Also
        ========

        is_Singleton
         N/A N/A N/A self size 0 N/A property is_Identity N/A N/A self N/A N/A N/A 
        Returns True if the Permutation is an identity permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([])
        >>> p.is_Identity
        True
        >>> p = Permutation([[0], [1], [2]])
        >>> p.is_Identity
        True
        >>> p = Permutation([0, 1, 2])
        >>> p.is_Identity
        True
        >>> p = Permutation([0, 2, 1])
        >>> p.is_Identity
        False

        See Also
        ========

        order
         N/A af N/A self array_form N/A N/A N/A af N/A all N/A N/A i N/A af N/A i N/A i N/A range N/A self size N/A property ascents N/A N/A self N/A N/A N/A 
        Returns the positions of ascents in a permutation, ie, the location
        where p[i] < p[i+1]

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([4, 0, 1, 3, 2])
        >>> p.ascents()
        [1, 2]

        See Also
        ========

        descents, inversions, min, max
         N/A a N/A self array_form N/A pos N/A i N/A i N/A range N/A N/A len a 1 N/A N/A a N/A i N/A a N/A N/A i 1 N/A pos N/A descents N/A N/A self N/A N/A N/A 
        Returns the positions of descents in a permutation, ie, the location
        where p[i] > p[i+1]

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([4, 0, 1, 3, 2])
        >>> p.descents()
        [0, 3]

        See Also
        ========

        ascents, inversions, min, max
         N/A a N/A self array_form N/A pos N/A i N/A i N/A range N/A N/A len a 1 N/A N/A a N/A i N/A a N/A N/A i 1 N/A pos N/A max N/A N/A self N/A N/A N/A 
        The maximum element moved by the permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([1, 0, 2, 3, 4])
        >>> p.max()
        1

        See Also
        ========

        min, descents, ascents, inversions
         N/A max 0 N/A a N/A self array_form N/A i N/A range N/A len a N/A N/A N/A N/A N/A a N/A i i N/A N/A a N/A i max N/A N/A max N/A a N/A i N/A max N/A min N/A N/A self N/A N/A N/A 
        The minimum element moved by the permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 4, 3, 2])
        >>> p.min()
        2

        See Also
        ========

        max, descents, ascents, inversions
         N/A a N/A self array_form N/A min N/A len a N/A i N/A range N/A len a N/A N/A N/A N/A N/A a N/A i i N/A N/A a N/A i min N/A N/A min N/A a N/A i N/A min N/A inversions N/A N/A self N/A N/A N/A 
        Computes the number of inversions of a permutation.

        An inversion is where i > j but p[i] < p[j].

        For small length of p, it iterates over all i and j
        values and calculates the number of inversions.
        For large length of p, it uses a variation of merge
        sort to calculate the number of inversions.

        References
        ==========

        [1] http://www.cp.eng.chula.ac.th/~piak/teaching/algo/algo2008/count-inv.htm

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3, 4, 5])
        >>> p.inversions()
        0
        >>> Permutation([3, 2, 1, 0]).inversions()
        6

        See Also
        ========

        descents, ascents, min, max
         N/A inversions 0 N/A a N/A self array_form N/A n N/A len a N/A N/A n 130 N/A N/A i N/A range N/A n 1 N/A N/A b N/A a N/A i N/A c N/A a N/A N/A i 1 N/A N/A N/A b c N/A N/A inversions 1 N/A N/A k 1 N/A right 0 N/A arr N/A a N/A N/A temp N/A a N/A N/A N/A k n N/A N/A i 0 N/A N/A N/A i k n N/A N/A right N/A N/A i N/A k 2 1 N/A N/A right n N/A N/A right N/A n 1 N/A inversions N/A _merge arr temp i N/A i k right N/A i N/A i N/A k 2 N/A k N/A k 2 N/A inversions N/A commutator N/A N/A self x N/A N/A N/A Return the commutator of self and x: ``~x*~self*x*self``

        If f and g are part of a group, G, then the commutator of f and g
        is the group identity iff f and g commute, i.e. fg == gf.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation([0, 2, 3, 1])
        >>> x = Permutation([2, 0, 3, 1])
        >>> c = p.commutator(x); c
        Permutation([2, 1, 3, 0])
        >>> c == ~x*~p*x*p
        True

        >>> I = Permutation(3)
        >>> p = [I + i for i in range(6)]
        >>> for i in range(len(p)):
        ...     for j in range(len(p)):
        ...         c = p[i].commutator(p[j])
        ...         if p[i]*p[j] == p[j]*p[i]:
        ...             assert c == I
        ...         else:
        ...             assert c != I
        ...

        References
        ==========

        http://en.wikipedia.org/wiki/Commutator
         N/A a N/A self array_form N/A b N/A x array_form N/A n N/A len a N/A N/A N/A len b n N/A N/A N/A ValueError The permutations must be of equal size. N/A inva N/A N/A None n N/A i N/A range n N/A N/A N/A inva N/A N/A a N/A i i N/A invb N/A N/A None n N/A i N/A range n N/A N/A N/A invb N/A N/A b N/A i i N/A N/A _af_new N/A N/A a N/A N/A b N/A N/A inva N/A i N/A i invb N/A signature N/A N/A self N/A N/A N/A 
        Gives the signature of the permutation needed to place the
        elements of the permutation in canonical order.

        The signature is calculated as (-1)^<number of inversions>

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2])
        >>> p.inversions()
        0
        >>> p.signature()
        1
        >>> q = Permutation([0,2,1])
        >>> q.inversions()
        1
        >>> q.signature()
        -1

        See Also
        ========

        inversions
         N/A N/A self is_even N/A N/A 1 N/A -1 N/A order N/A N/A self N/A N/A N/A 
        Computes the order of a permutation.

        When the permutation is raised to the power of its
        order it equals the identity permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation([3, 1, 5, 2, 4, 0])
        >>> p.order()
        4
        >>> (p**(p.order()))
        Permutation([], size=6)

        See Also
        ========

        identity, cardinality, length, rank, size
         N/A N/A reduce lcm N/A N/A len cycle N/A cycle N/A self cyclic_form 1 N/A length N/A N/A self N/A N/A N/A 
        Returns the number of integers moved by a permutation.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation([0, 3, 2, 1]).length()
        2
        >>> Permutation([[0, 1], [2, 3]]).length()
        4

        See Also
        ========

        min, max, support, cardinality, order, rank, size
         N/A N/A len N/A N/A self support N/A cycle_structure N/A N/A self N/A N/A N/A Return the cycle structure of the permutation as a dictionary
        indicating the multiplicity of each cycle length.

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation.print_cyclic = True
        >>> Permutation(3).cycle_structure
        {1: 4}
        >>> Permutation(0, 4, 3)(1, 2)(5, 6).cycle_structure
        {2: 2, 3: 1}
         N/A N/A self _cycle_structure N/A N/A rv N/A self _cycle_structure N/A N/A rv N/A defaultdict int N/A singletons N/A self size N/A c N/A self cyclic_form N/A N/A N/A rv N/A N/A len c 1 N/A singletons N/A len c N/A singletons N/A N/A N/A rv N/A 1 singletons N/A N/A self _cycle_structure rv N/A N/A dict rv N/A property cycles N/A N/A self N/A N/A N/A 
        Returns the number of cycles contained in the permutation
        (including singletons).

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation([0, 1, 2]).cycles
        3
        >>> Permutation([0, 1, 2]).full_cyclic_form
        [[0], [1], [2]]
        >>> Permutation(0, 1)(2, 3).cycles
        2

        See Also
        ========
        sympy.functions.combinatorial.numbers.stirling
         N/A N/A len N/A self full_cyclic_form N/A property index N/A N/A self N/A N/A N/A 
        Returns the index of a permutation.

        The index of a permutation is the sum of all subscripts j such
        that p[j] is greater than p[j+1].

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([3, 0, 2, 1, 4])
        >>> p.index()
        2
         N/A a N/A self array_form N/A N/A sum N/A j N/A j N/A range N/A N/A len a 1 N/A N/A a N/A j N/A a N/A N/A j 1 N/A runs N/A N/A self N/A N/A N/A 
        Returns the runs of a permutation.

        An ascending sequence in a permutation is called a run [5].


        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([2, 5, 7, 3, 6, 0, 1, 4, 8])
        >>> p.runs()
        [[2, 5, 7], [3, 6], [0, 1, 4, 8]]
        >>> q = Permutation([1,3,2,0])
        >>> q.runs()
        [[1, 3], [2], [0]]
         N/A N/A runs N/A self array_form N/A inversion_vector N/A N/A self N/A N/A N/A Return the inversion vector of the permutation.

        The inversion vector consists of elements whose value
        indicates the number of elements in the permutation
        that are lesser than it and lie on its right hand side.

        The inversion vector is the same as the Lehmer encoding of a
        permutation.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([4, 8, 0, 7, 1, 5, 3, 6, 2])
        >>> p.inversion_vector()
        [4, 7, 0, 5, 0, 2, 1, 1]
        >>> p = Permutation([3, 2, 1, 0])
        >>> p.inversion_vector()
        [3, 2, 1]

        The inversion vector increases lexicographically with the rank
        of the permutation, the -ith element cycling through 0..i.

        >>> p = Permutation(2)
        >>> while p:
        ...     print('%s %s %s' % (p, p.inversion_vector(), p.rank()))
        ...     p = p.next_lex()
        ...
        Permutation([0, 1, 2]) [0, 0] 0
        Permutation([0, 2, 1]) [0, 1] 1
        Permutation([1, 0, 2]) [1, 0] 2
        Permutation([1, 2, 0]) [1, 1] 3
        Permutation([2, 0, 1]) [2, 0] 4
        Permutation([2, 1, 0]) [2, 1] 5

        See Also
        ========
        from_inversion_vector
         N/A self_array_form N/A self array_form N/A n N/A len self_array_form N/A inversion_vector N/A N/A 0 N/A n 1 N/A i N/A range N/A n 1 N/A N/A val 0 N/A j N/A range N/A i 1 n N/A N/A N/A N/A self_array_form N/A j N/A self_array_form N/A i N/A N/A val 1 N/A N/A inversion_vector N/A i val N/A inversion_vector N/A rank_trotterjohnson N/A N/A self N/A N/A N/A 
        Returns the Trotter Johnson rank, which we get from the minimal
        change algorithm. See [4] section 2.4.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 1, 2, 3])
        >>> p.rank_trotterjohnson()
        0
        >>> p = Permutation([0, 2, 1, 3])
        >>> p.rank_trotterjohnson()
        7

        See Also
        ========

        unrank_trotterjohnson, next_trotterjohnson
         N/A N/A N/A N/A self array_form N/A N/A self is_Identity N/A N/A 0 N/A N/A N/A self array_form N/A 1 0 N/A N/A 1 N/A perm N/A self array_form N/A n N/A self size N/A rank 0 N/A j N/A range 1 n N/A N/A k 1 N/A i 0 N/A N/A N/A perm N/A i j N/A N/A N/A N/A perm N/A i j N/A N/A k 1 N/A i 1 N/A j1 N/A j 1 N/A N/A N/A rank 2 0 N/A N/A rank N/A N/A N/A j1 rank j1 k N/A N/A rank N/A N/A N/A j1 rank k 1 N/A rank N/A unrank_trotterjohnson N/A N/A self size rank N/A N/A N/A 
        Trotter Johnson permutation unranking. See [4] section 2.4.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.unrank_trotterjohnson(5, 10)
        Permutation([0, 3, 1, 2, 4])

        See Also
        ========

        rank_trotterjohnson, next_trotterjohnson
         N/A perm N/A N/A 0 size N/A r2 0 N/A n N/A ifac size N/A pj 1 N/A j N/A range 2 N/A size 1 N/A N/A pj j N/A r1 N/A N/A rank pj n N/A k N/A r1 N/A j r2 N/A N/A N/A r2 2 0 N/A N/A i N/A range N/A j 1 N/A N/A j k 1 -1 N/A N/A N/A perm N/A i N/A perm N/A N/A i 1 N/A N/A perm N/A N/A N/A j k 1 N/A j 1 N/A N/A i N/A range N/A j 1 k -1 N/A N/A N/A perm N/A i N/A perm N/A N/A i 1 N/A N/A perm N/A k N/A j 1 N/A r2 r1 N/A N/A _af_new perm N/A classmethod next_trotterjohnson N/A N/A self N/A N/A N/A 
        Returns the next permutation in Trotter-Johnson order.
        If self is the last permutation it returns None.
        See [4] section 2.4. If it is desired to generate all such
        permutations, they can be generated in order more quickly
        with the ``generate_bell`` function.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> p = Permutation([3, 0, 2, 1])
        >>> p.rank_trotterjohnson()
        4
        >>> p = p.next_trotterjohnson(); p
        Permutation([0, 3, 2, 1])
        >>> p.rank_trotterjohnson()
        5

        See Also
        ========

        rank_trotterjohnson, unrank_trotterjohnson, sympy.utilities.iterables.generate_bell
         N/A pi N/A N/A self array_form N/A N/A n N/A len pi N/A st 0 N/A rho N/A pi N/A N/A done False N/A m N/A n 1 N/A N/A N/A m 0 N/A done N/A N/A d N/A N/A rho index m N/A i N/A range d m N/A N/A N/A rho N/A i N/A rho N/A N/A i 1 N/A par N/A _af_parity N/A rho N/A m N/A N/A par 1 N/A N/A N/A d m N/A N/A m 1 N/A N/A N/A N/A pi N/A N/A st d N/A pi N/A N/A N/A st d 1 N/A N/A pi N/A N/A N/A st d 1 N/A pi N/A N/A st d N/A done True N/A N/A N/A d 0 N/A N/A m 1 N/A st 1 N/A N/A N/A N/A pi N/A N/A st d N/A pi N/A N/A N/A st d 1 N/A N/A pi N/A N/A N/A st d 1 N/A pi N/A N/A st d N/A done True N/A N/A m 0 N/A N/A None N/A N/A _af_new pi N/A get_precedence_matrix N/A N/A self N/A N/A N/A 
        Gets the precedence matrix. This is used for computing the
        distance between two permutations.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation.josephus(3, 6, 1)
        >>> p
        Permutation([2, 5, 3, 1, 4, 0])
        >>> p.get_precedence_matrix()
        Matrix([
        [0, 0, 0, 0, 0, 0],
        [1, 0, 0, 0, 1, 0],
        [1, 1, 0, 1, 1, 1],
        [1, 1, 0, 0, 1, 0],
        [1, 0, 0, 0, 0, 0],
        [1, 1, 0, 1, 1, 0]])

        See Also
        ========

        get_precedence_distance, get_adjacency_matrix, get_adjacency_distance
         N/A m N/A zeros N/A self size N/A perm N/A self array_form N/A i N/A range N/A m rows N/A N/A j N/A range N/A i 1 N/A m cols N/A N/A N/A m N/A N/A N/A perm N/A i N/A perm N/A j 1 N/A m N/A get_precedence_distance N/A N/A self other N/A N/A N/A 
        Computes the precedence distance between two permutations.

        Suppose p and p' represent n jobs. The precedence metric
        counts the number of times a job j is preceded by job i
        in both p and p'. This metric is commutative.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([2, 0, 4, 3, 1])
        >>> q = Permutation([3, 1, 2, 4, 0])
        >>> p.get_precedence_distance(q)
        7
        >>> q.get_precedence_distance(p)
        7

        See Also
        ========

        get_precedence_matrix, get_adjacency_matrix, get_adjacency_distance
         N/A N/A N/A self size N/A other size N/A N/A N/A ValueError The permutations must be of equal size. N/A self_prec_mat N/A N/A self get_precedence_matrix N/A other_prec_mat N/A N/A other get_precedence_matrix N/A n_prec 0 N/A i N/A range N/A self size N/A N/A j N/A range N/A self size N/A N/A N/A i j N/A N/A N/A N/A N/A N/A self_prec_mat N/A N/A i j N/A other_prec_mat N/A N/A i j 1 N/A N/A n_prec 1 N/A d N/A N/A N/A N/A self size N/A N/A self size 1 2 n_prec N/A d N/A get_adjacency_matrix N/A N/A self N/A N/A N/A 
        Computes the adjacency matrix of a permutation.

        If job i is adjacent to job j in a permutation p
        then we set m[i, j] = 1 where m is the adjacency
        matrix of p.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation.josephus(3, 6, 1)
        >>> p.get_adjacency_matrix()
        Matrix([
        [0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 1, 0],
        [0, 0, 0, 0, 0, 1],
        [0, 1, 0, 0, 0, 0],
        [1, 0, 0, 0, 0, 0],
        [0, 0, 0, 1, 0, 0]])
        >>> q = Permutation([0, 1, 2, 3])
        >>> q.get_adjacency_matrix()
        Matrix([
        [0, 1, 0, 0],
        [0, 0, 1, 0],
        [0, 0, 0, 1],
        [0, 0, 0, 0]])

        See Also
        ========

        get_precedence_matrix, get_precedence_distance, get_adjacency_distance
         N/A m N/A zeros N/A self size N/A perm N/A self array_form N/A i N/A range N/A N/A self size 1 N/A N/A N/A m N/A N/A N/A perm N/A i N/A perm N/A N/A i 1 1 N/A m N/A get_adjacency_distance N/A N/A self other N/A N/A N/A 
        Computes the adjacency distance between two permutations.

        This metric counts the number of times a pair i,j of jobs is
        adjacent in both p and p'. If n_adj is this quantity then
        the adjacency distance is n - n_adj - 1 [1]

        [1] Reeves, Colin R. Landscapes, Operators and Heuristic search, Annals
        of Operational Research, 86, pp 473-490. (1999)


        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 3, 1, 2, 4])
        >>> q = Permutation.josephus(4, 5, 2)
        >>> p.get_adjacency_distance(q)
        3
        >>> r = Permutation([0, 2, 1, 4, 3])
        >>> p.get_adjacency_distance(r)
        4

        See Also
        ========

        get_precedence_matrix, get_precedence_distance, get_adjacency_matrix
         N/A N/A N/A self size N/A other size N/A N/A N/A ValueError The permutations must be of the same size. N/A self_adj_mat N/A N/A self get_adjacency_matrix N/A other_adj_mat N/A N/A other get_adjacency_matrix N/A n_adj 0 N/A i N/A range N/A self size N/A N/A j N/A range N/A self size N/A N/A N/A i j N/A N/A N/A N/A N/A N/A self_adj_mat N/A N/A i j N/A other_adj_mat N/A N/A i j 1 N/A N/A n_adj 1 N/A d N/A N/A N/A self size n_adj 1 N/A d N/A get_positional_distance N/A N/A self other N/A N/A N/A 
        Computes the positional distance between two permutations.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> p = Permutation([0, 3, 1, 2, 4])
        >>> q = Permutation.josephus(4, 5, 2)
        >>> r = Permutation([3, 1, 4, 0, 2])
        >>> p.get_positional_distance(q)
        12
        >>> p.get_positional_distance(r)
        12

        See Also
        ========

        get_precedence_distance, get_adjacency_distance
         N/A a N/A self array_form N/A b N/A other array_form N/A N/A N/A len a N/A len b N/A N/A N/A ValueError The permutations must be of the same size. N/A N/A sum N/A N/A abs N/A N/A a N/A i N/A b N/A i N/A i N/A range N/A len a N/A josephus N/A N/A self m n s N/A 1 N/A N/A Return as a permutation the shuffling of range(n) using the Josephus
        scheme in which every m-th item is selected until all have been chosen.
        The returned permutation has elements listed by the order in which they
        were selected.

        The parameter ``s`` stops the selection process when there are ``s``
        items remaining and these are selected by continuing the selection,
        counting by 1 rather than by ``m``.

        Consider selecting every 3rd item from 6 until only 2 remain::

            choices    chosen
            ========   ======
              012345
              01 345   2
              01 34    25
              01  4    253
              0   4    2531
              0        25314
                       253140

        Examples
        ========

        >>> from sympy.combinatorics import Permutation
        >>> Permutation.josephus(3, 6, 2).array_form
        [2, 5, 3, 1, 4, 0]

        References
        ==========

        1. http://en.wikipedia.org/wiki/Flavius_Josephus
        2. http://en.wikipedia.org/wiki/Josephus_problem
        3. http://www.wou.edu/~burtonl/josephus.html

         collections deque N/A m 1 N/A Q N/A deque N/A list N/A range n N/A perm N/A N/A N/A N/A len Q N/A max s 1 N/A N/A dp N/A range m N/A N/A N/A N/A Q append N/A N/A Q popleft N/A N/A N/A perm append N/A N/A Q popleft N/A N/A N/A perm extend N/A list Q N/A N/A Perm perm N/A classmethod from_inversion_vector N/A N/A self inversion N/A N/A N/A 
        Calculates the permutation from the inversion vector.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> Permutation.from_inversion_vector([3, 2, 1, 0, 0])
        Permutation([3, 2, 1, 0, 4, 5])

         N/A size N/A len inversion N/A N N/A list N/A range N/A size 1 N/A perm N/A N/A N/A N/A k N/A range size N/A N/A val N/A N N/A N/A inversion N/A k N/A N/A N/A perm append val N/A N/A N/A N remove val N/A N/A N/A IndexError N/A N/A N/A ValueError The inversion vector is not valid. N/A N/A N/A perm extend N N/A N/A _af_new perm N/A classmethod random N/A N/A self n N/A N/A N/A 
        Generates a random permutation of length ``n``.

        Uses the underlying Python pseudo-random number generator.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.random(2) in (Permutation([1, 0]), Permutation([0, 1]))
        True

         N/A perm_array N/A list N/A range n N/A N/A N/A random shuffle perm_array N/A N/A _af_new perm_array N/A classmethod unrank_lex N/A N/A self size rank N/A N/A N/A 
        Lexicographic permutation unranking.

        Examples
        ========

        >>> from sympy.combinatorics.permutations import Permutation
        >>> Permutation.print_cyclic = False
        >>> a = Permutation.unrank_lex(5, 10)
        >>> a.rank()
        10
        >>> a
        Permutation([0, 2, 4, 1, 3])

        See Also
        ========

        rank, next_lex
         N/A perm_array N/A N/A 0 size N/A psize 1 N/A i N/A range size N/A N/A new_psize N/A psize N/A i 1 N/A d N/A N/A rank new_psize psize N/A rank N/A d psize N/A N/A perm_array N/A N/A N/A size i 1 d N/A j N/A range N/A size i size N/A N/A N/A N/A perm_array N/A j N/A d 1 N/A N/A N/A perm_array N/A j 1 N/A psize new_psize N/A N/A _af_new perm_array N/A classmethod N/A print_cyclic True N/A _merge N/A N/A arr temp left mid right N/A N/A N/A 
    Merges two sorted arrays and calculates the inversion count.

    Helper function for calculating inversions. This method is
    for internal use only.
     N/A i k left N/A j mid N/A inv_count 0 N/A N/A N/A i mid N/A j right N/A N/A N/A N/A arr N/A i N/A arr N/A j N/A N/A N/A temp N/A k N/A arr N/A i N/A k 1 N/A i 1 N/A N/A N/A temp N/A k N/A arr N/A j N/A k 1 N/A j 1 N/A inv_count N/A mid i N/A N/A i mid N/A N/A N/A temp N/A k N/A arr N/A i N/A k 1 N/A i 1 N/A N/A j right N/A N/A k N/A N/A right j 1 N/A j N/A N/A right j 1 N/A N/A arr N/A left N/A k 1 N/A temp N/A left N/A k 1 N/A N/A N/A arr N/A left N/A right 1 N/A temp N/A left N/A right 1 N/A inv_count N/A N/A Perm Permutation N/A _af_new N/A Perm _af_new