input: Write a function to perform a valid insertion sort on a given list of integers. If the list is empty or contains one element, it should return the original list.
  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 = j - 1
   arr[j + 1] = key
  return arr
  
  assert insertion_sort([3, 5, 1, 2, 4]) == [1, 2, 3, 4, 5]
  assert insertion_sort([10, 5, 8, 3, 1]) == [1, 3, 5, 8, 10]
  assert insertion_sort([4]) == [4]
  assert insertion_sort([]) == []
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 = j - 1
          arr[j + 1] = key
      return arr