def clip(value, minimum, maximum):
    """
    Function that clips a value between a minimum and a maximum.
    :param value: value to clip
    :param minimum: minimum value
    :param maximum: maximum value
    :return: clipped value
    """
    if value < minimum:
        return minimum
    elif value > maximum:
        return maximum
    return value