docs: def trim_nones_from_right(xs):
      """
      Returns the list without all the Nones at the right end.
  
      >>> trim_nones_from_right([1, 2, None, 4, None, 5, None, None])
      [1, 2, None, 4, None, 5]
  
      """
      # Find the first element that does not contain none.
      for i, item in enumerate(reversed(xs)):
          if item is not None:
              break
  
      return xs[:-i]