Qf_ jdZd dddZd dddZd dddZd dddZ ddleZeZy#e$rY wxYw) zBisection algorithms.Nkeycv|t||||}nt||||||}|j||y)a7Insert 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_rightinsertaxlohirs -/opt/alt/python312/lib64/python3.12/bisect.py insort_rightrs< { !QB ' !SVR 5HHROc|dkr td| t|}|%||kr||zdz}|||kr|}n|dz}||kr|S||kr$||zdz}||||kr|}n|dz}||kr$|S)aReturn 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. rlo must be non-negative ValueErrorlenr r r r rmids r rrs Av233 z V {2g7q.C1S6z1W 2g I 2g7q.C3qv;1W 2g Ircv|t||||}nt||||||}|j||y)a5Insert 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_leftrrs r insort_leftr9s< { Ar2 & CFB 4HHROrc|dkr td| t|}|%||kr||zdz}|||kr|dz}n|}||kr|S||kr$||zdz}||||kr|dz}n|}||kr$|S)aReturn 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. rrrrrrs r rrJs Av233 z V {2g7q.Cvz1W 2g I 2g7q.C1S6{Q1W 2g Ir)*)rN) __doc__rrrr_bisect ImportErrorbisectinsortrr r$sbT"!T!HD"!D!J      s *22