Trigger hooks after command.
333527
def onecmd_plus_hooks(self, line):
        '''  '''
        if not line:
            return self.emptyline()
        return Cmd.onecmd_plus_hooks(self, line)
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();
        }
    }
1135770
def _after_event(self, e):
        '''
            
        '''
        ''' my patch, serialize to redis '''
        self.r.set(self.rhname, self.current)
        for fnname in ['onafter' + e.event, 'on' + e.event]:
            if hasattr(self, fnname):
                return getattr(self, fnname)(e)
404328
def register_hook(self, event, hook):
        """"""

        if event not in self.hooks:
            raise ValueError('Unsupported event specified, with event name "%s"' % (event))

        if isinstance(hook, Callable):
            self.hooks[event].append(hook)
        elif hasattr(hook, '__iter__'):
            self.hooks[event].extend(h for h in hook if isinstance(h, Callable))
614143
def run_hook(hook_name, *args)
      list = self.class.all_hooks(hook_name)
      shell = self
      list.each do |hook|
        result = hook.call(shell, *args)
        return :break if result == :break
      end
      list.any?
    end
737100
def _post_transition(self, result, *args, **kwargs):
        """"""
        for hook in self._filter_hooks(HOOK_AFTER, HOOK_ON_ENTER):
            hook(self.instance, result, *args, **kwargs)
1043246
def handle_event(self, event):
        """"""
        if event.get('command'):
            if event['command'] == 'on':
                cmd = 'off'
            else:
                cmd = 'on'

            task = self.send_command_ack(event['id'], cmd)
            self.loop.create_task(task)
570454
def on_batch_end(self, train, **kwargs):
        ""
        if train: self.stats.append(self.hooks.stored)
668354
public function runAfter() {
        if($this->_afterController !== null) {
            foreach($this->_afterController as $hookProvider) {
                $hookProvider->doAfter();
            }
        }
    }
1266816
def cmd(send, *_):
    
    hooklist = ', '.join([str(x) for x in hook_registry.get_known_hooks()])
    send('Loaded hooks: %s' % (hooklist))
193107
def _trigger_event(self, event, *args, **kwargs):
        """"""
        run_async = kwargs.pop('run_async', False)
        if event in self.handlers:
            if run_async:
                return self.start_background_task(self.handlers[event], *args)
            else:
                try:
                    return self.handlers[event](*args)
                except:
                    self.logger.exception(event + ' handler error')
855205
def postprocess_keyevent(self, event):
        """"""
        ShellBaseWidget.postprocess_keyevent(self, event)
        if QToolTip.isVisible():
            _event, _text, key, _ctrl, _shift = restore_keyevent(event)
            self.hide_tooltip_if_necessary(key)
125310
def post_register_hook(self, verbosity=1):
        """"""
        if not getattr(settings, 'FLOW_DOCKER_DONT_PULL', False):
            call_command('list_docker_images', pull=True, verbosity=verbosity)
1148899
def trigger(self, event: str, *args: T.Any, **kw: T.Any) -> bool:
        """"""

        callbacks = list(self._events.get(event, []))
        if not callbacks:
            return False

        for callback in callbacks:
            callback(*args, **kw)
        return True
1365580
def _prompt_started_hook(self):
        """"""
        if not self._reading:
            self._highlighter.highlighting_on = True
            self.sig_prompt_ready.emit()
966789
def _run_hooks(config, hooks, args, environ):
    """"""
    skips = _get_skips(environ)
    cols = _compute_cols(hooks, args.verbose)
    filenames = _all_filenames(args)
    filenames = filter_by_include_exclude(filenames, '', config['exclude'])
    classifier = Classifier(filenames)
    retval = 0
    for hook in hooks:
        retval |= _run_single_hook(classifier, hook, args, skips, cols)
        if retval and config['fail_fast']:
            break
    if retval and args.show_diff_on_failure and git.has_diff():
        if args.all_files:
            output.write_line(
                'pre-commit hook(s) made changes.\n'
                'If you are seeing this message in CI, '
                'reproduce locally with: `pre-commit run --all-files`.\n'
                'To run `pre-commit` as part of git workflow, use '
                '`pre-commit install`.',
            )
        output.write_line('All changes made by hooks:')
        subprocess.call(('git', '--no-pager', 'diff', '--no-ext-diff'))
    return retval
34377
def exec_hook(event_name, *args, &block)
      @hooks[event_name.to_s].map do |hook_name, callable|
        begin
          callable.call(*args, &block)
        rescue PuppetDebugger::Exception::Error, ::RuntimeError => e
          errors << e
          e
        end
      end.last
    end