input: Write a function to perform an insertion sort on a given list of integers. This function should return the sorted list. If the input list is empty, the function should also return an empty list.
  assert insertion_sort([3, 5, 2, 1, 4]) == [1, 2, 3, 4, 5]
  assert insertion_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]
  assert insertion_sort([]) == []
  assert insertion_sort([1]) == [1]
  assert insertion_sort([5, 3, 4, 1, 2]) == [1, 2, 3, 4, 5]
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