Registers the inputted addon to the class.
        
        :param      name    | <str>
                    addon   | <variant>
2778
def registerAddon(cls, name, addon, force=False):
        
        prop = '_{0}__addons'.format(cls.__name__)
        cmds = getattr(cls, prop, {})

        if name in cmds and not force:
            raise errors.AddonAlreadyExists(cls, name, addon)

        cmds[name] = addon
        try:
            if issubclass(addon, cls):
                setattr(addon, '_{0}__addonName'.format(addon.__name__), name)
        except StandardError:
            pass

        setattr(cls, prop, cmds)
265538
def add_menu(self, name):
        
        if self.menubar is None:
            raise ValueError("No menu bar configured")
        return self.menubar.add_name(name)
1112622
def hook(self, name):
        
        def wrapper(func):
            self.hooks.add(name, func)
            return func
        return wrapper
1127559
def install(cls, type_, name, src, *args, **kwargs):
        """"""
        data = kwargs.pop('data', None)
        if data is None:
            data = {
                'addon': {
                    'type': type_,
                    'name': name,
                    'src': src,
                }
            }
        cls.create(data=data, *args, **kwargs)
935803
def register_helper(self, func):
        

        self._helper_names.add(func.__name__)
        return self.register(func)
933952
def register(cls, name):
        

        def decorate(klazz):
            """ Decorator. """
            if name in cls._events:
                raise GerritError("Duplicate event: %s" % name)
            cls._events[name] = [klazz.__module__, klazz.__name__]
            klazz.name = name
            return klazz
        return decorate
873843
def register(name, mod, options)
      elements[name] = plugin_type.new(mod, options)
    end
1125829
function addTo(name) {
            var indexName = name,
                match = name.match(/^([^\(]*)\s*\(([^\)]*)\)\s*/),
                params = match && match[2];
            name = match && match[1] || name;

            if (!index[indexName]) {
                if (params) {
                    // there can be no function calls here because of the regex match
                    /*jshint evil: true */
                    params = eval('[' + params + ']');
                }
                var mixin = _mixins[name],
                    checkAgain = false,
                    skip = false;

                if (mixin) {
                    if (typeof mixin === 'function') {
                        if (_initiatedOnce[name]) {
                            if (!initiatedOnce[name]) {
                                initiatedOnce[name] = [];
                                // add the placeholder so the mixin ends up in the right place
                                // we will replace all names with the appropriate mixins at the end
                                // (so we have all of the appropriate arguments)
                                mixin = name;
                            } else {
                                // but we only want to add it a single time
                                skip = true;
                            }
                            if (params) {
                                initiatedOnce[name].push(params);
                            }
                        } else {
                            mixin = mixin.apply(this, params || []);
                            checkAgain = true;
                        }
                    } else if (params) {
                        throw new Error('the mixin "' + name + '" does not support parameters');
                    }
                    get(_dependsOn[name], index, initiatedOnce, rtn);
                    get(_dependsInjected[name], index, initiatedOnce, rtn);

                    index[indexName] = true;
                    if (checkAgain) {
                        get([mixin], index, initiatedOnce, rtn);
                    } else if (!skip) {
                        checkForInlineMixins(mixin, rtn);
                        rtn.push(mixin);
                    }

                } else {
                    throw new Error('invalid mixin "' + name + '"');
                }
            }
        }
786161
def register_plugin(name, &block)
      plugin = Plugin.new
      plugin.instance_eval(&block)
      @plugins[name] = plugin
    end
1015451
def register(cls):
    
    definition_name = make_definition_name(cls.__name__)
    REGISTRY[definition_name] = cls
    return cls
130525
def activate(name):
    
    if name in plugins:
        plugins[name].activate()
    else:
        raise Exception("plugin {} not found".format(name))
1020918
def register_widget(widget):
    
    if widget in registry:
        raise WidgetAlreadyRegistered(
            _('The widget %s has already been registered.') % widget.__name__)
    registry.append(widget)
381747
def register(self, typ):
        
        # should be able to combine class/instance namespace, and inherit from either
        # would need to store meta or rely on copy ctor
        def _func(cls):
            if typ in self._class:
                raise ValueError("duplicated type name '%s'" % typ)
            cls.plugin_type = typ
            self._class[typ] = cls
            return cls
        return _func
633869
function registerExtension(name, extension, options, mergeConfig) {
  var params = name;

  if (!isObject(name)) {
    params = {};
    params[name] = {
      extension: extension,
      options: options
    };
  }

  each(params, function (v, name) {
    if (v) {
      var _extension = v.extension,
          _options3 = v.options;

      if (_extension) {
        extensions[name] = _extension;
      } else if (!mergeConfig) {
        extensions[name] = v;
      }

      if (mergeConfig) {
        if (!extensionConfig[name]) {
          extensionConfig[name] = _config();
        }

        assign(extensionConfig[name], _options3);
      } else {
        extensionConfig[name] = _config(_options3);
      }
    }
  }, false);
}
463931
public void addAndRegisterAddOns(List<AddOnModel> addOns) {
        this.addOns.addAll(addOns);
        registerAllAddOns(this.addOns);
        initialized();
    }
517732
def _register_bench_extension(self, plugin_name, plugin_instance):
        
        for attr in plugin_instance.get_bench_api().keys():
            if hasattr(self.bench, attr):
                raise PluginException("Attribute {} already exists in bench! Unable to add "
                                      "plugin {}.".format(attr, plugin_name))
            setattr(self.bench, attr, plugin_instance.get_bench_api().get(attr))
208158
def register(name, validator):
    """"""
    if not isinstance(validator, Validator):
        raise TypeError("Validator instance expected, %s given" % validator.__class__)
    _NAMED_VALIDATORS[name] = validator