mς %U²Ic@s—dZddd„ZeZddd„ZeZddd„Zddd„Zy/dklZlZlZlZlZlZWne j onXdS(sBisection algorithms.icCsy|djot|ƒ}nxE||jo7||d}|||jo |}q |d}q W|i||ƒdS(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. iiN(thitNonetlentatlotmidtxtinsert(RRRRR((t#/data/zmath/lib/python2.4/bisect.pyt insort_rights   cCsi|djot|ƒ}nxE||jo7||d}|||jo |}q |d}q W|S(srReturn 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. iiN(RRRRRRR(RRRRR((Rt bisect_rights    cCsy|djot|ƒ}nxE||jo7||d}|||jo|d}q |}q W|i||ƒdS(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. iiN(RRRRRRRR(RRRRR((Rt insort_left+s   cCsi|djot|ƒ}nxE||jo7||d}|||jo|d}q |}q W|S(sqReturn 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. iiN(RRRRRRR(RRRRR((Rt bisect_left=s    (s bisect_rights bisect_lefts insort_lefts insort_rightsinsortsbisectN( t__doc__RR tinsortR tbisectR R t_bisectt ImportError(R RR RR R ((Rt?s/