def clamp(min_v, max_v, value):
    """
    Clamps a value between a min and max value
    Args:
        min_v: Minimum value
        max_v: Maximum value
        value: Value to be clamped

    Returns:
        Returns the clamped value
    """
    return min_v if value < min_v else max_v if value > max_v else value