def clamp_value(value, max_value=1.0, min_value=0.0):
    """Clamp a value between max and min

    Args:
        value (float): value to clamp

    Kwargs:
        max (float): max value

        min (float): min value

    Returns:
        .float

    """
    return max(min(value, max_value), min_value)