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