def clamp(value, min_value, max_value):
    """
    Method to clamp a value between a certain range.

    Args:
        value(float): Value to clamp.
        min_value(float): Minimum limit to clamp the value with.
        max_value(float): Upper limit to clamp the value with.

    Returns:
        value(float): Value clamped between the maximum and minimum values.

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