-í
æ¶<c       sR   d  Z  d e d „ Z e Z d e d „ Z e Z d e d „ Z d e d „ Z d S(   s   Bisection algorithms.i    c    sy   | t j o t |  ƒ } n xE | | j  o7 | | d } | |  | j  o
 | } n | d } q  W|  i | | ƒ d S(   sï   Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   xs   insert(   s   as   xs   los   his   mid(    (    s   /usr/lib/python2.2/bisect.pys   insort_right s       
c    sm   | t j o t |  ƒ } n xE | | j  o7 | | d } | |  | j  o
 | } n | d } q  W| Sd S(   sr  Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e <= x, and all e in
    a[i:] have e > x.  So if x already appears in the list, i points just
    beyond the rightmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   x(   s   as   xs   los   his   mid(    (    s   /usr/lib/python2.2/bisect.pys   bisect_right s    	   
c    sy   | t j o t |  ƒ } n xE | | j  o7 | | d } |  | | j  o | d } n | } q  W|  i | | ƒ d S(   sí   Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the left of the leftmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   xs   insert(   s   as   xs   los   his   mid(    (    s   /usr/lib/python2.2/bisect.pys   insort_left+ s       c    sm   | t j o t |  ƒ } n xE | | j  o7 | | d } |  | | j  o | d } n | } q  W| Sd S(   sq  Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, i points just
    before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    i   i   N(   s   his   Nones   lens   as   los   mids   x(   s   as   xs   los   his   mid(    (    s   /usr/lib/python2.2/bisect.pys   bisect_left= s    	   N(   s   __doc__s   Nones   insort_rights   insorts   bisect_rights   bisects   insort_lefts   bisect_left(   s   insort_lefts   insort_rights   bisect_rights   bisects   bisect_lefts   insort(    (    s   /usr/lib/python2.2/bisect.pys   ? s   