docs: def remove(self, name_or_klass):
          """
          Removes a mode from the editor.
  
          :param name_or_klass: The name (or class) of the mode to remove.
          :returns: The removed mode.
          """
          _logger().log(5, 'removing mode %r', name_or_klass)
          mode = self.get(name_or_klass)
          mode.on_uninstall()
          self._modes.pop(mode.name)
          return mode