code: def get_single_value(value):
      
      if not all_elements_equal(value):
          raise ValueError('Not all values are equal to each other.')
  
      if is_scalar(value):
          return value
      return value.item(0)
docs: Get a single value out of the given value.
  
      This is meant to be used after a call to :func:`all_elements_equal` that returned True. With this
      function we return a single number from the input value.
  
      Args:
          value (ndarray or number): a numpy array or a single number.
  
      Returns:
          number: a single number from the input
  
      Raises:
          ValueError: if not all elements are equal