def clip(value, minimum, maximum):
    """ Clip a value between two other values. """
    if value < minimum:
        return minimum
    elif value > maximum:
        return maximum
    else:
        return value
