text: """
  Utility methods for validating sorting algorithms.
  """
  
  
  def is_sorted(nums):
      """
      Determines if list is sorted, throwing exception if not.
      """
      if not check_sorted(nums):
          raise ValueError('Not sorted!')
  
  
  def check_sorted(nums):
      """
      Determines if list is sorted.
      """
      for i, val in enumerate(nums):
          if i > 0 and val < nums[i - 1]:
              return False
      return True
  
  
  def unique(nums):
      """
      Determine if nums contains any duplicate values.
      """
      ascending = sorted(nums)
      for i in range(len(ascending) - 1):
          if ascending[i] == ascending[i + 1]:
              return False
      return True
  