def _safe_delay(delay):
    """Checks that `delay` is a positive float number else raises a
    ValueError."""
    try:
        delay = float(delay)
    except ValueError:
        raise ValueError("{} is not a valid delay (not a number)".format(delay))
    if delay < 0:
        raise ValueError("{} is not a valid delay (not positive)".format(delay))
    return delay