input: Write a function to implement an insertion sort algorithm. The function should take a list as input and return the sorted list in non-decreasing order. Define the function by the name `insertion_sort`. 
  
  assert insertion_sort([5, 3, 8, 6, 7, 2])==[2, 3, 5, 6, 7, 8]
  assert insertion_sort([10, 9, 8, 7, 6, 5, 4, 3, 2, 1])==[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  assert insertion_sort([1, 2, 3, 5, 7, 11, 13])==[1, 2, 3, 5, 7, 11, 13]
  assert insertion_sort([])==[]
  assert insertion_sort([99])==[99]
output: def insertion_sort(arr):
      for i in range(1, len(arr)):
          key = arr[i]
          j = i - 1
          while j >= 0 and key < arr[j]:
              arr[j + 1] = arr[j]
              j -= 1
          arr[j + 1] = key
      return arr