Handles setup or teardown of option hook registration for the provided
        plugin.

        `plugin`
            ``Plugin`` class.
433727
def _setup_options(plugin):
    

    options = plugin.options

    if options and isinstance(options, (list, tuple)):
        for props in options:
            if isinstance(props, dict):
                if 'block' in props and 'options' in props:  # block
                    block = props['block']
                    option_list = props['options']

                    # options for this block
                    for props in option_list:
                        if isinstance(props, dict):
                            name = props.pop('name', None)

                            if name:
                                key = "{0}_{1}".format(block, name)
                                register('option', key, plugin, props)

                else:  # non-block option
                    name = props.pop('name', None)

                    if name:
                        register('option', name, plugin, props)
94972
public function registerPlugin($plugin)
    {
        /** @var AnaloguePluginInterface $plugin */
        $plugin = new $plugin($this);

        $this->events = array_merge($this->events, $plugin->getCustomEvents());

        $plugin->register();
    }
1322702
def hook(klass):
    

    if not hasattr(klass, 'do_vim'):
        setupMethod(klass, trace_dispatch)
        klass.__bases__ += (SwitcherToVimpdb, )
481202
def register_postparsing_hook(self, func: Callable[[plugin.PostparsingData], plugin.PostparsingData]) -> None:
        """"""
        self._validate_postparsing_callable(func)
        self._postparsing_hooks.append(func)
195593
def register(self, plugin):
        
        if plugin.name not in self._registered:
            logger.info('Registering plugin %s' % plugin.name)
            self._registered[plugin.name] = plugin
        else:
            logger.warn('Plugin %s already registered' % plugin.name)
479366
private function register_hooks() 
    {
        register_activation_hook(
            $this->plugin_file,
            get_called_class().'::activate'
        );

        register_deactivation_hook(
            $this->plugin_file,
            get_called_class().'::deactivate'
        );

        register_uninstall_hook(
            $this->plugin_file,
            get_called_class().'::uninstall'
        );
    }
10437
function(name, plugin){
    Flotr.plugins[name] = plugin;
    Flotr.defaultOptions[name] = plugin.options || {};
  }
126220
def register_plugin(self):
        """"""
        self.main.restore_scrollbar_position.connect(
            self.restore_scrollbar_position)
        self.main.console.edit_goto.connect(self.load)
        self.exec_in_extconsole.connect(self.main.execute_in_external_console)
        self.redirect_stdio.connect(self.main.redirect_internalshell_stdio)
        self.open_dir.connect(self.main.workingdirectory.chdir)
        self.set_help(self.main.help)
        if self.main.outlineexplorer is not None:
            self.set_outlineexplorer(self.main.outlineexplorer)
        editorstack = self.get_current_editorstack()
        if not editorstack.data:
            self.__load_temp_file()
        self.main.add_dockwidget(self)
        self.main.add_to_fileswitcher(self, editorstack.tabs, editorstack.data,
                                      ima.icon('TextFileIcon'))
273244
function Plugin(option) {
    return this.each(function () {
      var $this = $(this);
      var options = typeof option == 'object' && option;

      if (this == window || this == document || $this.is('body')) {
        Parallax.configure(options);
      }
      else if (!$this.data('px.parallax')) {
        options = $.extend({}, $this.data(), options);
        $this.data('px.parallax', new Parallax(this, options));
      }
      else if (typeof option == 'object')
      {
        $.extend($this.data('px.parallax'), options);
      }
      if (typeof option == 'string') {
        if(option == 'destroy'){
            Parallax.destroy(this);
        }else{
          Parallax[option]();
        }
      }
    });
  }
466312
def register_options(cls, register):
    """"""
    # The bootstrap options need to be registered on the post-bootstrap Options instance, so it
    # won't choke on them on the command line, and also so we can access their values as regular
    # global-scope options, for convenience.
    cls.register_bootstrap_options(register)

    register('-x', '--time', type=bool,
             help='Output a timing report at the end of the run.')
    register('-e', '--explain', type=bool,
             help='Explain the execution of goals.')
    register('--tag', type=list, metavar='[+-]tag1,tag2,...',
             help="Include only targets with these tags (optional '+' prefix) or without these "
                  "tags ('-' prefix).  Useful with ::, to find subsets of targets "
                  "(e.g., integration tests.)")

    # Toggles v1/v2 `Task` vs `@rule` pipelines on/off.
    register('--v1', advanced=True, type=bool, default=True,
             help='Enables execution of v1 Tasks.')
    register('--v2', advanced=True, type=bool, default=False,
             help='Enables execution of v2 @console_rules.')
    register('--v2-ui', default=False, type=bool, daemon=False,
             help='Whether to show v2 engine execution progress. '
                  'This requires the --v2 flag to take effect.')

    loop_flag = '--loop'
    register(loop_flag, type=bool,
             help='Run v2 @console_rules continuously as file changes are detected. Requires '
                  '`--v2`, and is best utilized with `--v2 --no-v1`.')
    register('--loop-max', type=int, default=2**32, advanced=True,
             help='The maximum number of times to loop when `{}` is specified.'.format(loop_flag))

    register('-t', '--timeout', advanced=True, type=int, metavar='<seconds>',
             help='Number of seconds to wait for http connections.')
    # TODO: After moving to the new options system these abstraction leaks can go away.
    register('-k', '--kill-nailguns', advanced=True, type=bool,
             help='Kill nailguns before exiting')
    register('--fail-fast', advanced=True, type=bool, recursive=True,
             help='Exit as quickly as possible on error, rather than attempting to continue '
                  'to process the non-erroneous subset of the input.')
    register('--cache-key-gen-version', advanced=True, default='200', recursive=True,
             help='The cache key generation. Bump this to invalidate every artifact for a scope.')
    register('--workdir-max-build-entries', advanced=True, type=int, default=8,
             help='Maximum number of previous builds to keep per task target pair in workdir. '
             'If set, minimum 2 will always be kept to support incremental compilation.')
    register('--max-subprocess-args', advanced=True, type=int, default=100, recursive=True,
             help='Used to limit the number of arguments passed to some subprocesses by breaking '
             'the command up into multiple invocations.')
    register('--lock', advanced=True, type=bool, default=True,
             help='Use a global lock to exclude other versions of pants from running during '
                  'critical operations.')
1238097
def configure(self, options, conf):
        
        Plugin.configure(self, options, conf)
        if options.filetype:
            self.filetypes += options.filetype
1215578
def register_plugins(cls, plugins):
        '''
        
        '''
        for model in plugins:
            cls.register_plugin(model, plugins[model])
318992
def register_hooks(func, hooks, obj):
    
    for name, args, kwargs in hooks:
        hook = getattr(obj, name)
        force_call = kwargs.pop("_force_call", False)
        if force_call or len(args) > 0 or len(kwargs) > 0:
            hook = hook(*args, **kwargs)
        hook(func)
1175384
def configure(self, options):
        
        self.client.api.configure_plugin(self.name, options)
        self.reload()
234320
def register(dispatcher, func, *, hook=None):
    
    wrapper = None
    if isinstance(func, (classmethod, staticmethod)):
        wrapper = type(func)
        func = func.__func__
    ensure_function(func)
    if isinstance(dispatcher, (classmethod, staticmethod)):
        wrapper = None
    dp = unwrap(dispatcher)
    try:
        dp.__functions
    except AttributeError:
        raise OverloadingError("%r has not been set up as an overloaded function." % dispatcher)
    fn = unwrap(func)
    if hook:
        dp.__hooks[hook] = func
    else:
        signature = get_signature(fn)
        for i, type_ in enumerate(signature.types):
            if not isinstance(type_, type):
                raise OverloadingError(
                  "Failed to overload function '{0}': parameter '{1}' has "
                  "an annotation that is not a type."
                  .format(dp.__name__, signature.parameters[i]))
        for fninfo in dp.__functions:
            dup_sig = sig_cmp(signature, fninfo.signature)
            if dup_sig and signature.has_varargs == fninfo.signature.has_varargs:
                raise OverloadingError(
                  "Failed to overload function '{0}': non-unique signature ({1})."
                  .format(dp.__name__, str.join(', ', (_repr(t) for t in dup_sig))))
        # All clear; register the function.
        dp.__functions.append(FunctionInfo(func, signature))
        dp.__cache.clear()
        dp.__maxlen = max(dp.__maxlen, len(signature.parameters))
        if typing:
            # For each parameter position and name, compute a bitwise union of complexity
            # values over all registered signatures. Retain the result for parameters where
            # a nonzero value occurs at least twice and at least one of those values is >= 2.
            # Such parameters require deep type-checking during function resolution.
            position_values = defaultdict(lambda: 0)
            keyword_values = defaultdict(lambda: 0)
            position_counter = Counter()
            keyword_counter = Counter()
            for fninfo in dp.__functions:
                sig = fninfo.signature
                complex_positions = {i: v for i, v in enumerate(sig.complexity) if v}
                complex_keywords = {p: v for p, v in zip(sig.parameters, sig.complexity) if v}
                for i, v in complex_positions.items():
                    position_values[i] |= v
                for p, v in complex_keywords.items():
                    keyword_values[p] |= v
                position_counter.update(complex_positions.keys())
                keyword_counter.update(complex_keywords.keys())
            dp.__complex_positions = {
                i: v for i, v in position_values.items() if v >= 2 and position_counter[i] > 1}
            dp.__complex_parameters = {
                p: v for p, v in keyword_values.items() if v >= 2 and keyword_counter[p] > 1}
    if wrapper is None:
        wrapper = lambda x: x
    if func.__name__ == dp.__name__:
        # The returned function is going to be bound to the invocation name
        # in the calling scope, so keep returning the dispatcher.
        return wrapper(dispatcher)
    else:
        return wrapper(func)
194868
def register_plugin(self, plugin):
        
        if hasattr(plugin, 'initialise'):
            plugin.initialise()
        if self.valid_api_plugin(plugin):
            log.debug("Registering API plugin: {}".format(plugin))
            self._api_plugins[plugin.request] = plugin()
        elif self.valid_debugger_plugin(plugin):
            log.debug("Registering debugger plugin: {}".format(plugin))
            self._debugger_plugins[plugin.host] = plugin()
        elif self.valid_view_plugin(plugin):
            log.debug("Registering view plugin: {}".format(plugin))
            self._view_plugins[plugin.name] = plugin()
        elif self.valid_web_plugin(plugin):
            log.debug("Registering web plugin: {}".format(plugin))
            self._web_plugins[plugin.name] = plugin()
        elif self.valid_command_plugin(plugin):
            log.debug("Registering command plugin: {}".format(plugin))
            self._command_plugins[plugin.name] = plugin()
            if voltron.debugger:
                voltron.debugger.register_command_plugin(plugin.name, plugin.command_class)
        else:
            log.debug("Ignoring invalid plugin: {}".format(plugin))
615037
function(plugin) {
            var ns = plugin, 
                plugins = this._plugins;
    
            if (L.isFunction(plugin)) {
                ns = plugin.NS;
                if (ns && (!plugins[ns] || plugins[ns] !== plugin)) {
                    ns = null;
                }
            }
    
            if (ns) {
                if (this[ns]) {
                    this[ns].destroy();
                    delete this[ns];
                }
                if (plugins[ns]) {
                    delete plugins[ns];
                }
            }
        }