def get_attribute_rotator(obj, attr_name, values):
    """Return a function to rotate obj attribute values.

    Creates a partial from the provided arguments and the
    rotate_attribute function.

    obj (any object which can have attributes set on it)
        object whose attribute is used to hold the value.
    attr_name (string)
        name of the attribute where to store a value.
    values (iterable containing any python objects/values)
        values between which to toggle.

    Also sets the first value on the obj attribute.

    >>> values = [12, 32, 45, 26]
    >>> rotate = get_attribute_rotator
    """
    values_deque = deque(values)

    setattr(obj, attr_name, values_deque[0])

    return partial(rotate_attribute, obj, attr_name, values_deque)
Return a function to rotate obj attribute values.

    Creates a partial from the provided arguments and the
    rotate_attribute function.

    obj (any object which can have attributes set on it)
        object whose attribute is used to hold the value.
    attr_name (string)
        name of the attribute where to store a value.
    values (iterable containing any python objects/values)
        values between which to toggle.

    Also sets the first value on the obj attribute.

    >>> values = [12, 32, 45, 26]
    >>> rotate = get_attribute_rotator
    
nodezator/ourstdlibs/behaviour.py