(a, x, lo=0, hi=None, *, key=None)
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.
Insert item x in list a, and keep it sorted assuming a is sorted.
Insert item x in list a and keep it sorted assuming a is sorted .
def insort_left(a, x, lo=0, hi=None, *, key=None):
    """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.
    """

    if key is None:
        lo = bisect_left(a, x, lo, hi)
    else:
        lo = bisect_left(a, key(x), lo, hi, key=key)
    a.insert(lo, x)
def insort_left ( a , x , lo = 0 , hi = None , * , key = None ) : if key is None : lo = bisect_left ( a , x , lo , hi ) else : lo = bisect_left ( a , key ( x ) , lo , hi , key = key ) a . insert ( lo , x )