def resettable(f):
def wrapper(self, new_value):<EOL><INDENT>context = get_context(self)<EOL>if context:<EOL><INDENT>old_value = getattr(self, f.__name__)<EOL>if old_value == new_value:<EOL><INDENT>return<EOL><DEDENT>context(partial(f, self, old_value))<EOL><DEDENT>f(self, new_value)<EOL><DEDENT>return wrapper<EOL>
A decorator to simplify the context management of simple object
    attributes. Gets the value of the attribute prior to setting it, and stores
    a function to set the value to the old value in the HistoryManager.