import math


def _pos_sqrt(value: float) -> float:
  """Returns sqrt of value or raises ValueError if negative."""
  if value < 0:
    raise ValueError('Attempt to take sqrt of negative value: {}'.format(value))
  return math.sqrt(value)