def insertion_sort(L):
  """
  Insertion sort implementation

  Complexity: O(n ** 2)

  """
  for i in range(1, len(L)):
    for j in range(0, i):
      if L[i - j] < L[i - j - 1]:
        L[i - j],  L[i - j - 1] = L[i - j - 1], L[i - j]
  return L