<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append(self, mode):
 """ Adds a mode to the editor. :param mode: The mode instance to append. """

        _logger().log(5, 'adding mode %r', mode.name)
        self._modes[mode.name] = mode
        mode.on_install(self.editor)
        return mode