Loop over all plugins and invoke function `hook` with `args` and
        `kwargs` in each of them. If the plugin does not have the function, it
        is skipped.
190317
def run_hook(self, hook, *args, **kwargs):
        
        for plugin in self.raw_plugins:
            if hasattr(plugin, hook):
                self.logger.debug('Calling hook {0} in plugin {1}'.format(hook, plugin.__name__))
                getattr(plugin, hook)(*args, **kwargs)
914544
def call_extra(self, methods, kwargs):
        
        old = list(self._nonwrappers), list(self._wrappers)
        for method in methods:
            opts = dict(hookwrapper=False, trylast=False, tryfirst=False)
            hookimpl = HookImpl(None, "<temp>", method, opts)
            self._add_hookimpl(hookimpl)
        try:
            return self(**kwargs)
        finally:
            self._nonwrappers, self._wrappers = old
532455
def patched_function(self, *args, **kwargs):
        
        self.validate(*args, **kwargs)
        return self.function(*args, **kwargs)
81836
def run_hook(hook_name, *args, &block)
      hooks.find {|hook| hook.name == hook_name }.run(self, *args, &block)
    end
1094956
def _register_hook(hook_name, target, func, *args, **kwargs):
    
    call = (func, args, kwargs)
    try:
        getattr(target, hook_name).append(call)
    except AttributeError:
        setattr(target, hook_name, [call])
569240
def call_hook(self, name, **kwargs):
        
        return [y for y in [x(**kwargs) for x, _ in self._hooks.get(name, [])] if y is not None]
640954
def trigger_hook(self, __name, *args, **kwargs):
        '''  '''
        return [hook(*args, **kwargs) for hook in self._hooks[__name][:]]
1148474
def run_plugins(plugins, url_data, stop_after_match=False, **kwargs):
    """"""
    for plugin in plugins:
        log.debug(LOG_PLUGIN, "Run plugin %s", plugin.__class__.__name__)
        if plugin.applies_to(url_data, **kwargs):
            plugin.check(url_data)
            if stop_after_match:
                break
392391
def get_enabled_hook_plugins(self, hook, args, **kwargs):
        
        manager = self.hook_managers[hook]
        if len(list(manager)) == 0:
            return []
        return [
            plugin for plugin in manager.map(
                self._create_hook_plugin, args, **kwargs)
            if plugin is not None
        ]
1235717
function hook() {
      var comp = hook.proxy.apply(null, arguments);
      for(var i = 0;i < hooks.length;i++) {
        hooks[i].apply(comp, arguments);
      }
      return comp;
    }
593079
def hook(module):
    
    if "INSTANA_DEV" in os.environ:
        print("==============================================================")
        print("Instana: Running flask hook")
        print("==============================================================")
    wrapt.wrap_function_wrapper('flask', 'Flask.__init__', wrapper)
249654
public function invokePluginsHook($hook, $args)
    {
        foreach ($this->getPlugins() as $plugin) {
            if (method_exists($plugin, $hook)) {
                call_user_func_array(array($plugin, $hook), $args);
            }
        }
    }
50686
def trigger_hook(self, name, *args, **kwargs):
        """"""
        method = getattr(self, name, None)
        if is_callable(method):
            method(*args, **kwargs)
            
        try:
            children = self.children
        except AttributeError:
            return
        else:
            if children is not None:
                for child in children:
                    method = getattr(child, 'trigger_hook', None)
                    if is_callable(method):
                        method(name, *args, **kwargs)
                    else:
                        method = getattr(child, name, None)
                        if is_callable(method):
                            method(*args, **kwargs)
153764
function (plugin) {
    if (Array.isArray(plugin)) {
      for (var i = 0; i < plugin.length; i++) this.use(plugin[i]);
    } else if (typeof plugin === 'function') {
      plugin(this);
    } else {
      throw new TypeError('plugin must be a Function or an Array of Functions')
    }
    return this
  }
1368322
def inject(self, func, **kwargs):
        
        args, varargs, keywords, defaults = self._get_argspec(func)
        if defaults:
            required_args = args[:-len(defaults)]
            optional_args = args[len(required_args):]
        else:
            required_args = args
            optional_args = []
        values = [
            kwargs[arg] if arg in kwargs else self[arg]
            for arg in required_args
        ]
        if defaults:
            values.extend(
                kwargs[arg] if arg in kwargs else self.get(arg, default)
                for arg, default in zip(optional_args, defaults)
            )
        return func(*values)
972269
def reload_all_plugins(self, *args):
        
        for manifest in self._manifests[:]:
            if self.get_plugin(manifest["name"]) is not None:
                self.reload_plugin(manifest["name"], *args)
35609
def _capture(self, args, kwargs):
        ''''''
        self.called = self.called + 1
        self.method_args.append(args)
        self.named_method_args.append(kwargs)
        self.never_called = False