def insertion_sort(seq):
    ''' sort a sequence using the insertion sort alg '''
    for i in range(1, len(seq)):
        j = i
        while j > 0 and seq[j-1] > seq[j]:
            seq[j-1], seq[j] = seq[j], seq[j-1]
            j -= 1
    return seq
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/searching_and_sorting/sorting/insertion_sort.py/insertion_sort/original