def insertion_sort(arr):
    """
    The function insertion_sort() sorts the given list using insertion sort algorithm.
    The function returns the list after sorting it.
    Arguments
    arr : An unsorted list.
    """
    for x in arr[1:]:
        for y in arr[arr.index(x)-1::-1]:
            if x < y:
                arr[arr.index(x)] = y
                arr[arr.index(y)] = x                                
    return arr