def clamp(value: float, min_value: float, max_value: float) -> float:
    """Ensures the **value** is contained within bounds (a minimum and a maximum).

    :param value: The value to *clamp*
    :param min_value: The lower bound
    :param max_value: The upper bound
    :type value: float
    :type min_value: float
    :type max_value: float
    :return: The clamped value
    :rtype: float
    """
    return max(min_value, min(value, max_value))