Load relevant action/filter hooks.
483855
protected function load_hooks() {
		add_action( is_multisite() ? 'network_admin_menu' : 'admin_menu', [ $this, 'add_plugin_page' ] );
		add_action( 'network_admin_edit_github-updater', [ $this, 'update_settings' ] );

		add_filter(
			is_multisite()
			? 'network_admin_plugin_action_links_' . $this->ghu_plugin_name
			: 'plugin_action_links_' . $this->ghu_plugin_name,
			[ $this, 'plugin_action_links' ]
		);

		if ( $this->is_current_page( [ 'options.php', 'options-general.php', 'settings.php', 'edit.php' ] ) ) {
			add_action( 'admin_init', [ $this, 'update_settings' ] );
			add_action( 'admin_init', [ $this, 'page_init' ] );
		}
	}
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)
1239847
function loadNunjucks(filtersModule) {
  if (fs.existsSync(filtersModule)) {
    try {
      const filters = require(filtersModule);
      nj = templater.loadNjEnv(filters.sync, filters.async);
    } catch (e) {
      console.log('Failed to load Nunjucks environment: ', e);
      process.exit(1);
    }
  }
  else {
    try {
      nj = templater.loadNjEnv();
    } catch (e) {
      console.log('Failed to load Nunjucks environment: ', e);
      process.exit(1);
    }
  }
}
1018644
def action_filter(method_name, *args, **kwargs):
    

    def action_filter(value, context, **_params):
        method = getattr(context["action"], method_name)
        return _filter(method, value, args, kwargs)

    return action_filter
1230474
final private function parse_filters()
    {
        if (isset($this->filters) && \is_array($this->filters) && !empty($this->filters)) {
            $this->add_hooks($this->filters);
        }
    }
915369
def execute_hooks_for(type, name)
      model.hooks[name][type].each { |hook| hook.call(self) }
    end
1086367
public function hooks()
    {
        $this->hook->action(
            $this->isAllowedArea($this->getArea()),
            [$this, 'handleAction']
        )->dispatch();

        if (! empty($this->getArgument('execution'))) {
            $this->hook->filter(
                'script_loader_tag',
                [$this, 'addExecutionTypes']
            )->dispatch();
        }
    }
1091792
def _hooks_apply_before_serialize(
        hooks,  # type: Optional[Hooks]
        state,  # type: _ProcessorState
        value  # type: Any
):
    # type: (...) -> Any
    """"""
    if hooks and hooks.before_serialize:
        return hooks.before_serialize(ProcessorStateView(state), value)

    return value
1266816
def cmd(send, *_):
    
    hooklist = ', '.join([str(x) for x in hook_registry.get_known_hooks()])
    send('Loaded hooks: %s' % (hooklist))
157195
def invoke_hooks(hooks, name, *args, **kwargs):
    

    callbacks = hooks.get(name, [])

    for callback in callbacks:
        callback(*args, **kwargs)
1104612
def hooks_factory(identifier, configuration, context):
    
    manager = HookManager(identifier, configuration)
    manager.load_hooks(context)

    return manager
906802
def _run_hooked_methods(self, hook: str):
        
        for method in self._potentially_hooked_methods:
            for callback_specs in method._hooked:
                if callback_specs['hook'] != hook:
                    continue

                when = callback_specs.get('when')

                if when:
                    if self._check_callback_conditions(callback_specs):
                        method()
                else:
                    method()
716475
function _hook(slf, name, handlerInfo, params) {
  if (!slf.__hooks[name]) return;

  slf.__hooks[name].forEach(function (hook) {
    hook(handlerInfo, params);
  });
}
599596
def load_hooks
      self.site_hooks = instantiate_subclasses(Octopress::Hooks::Site) || []
      self.page_hooks = instantiate_subclasses(Octopress::Hooks::Page) || []
      self.post_hooks = instantiate_subclasses(Octopress::Hooks::Post) || []
      self.doc_hooks  = instantiate_subclasses(Octopress::Hooks::Document) || []
      self.all_hooks  = instantiate_subclasses(Octopress::Hooks::All) || []
    end
710389
def dispatch_hook(key, hooks, hook_data, **kwargs):
    """"""
    hooks = hooks or {}
    hooks = hooks.get(key)
    if hooks:
        if hasattr(hooks, '__call__'):
            hooks = [hooks]
        for hook in hooks:
            _hook_data = hook(hook_data, **kwargs)
            if _hook_data is not None:
                hook_data = _hook_data
    return hook_data
755721
def _load_hooks_settings(self):
        """"""
        log.debug("executing _load_hooks_settings")
        hook_show_widget = self.get_widget("hook_show")
        hook_show_setting = self.settings.hooks.get_string("show")
        if hook_show_widget is not None:
            if hook_show_setting is not None:
                hook_show_widget.set_text(hook_show_setting)
861775
function loadHooks() {
  var events = this._events;
  var jsFile = /\.js$/i;
  var hooksPath = this.fullPath('hook');
  var loadedHooks = [];
  if (fs.existsSync(hooksPath)) {
    var files = protos.util.ls(hooksPath, jsFile);
    for (var cb,idx,evt,file,len=files.length,i=0; i < len; i++) {
      file = files[i];
      evt = file.replace(jsFile, '');
      loadedHooks.push(evt);
      cb = protos.require(hooksPath + '/' + file, true);
      if (cb instanceof Function) {
        if (RELOADING) {
          var origCb = this.hooks[evt];
          if (origCb instanceof Function) {
            // Hook was added previously
            if (events[evt] instanceof Array) {
              idx = events[evt].indexOf(origCb);
              if (idx >= 0) {
                // If old function is in events array, replace it
                events[evt][idx] = this.hooks[evt] = cb;
              } else {
                // Otherwise, append to events array (add a new event handler)
                events[evt].push(cb);
                this.hooks[evt] = cb;
              }
            } else if (events[evt] instanceof Function) {
              if (events[evt] === origCb) {
                // If evt has only one callback, replace it
                events[evt] = this.hooks[evt] = cb;
              } else {
                // Otherwise, create an array with the old and new events
                events[evt] = [origCb, cb];
              }
            } // No else clause is needed here, it's either Function or Array
          } else {
            // This is a new event handler
            this.hooks[evt] = cb;
            this.on(evt, cb);
          }
        } else {
          // Add the event handler normally
          this.hooks[evt] = cb;
          this.on(evt, cb);
        }
      }
    }
  }

  // Remove any inexisting hooks
  for (evt in this.hooks) {
    if (loadedHooks.indexOf(evt) === -1) {
      app.removeListener(evt, this.hooks[evt]);
      delete this.hooks[evt];
    }
  }

}