def positive_timedelta(value):
    """Validate timedelta is positive."""
    if value < timedelta(0):
        raise vol.Invalid('Time period should be positive')
    return value
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/config_validation.py/positive_timedelta/original