Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias Import alias If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body Assign NameStore NameLoad ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Return BoolOpOr CompareLtE NameLoad Num Call NameLoad Lambda arguments args NameParam NameParam defaults BinOpMult NameLoad NameLoad Call NameLoad Num BinOpAdd NameLoad Num decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpDiv Call NameLoad NameLoad BinOpMult Call NameLoad BinOpSub NameLoad NameLoad Call NameLoad NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpDiv Call NameLoad NameLoad Call NameLoad BinOpSub NameLoad NameLoad decorator_list Assign NameStore NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareGtE AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num If AttributeLoad NameLoad attr body Return Call AttributeLoad Str attr NameLoad orelse Return NameLoad decorator_list Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad NameLoad Slice NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListComp Call NameLoad NameLoad comprehension NameStore NameLoad If CompareGt Call AttributeLoad AttributeLoad NameLoad attr attr Num Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr BinOpMult ListLoad Num AttributeLoad NameLoad attr AugAssignSub SubscriptStore AttributeLoad NameLoad attr Index Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Num Return Call AttributeLoad NameLoad attr decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Num SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If NameLoad body If CompareLt BinOpAdd NameLoad Num AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr BinOpAdd NameLoad Num orelse Raise NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return ListComp SubscriptLoad NameLoad Index NameLoad comprehension TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Lambda arguments args NameParam NameParam defaults BinOpMult NameLoad NameLoad AttributeLoad NameLoad attr Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults kwarg body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Assign NameStore ListLoad Call AttributeLoad NameLoad attr Assign NameStore Num While NameLoad body Assign TupleStore NameStore NameStore TupleLoad BinOpFloorDiv NameLoad NameLoad BinOpMod NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareEq NameLoad Num body Expr Yield ListLoad orelse For NameStore Call NameLoad Call NameLoad NameLoad body For NameStore Call NameLoad SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num BinOpSub NameLoad Num body Expr Yield BinOpAdd ListLoad SubscriptLoad NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad While CompareGt Call NameLoad Lambda arguments args NameParam NameParam defaults BinOpMult NameLoad NameLoad NameLoad Num NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad AugAssignSub SubscriptStore NameLoad Index NameLoad Num Return ListComp Call NameLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareGt NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list If CompareEq NameLoad Str body ImportFrom alias Assign NameStore Call NameLoad Str For NameStore NameLoad body Expr Call NameLoad NameLoad Assign NameStore Call NameLoad Call NameLoad Num For NameStore ListLoad Num Num Num Num Num Num Num Num body Expr Call NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad Str Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Num Assign NameStore Call NameLoad Call NameLoad Num ListLoad NameLoad NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad TryExcept body Assign NameStore Call NameLoad ListLoad ListLoad NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass orelse Expr Call NameLoad Str Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call NameLoad NameLoad
N/A N/A 
Functions and classes for doing object permutation.

 __future__ absolute_import __future__ print_function __future__ division N/A sys N/A N/A N/A N/A sys version_info major 3 N/A N/A basestring str functools reduce factorial N/A N/A x N/A N/A N/A factorial(x)
    return x!
     N/A N/A N/A x 0 N/A reduce N/A N/A N/A a b N/A N/A a b N/A range 1 N/A x 1 N/A N/A fact factorial nCr N/A N/A n r N/A N/A N/A nCr = n! / ( (n-r)! * r! ) N/A N/A N/A factorial n N/A N/A factorial N/A n r N/A factorial r N/A N/A combinations nCr nPr N/A N/A n r N/A N/A N/A nPr = n! / (n-r)! N/A N/A N/A factorial n N/A factorial N/A n r N/A N/A permutations nPr Permuter N/A object N/A __init__ N/A N/A self seq N/A N/A N/A N/A self seq seq N/A __iter__ N/A N/A self N/A N/A N/A N/A PermuterIter N/A self seq N/A __getitem__ N/A N/A self idx N/A N/A N/A N/A get_permutation N/A self seq idx N/A __len__ N/A N/A self N/A N/A N/A N/A factorial N/A len N/A self seq N/A N/A PermuterIter N/A object N/A __init__ N/A N/A self seq N/A N/A N/A N/A self seq seq N/A N/A self maximum N/A factorial N/A len seq N/A N/A self i 0 N/A N/A self is_string N/A isinstance seq basestring N/A __iter__ N/A N/A self N/A N/A N/A self N/A __next__ N/A N/A self N/A N/A N/A N/A N/A self i N/A self maximum N/A N/A StopIteration N/A n N/A get_permutation N/A self seq N/A self i N/A N/A self i 1 N/A N/A self is_string N/A N/A N/A N/A join n N/A N/A n N/A N/A next __next__ N/A prune_end N/A N/A n l N/A N/A N/A N/A l N/A n N/A ListCounter N/A object N/A N/A An iterator that counts through its list of lists. __init__ N/A N/A self lists N/A N/A N/A N/A self _lists lists N/A N/A self _lengths N/A N/A len l N/A l lists N/A N/A N/A N/A N/A self _lengths count 0 0 N/A N/A N/A ValueError All lists must have at least one element. N/A N/A self _places N/A len N/A self _lengths N/A N/A N/A self reset N/A reset N/A N/A self N/A N/A N/A N/A self _counters N/A N/A 0 N/A self _places N/A N/A N/A self _counters N/A 0 1 N/A __iter__ N/A N/A self N/A N/A N/A N/A N/A self reset N/A self N/A __next__ N/A N/A self N/A N/A N/A N/A N/A self _increment 0 N/A N/A N/A self fetch N/A N/A next __next__ _increment N/A N/A self place N/A N/A N/A N/A carry N/A N/A self _counters N/A place N/A divmod N/A N/A N/A self _counters N/A place 1 N/A N/A self _lengths N/A place N/A carry N/A N/A N/A N/A place 1 N/A self _places N/A N/A N/A N/A self _increment N/A place 1 N/A N/A StopIteration N/A carry N/A fetch N/A N/A self N/A N/A N/A N/A N/A l N/A i N/A N/A l i N/A zip N/A self _lists N/A self _counters N/A get_number N/A N/A self N/A N/A N/A N/A reduce N/A N/A N/A a b N/A N/A a b N/A self _lengths 1 N/A N/A KeywordCounter N/A object N/A N/A Instantiate this as you would any callable with keyword arguments,
    except that the keyword values should be a list of possible values. When
    you iterate over it it will return a dictionary with values cycle through
    the set of possible values.
     __init__ N/A N/A self N/A kwargs N/A N/A N/A self _names N/A N/A kwargs keys N/A N/A self _counter N/A ListCounter N/A N/A kwargs values N/A prune N/A N/A self maxN chooser N/A prune_end N/A N/A lists N/A prune maxN N/A N/A self _counter _lists chooser N/A N/A self _counter N/A ListCounter lists N/A __iter__ N/A N/A self N/A N/A N/A N/A N/A N/A self _counter reset N/A self N/A __next__ N/A N/A self N/A N/A N/A values N/A N/A N/A self _counter next N/A N/A N/A self fetch values N/A N/A next __next__ get_number N/A N/A self N/A N/A N/A N/A N/A N/A self _counter get_number N/A fetch N/A N/A self values N/A N/A N/A N/A dict N/A zip N/A self _names values N/A N/A get_permutation N/A N/A seq index N/A N/A N/A Returns the <index>th permutation of <seq> N/A seqc N/A list N/A seq N/A N/A seqn N/A N/A N/A seqc pop N/A divider 2 N/A seqc N/A N/A N/A index new_index N/A N/A index divider N/A index divider N/A N/A N/A seqn insert new_index N/A N/A seqc pop N/A divider 1 N/A seqn N/A unique_combinations N/A N/A items n N/A N/A N/A N/A n 0 N/A N/A N/A N/A N/A N/A i N/A range N/A len items N/A N/A cc N/A unique_combinations N/A items N/A N/A i 1 N/A n 1 N/A N/A N/A N/A N/A N/A items N/A i cc N/A prune N/A N/A maxN sets chooser N/A prune_end N/A N/A Prune a collection of sets such that number of combinations is less than
    or equal to maxN.  Use this to set an upper bound on combinations and you
    don't care if you "hit" all combinations.  This simple algorithm basically
    reduces the number of entries taken from the largest set. If then are equal
    numbered, then removal is left to right.

    maxN is the maximum number of combinations.
    sets is a list of lists containing the items to be combined.
    chooser implements the pruning policy. It should be a function taking a
    number, N, and a list and returning a new list with N elements.
     N/A lenlist N/A N/A len l N/A l sets N/A N/A N/A reduce N/A N/A N/A a b N/A N/A a b lenlist 1 maxN N/A N/A N/A lv li N/A maxi lenlist N/A N/A lenlist N/A li 1 N/A N/A N/A chooser n l N/A N/A n l N/A zip lenlist sets N/A maxi N/A N/A seq N/A N/A N/A cmax N/A seq N/A 0 N/A ci 0 N/A N/A i val N/A enumerate seq N/A N/A N/A val cmax N/A N/A cmax val N/A ci i N/A N/A cmax ci N/A N/A N/A __name__ __main__ N/A pycopia interactive N/A perm N/A Permuter abc N/A p perm N/A N/A N/A print p N/A perm N/A Permuter N/A range 10 N/A i N/A 0 1 10 55 1000 3600000 3628799 3628800 N/A N/A N/A print N/A perm N/A i N/A N/A print --- N/A s1 N/A range 10 N/A s2 N/A range 5 N/A s3 N/A range 2 N/A lc N/A ListCounter N/A prune 60 N/A s1 s2 s3 N/A N/A print N/A N/A lc get_number N/A N/A i l N/A enumerate lc N/A N/A N/A print N/A %02d. %s N/A i l N/A N/A N/A badlc N/A ListCounter N/A N/A s2 s3 N/A N/A N/A ValueError N/A N/A N/A N/A N/A print *** didn't find zero length N/A kc N/A KeywordCounter arg1 s1 arg2 s2 arg3 s3 N/A N/A print N/A N/A kc get_number N/A kwargs kc N/A N/A N/A print kwargs