
    F\h_                     |    S r S	SS.S jjrS	SS.S jjrS	SS.S jjrS	SS.S jjr SSK7  \r\rg! \ a     Nf = f)
zBisection algorithms.    Nkeyc                h    Uc  [        XX#5      nO[        X" U5      X#US9nU R                  X!5        g)a#  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.

A custom key function can be supplied to customize the sort order.
Nr   )bisect_rightinsertaxlohir   s        /usr/lib/python3.13/bisect.pyinsort_rightr      s4     {!'!SVR5HHRO    c                    US:  a  [        S5      eUc  [        U 5      nUc%  X#:  a  X#-   S-  nXU   :  a  UnOUS-   nX#:  a  M  U$ X#:  a#  X#-   S-  nX" X   5      :  a  UnOUS-   nX#:  a  M#  U$ )a  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, a.insert(i, x) will
insert just after the rightmost x already there.

Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.

A custom key function can be supplied to customize the sort order.
r   lo must be non-negative      
ValueErrorlenr	   r
   r   r   r   mids         r   r   r      s     
Av233	zV {g7q.CS6z1W g I g7q.C3qv;1W g Ir   c                h    Uc  [        XX#5      nO[        X" U5      X#US9nU R                  X!5        g)a!  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.

A custom key function can be supplied to customize the sort order.
Nr   )bisect_leftr   r   s        r   insort_leftr   9   s4     {r&CFB4HHROr   c                    US:  a  [        S5      eUc  [        U 5      nUc%  X#:  a  X#-   S-  nX   U:  a  US-   nOUnX#:  a  M  U$ X#:  a$  X#-   S-  nU" X   5      U:  a  US-   nOUnX#:  a  M$  U$ )a  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, a.insert(i, x) will
insert 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.

A custom key function can be supplied to customize the sort order.
r   r   r   r   r   r   s         r   r   r   J   s     
Av233	zV {g7q.Cvz1W g I g7q.C16{Q1W g Ir   )*)r   N)	__doc__r   r   r   r   _bisectImportErrorbisectinsort r   r   <module>r$      sb    T "!T !HD "!D !J	
 
	  		s   2 ;;