def insert_sort(self, list_with_order: list, list_b: list, cmp):
    for obj_b in list_b:
        i = 0
        mid = 0
        j = (len(list_with_order) - 1)
        while (i < j):
            mid = ((i + j) // 2)
            obj_mid = list_with_order[mid]
            flag = cmp(obj_mid, obj_b)
            if (flag == (- 1)):
                if (mid == i):
                    flag2 = cmp(list_with_order[j], obj_b)
                    if (flag2 == (- 1)):
                        mid = j
                    elif (flag2 == 1):
                        mid = (j - 1)
                    else:
                        mid = j
                    break
                i = mid
            elif (flag == 1):
                if (mid == j):
                    flag2 = cmp(list_with_order[i], obj_b)
                    if (flag2 == (- 1)):
                        mid = i
                    elif (flag2 == 1):
                        mid = (i - 1)
                    else:
                        mid = i
                    break
                j = mid
            elif (flag == 0):
                break
        list_with_order.insert((mid + 1), obj_b)
    return list_with_order
def insert_sort(self, list_with_order: list, list_b: list, cmp):
    for obj_b in list_b:
        i = 0
        mid = 0
        j = (len(list_with_order) - 1)
        while (i < j):
            mid = ((i + j) // 2)
            obj_mid = list_with_order[mid]
            flag = cmp(obj_mid, obj_b)
            if (flag == (- 1)):
                if (mid == i):
                    flag2 = cmp(list_with_order[j], obj_b)
                    if (flag2 == (- 1)):
                        mid = j
                    elif (flag2 == 1):
                        mid = (j - 1)
                    else:
                        mid = j
                    break
                i = mid
            elif (flag == 1):
                if (mid == j):
                    flag2 = cmp(list_with_order[i], obj_b)
                    if (flag2 == (- 1)):
                        mid = i
                    elif (flag2 == 1):
                        mid = (i - 1)
                    else:
                        mid = i
                    break
                j = mid
            elif (flag == 0):
                break
        list_with_order.insert((mid + 1), obj_b)
    return list_with_order