code: def register_plugin(self, name, plugin):
          
          if self.has_plugin(name):
              self.release_plugin(name)
          self._active_plugins[name] = plugin
          setattr(self, name, plugin)
          return plugin
docs: Add a new plugin ``plugin`` with name ``name`` to the active plugins.