Module Expr Str ImportFrom alias alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults TupleLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign NameStore IfExp CompareIs NameLoad NameLoad Lambda arguments args NameParam defaults NameLoad NameLoad Assign NameStore Call NameLoad GeneratorExp TupleLoad Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad Assign AttributeStore NameLoad attr ListComp NameLoad comprehension TupleStore NameStore NameStore NameLoad Assign AttributeStore NameLoad attr ListComp NameLoad comprehension TupleStore NameStore NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIsNot NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return TupleLoad AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Return CompareIn NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Return BinOpAdd Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Slice NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareNotEq NameLoad Call NameLoad NameLoad CompareEq SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index BinOpSub NameLoad Num Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index BinOpSub NameLoad Num Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad Call NameLoad NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad Call NameLoad NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list decorator_list
N/A N/A 
Sorted collection for maintaining a sorted list.

Taken from http://code.activestate.com/recipes/577197-sortedcollection/
 bisect bisect_left bisect_right SortedCollection N/A object N/A N/A Sequence sorted by a key function.

    SortedCollection() is much easier to work with than using bisect() directly.
    It supports key functions like those use in sorted(), min(), and max().
    The result of the key function call is saved so that keys can be searched
    efficiently.

    Instead of returning an insertion-point which can be hard to interpret, the
    five find-methods return a specific item in the sequence. They can scan for
    exact matches, the last item less-than-or-equal to a key, or the first item
    greater-than-or-equal to a key.

    Once found, an item's ordinal position can be located with the index() method.
    New items can be added with the insert() and insert_right() methods.
    Old items can be deleted with the remove() method.

    The usual sequence methods are provided to support indexing, slicing,
    length lookup, clearing, copying, forward and reverse iteration, contains
    checking, item counts, item removal, and a nice looking repr.

    Finding and indexing are O(log n) operations while iteration and insertion
    are O(n).  The initial sort is O(n log n).

    The key function is stored in the 'key' attibute for easy introspection or
    so that you can assign a new key function (triggering an automatic re-sort).

    In short, the class was designed to handle all of the common use cases for
    bisect but with a simpler API and support for key functions.

    >>> from pprint import pprint
    >>> from operator import itemgetter

    >>> s = SortedCollection(key=itemgetter(2))
    >>> for record in [
    ...         ('roger', 'young', 30),
    ...         ('angela', 'jones', 28),
    ...         ('bill', 'smith', 22),
    ...         ('david', 'thomas', 32)]:
    ...     s.insert(record)

    >>> pprint(list(s))         # show records sorted by age
    [('bill', 'smith', 22),
     ('angela', 'jones', 28),
     ('roger', 'young', 30),
     ('david', 'thomas', 32)]

    >>> s.find_le(29)           # find oldest person aged 29 or younger
    ('angela', 'jones', 28)
    >>> s.find_lt(28)           # find oldest person under 28
    ('bill', 'smith', 22)
    >>> s.find_gt(28)           # find youngest person over 28
    ('roger', 'young', 30)

    >>> r = s.find_ge(32)       # find youngest person aged 32 or older
    >>> s.index(r)              # get the index of their record
    3
    >>> s[3]                    # fetch the record at that index
    ('david', 'thomas', 32)

    >>> s.key = itemgetter(0)   # now sort by first name
    >>> pprint(list(s))
    [('angela', 'jones', 28),
     ('bill', 'smith', 22),
     ('david', 'thomas', 32),
     ('roger', 'young', 30)]

     __init__ N/A N/A self iterable key N/A N/A None N/A N/A N/A self _given_key key N/A key N/A N/A key None N/A N/A N/A x N/A x key N/A decorated N/A sorted N/A N/A N/A key item item N/A item iterable N/A N/A self _keys N/A k N/A N/A k item decorated N/A N/A self _items N/A item N/A N/A k item decorated N/A N/A self _key key N/A _getkey N/A N/A self N/A N/A N/A N/A self _key N/A _setkey N/A N/A self key N/A N/A N/A N/A key N/A self _key N/A N/A N/A N/A self __init__ N/A self _items key key N/A _delkey N/A N/A self N/A N/A N/A N/A N/A self _setkey None N/A N/A key N/A property _getkey _setkey _delkey key function clear N/A N/A self N/A N/A N/A N/A N/A self __init__ N/A N/A self _key N/A copy N/A N/A self N/A N/A N/A N/A N/A self __class__ self N/A self _key N/A __len__ N/A N/A self N/A N/A N/A N/A len N/A self _items N/A __getitem__ N/A N/A self i N/A N/A N/A N/A N/A self _items N/A i N/A __iter__ N/A N/A self N/A N/A N/A N/A iter N/A self _items N/A __reversed__ N/A N/A self N/A N/A N/A N/A reversed N/A self _items N/A __repr__ N/A N/A self N/A N/A N/A N/A %s(%r, key=%s) N/A N/A N/A self __class__ __name__ N/A self _items N/A getattr N/A self _given_key __name__ N/A repr N/A self _given_key N/A __reduce__ N/A N/A self N/A N/A N/A N/A N/A self __class__ N/A N/A self _items N/A self _given_key N/A __contains__ N/A N/A self item N/A N/A N/A k N/A N/A self _key item N/A i N/A bisect_left N/A self _keys k N/A j N/A bisect_right N/A self _keys k N/A N/A item N/A N/A self _items N/A i j N/A index N/A N/A self item N/A N/A N/A Find the position of an item.  Raise ValueError if not found. N/A k N/A N/A self _key item N/A i N/A bisect_left N/A self _keys k N/A j N/A bisect_right N/A self _keys k N/A N/A N/A N/A N/A N/A self _items N/A i j index item i N/A count N/A N/A self item N/A N/A N/A Return number of occurrences of item N/A k N/A N/A self _key item N/A i N/A bisect_left N/A self _keys k N/A j N/A bisect_right N/A self _keys k N/A N/A N/A N/A N/A self _items N/A i j count item N/A insert N/A N/A self item N/A N/A N/A Insert a new item.  If equal keys are found, add to the left N/A k N/A N/A self _key item N/A i N/A bisect_left N/A self _keys k N/A N/A N/A N/A self _keys insert i k N/A N/A N/A N/A self _items insert i item N/A insert_right N/A N/A self item N/A N/A N/A Insert a new item.  If equal keys are found, add to the right N/A k N/A N/A self _key item N/A i N/A bisect_right N/A self _keys k N/A N/A N/A N/A self _keys insert i k N/A N/A N/A N/A self _items insert i item N/A remove N/A N/A self item N/A N/A N/A Remove first occurence of item.  Raise ValueError if not found N/A i N/A N/A self index item N/A N/A N/A self _keys N/A i N/A N/A N/A self _items N/A i N/A find N/A N/A self k N/A N/A N/A Return first item with a key == k.  Raise ValueError if not found. N/A i N/A bisect_left N/A self _keys k N/A N/A N/A i N/A len self N/A N/A N/A self _keys N/A i k N/A N/A N/A N/A self _items N/A i N/A N/A ValueError N/A No item found with key equal to: %r N/A k N/A find_le N/A N/A self k N/A N/A N/A Return last item with a key <= k.  Raise ValueError if not found. N/A i N/A bisect_right N/A self _keys k N/A i N/A N/A N/A N/A self _items N/A N/A i 1 N/A N/A ValueError N/A No item found with key at or below: %r N/A k N/A find_lt N/A N/A self k N/A N/A N/A Return last item with a key < k.  Raise ValueError if not found. N/A i N/A bisect_left N/A self _keys k N/A i N/A N/A N/A N/A self _items N/A N/A i 1 N/A N/A ValueError N/A No item found with key below: %r N/A k N/A find_ge N/A N/A self k N/A N/A N/A Return first item with a key >= equal to k.  Raise ValueError if not found N/A i N/A bisect_left N/A self _keys k N/A N/A i N/A len self N/A N/A N/A N/A self _items N/A i N/A N/A ValueError N/A No item found with key at or above: %r N/A k N/A find_gt N/A N/A self k N/A N/A N/A Return first item with a key > k.  Raise ValueError if not found N/A i N/A bisect_right N/A self _keys k N/A N/A i N/A len self N/A N/A N/A N/A self _items N/A i N/A N/A ValueError N/A No item found with key above: %r N/A k N/A N/A