def get_next_value(value, values):
    """
    Returns the next value from values which is larger then value or the
    first item from the sequence values.
    """
    for item in values:
        if item > value:
            return item
    return values[0]