Restores default signal handlers.
16776
def _uninstall_signal_handlers(self):
        
        signal.signal(signal.SIGINT, signal.SIG_DFL)
        signal.signal(signal.SIGTERM, signal.SIG_DFL)
411033
def _sort_handlers(cls, signals, handlers, configs):
        
        def macro_precedence_sorter(flags, hname):
            """The default is to sort 'bottom_up', with lower level getting
            executed first, but sometimes you need them reversed."""
            data = configs[hname]
            topdown_sort = SignalOptions.SORT_TOPDOWN in flags
            if topdown_sort:
                level = levels_count - 1 - data['level']
            else:
                level = data['level']
            if 'begin' in data:
                return (-1, level, hname)
            elif 'end' in data:
                return (1, level, hname)
            else:
                return (0, level, hname)

        levels_count = len(handlers.maps)
        per_signal = defaultdict(list)
        for level, m in enumerate(reversed(handlers.maps)):
            for hname, sig_name in m.items():
                sig_handlers = per_signal[sig_name]
                if hname not in sig_handlers:
                    configs[hname]['level'] = level
                    sig_handlers.append(hname)
        for sig_name, sig_handlers in per_signal.items():
            if sig_name in signals:  # it may be on a mixin
                flags = signals[sig_name].flags
                sig_handlers.sort(key=partial(macro_precedence_sorter,
                                              flags))
        return per_signal
1130080
protected function cleanup_error_handler()
    {
        restore_error_handler();

        if ($this->last_error !== null) {
            throw new \ErrorException(
                $this->last_error['errstr'],
                0,
                $this->last_error['errno'],
                $this->last_error['errfile'],
                $this->last_error['errline']
            );
        }
    }
644305
def _trapped_signals(self, client):
    """"""
    signal_handler = PailgunClientSignalHandler(
      client,
      timeout=self._bootstrap_options.for_global_scope().pantsd_pailgun_quit_timeout)
    with ExceptionSink.trapped_signals(signal_handler):
      yield
461343
def setup_signals():
	
	signal.signal(signal.SIGINT, shutit_util.ctrl_c_signal_handler)
	signal.signal(signal.SIGQUIT, shutit_util.ctrl_quit_signal_handler)
799331
def enable_sig_handler(signal_name, handler):
    '''
    
    '''
    if hasattr(signal, signal_name):
        signal.signal(getattr(signal, signal_name), handler)
68428
def install_signal_handlers(self):
        

        self.graceful_stop = False

        def request_shutdown_now():
            self.shutdown_now()

        def request_shutdown_graceful():

            # Second time CTRL-C, shutdown now
            if self.graceful_stop:
                self.shutdown_now()
            else:
                self.graceful_stop = True
                self.shutdown_graceful()

        # First time CTRL-C, try to shutdown gracefully
        gevent.signal(signal.SIGINT, request_shutdown_graceful)

        # User (or Heroku) requests a stop now, just mark tasks as interrupted.
        gevent.signal(signal.SIGTERM, request_shutdown_now)
1036729
def unregister_signals_oaiset(self):
        """"""
        from .models import OAISet
        from .receivers import after_insert_oai_set, \
            after_update_oai_set, after_delete_oai_set
        if contains(OAISet, 'after_insert', after_insert_oai_set):
            remove(OAISet, 'after_insert', after_insert_oai_set)
            remove(OAISet, 'after_update', after_update_oai_set)
            remove(OAISet, 'after_delete', after_delete_oai_set)
1143619
public void clearHandlers() {

        for (Map<String, CmsAttributeHandler> handlers : m_handlers) {
            for (CmsAttributeHandler handler : handlers.values()) {
                handler.clearHandlers();
            }
            handlers.clear();
        }
        m_handlers.clear();
        m_handlers.add(new HashMap<String, CmsAttributeHandler>());
        m_handlerById.clear();
    }
1222531
def signal_handler_mapping(self):
    """"""
    # Could use an enum here, but we never end up doing any matching on the specific signal value,
    # instead just iterating over the registered signals to set handlers, so a dict is probably
    # better.
    return {
      signal.SIGINT: self.handle_sigint,
      signal.SIGQUIT: self.handle_sigquit,
      signal.SIGTERM: self.handle_sigterm,
    }
98735
def set_stop_handler(self):
        
        signal.signal(signal.SIGTERM, self.graceful_stop)
        signal.signal(signal.SIGABRT, self.graceful_stop)
        signal.signal(signal.SIGINT, self.graceful_stop)
820326
def restore(self):
        """"""
        signal.signal(signal.SIGINT, self.original_sigint)
        signal.signal(signal.SIGTERM, self.original_sigterm)
        if os.name == 'nt':
            signal.signal(signal.SIGBREAK, self.original_sigbreak)
1087630
def uninitialize(cls) -> None:
        """"""
        if not cls._initialized:
            return
        signal.signal(signal.SIGCHLD, cls._old_sigchld)
        cls._initialized = False
668908
def stop(self):
        

        if self.original_handler is not None:
            signal.signal(signal.SIGWINCH, self.original_handler)
25703
def _vpn_signal_handler(self, args):
        """"""
        # Args is a dictionary of changed properties
        # We only care about changes in ActiveConnections
        active = "ActiveConnections"
        # Compare current ActiveConnections to last seen ActiveConnections
        if active in args.keys() and sorted(self.active) != sorted(args[active]):
            self.active = args[active]
            self.py3.update()
23347
def _reset_sig_handler(self):
        """"""

        signal.signal(signal.SIGINT, self.old_sigint)
        signal.signal(signal.SIGTERM, self.old_sigterm)
        try:
            signal.signal(signal.SIGHUP, self.old_sighup)
        except AttributeError:
            pass
838432
def unblock_signals(self):
        """"""
        self.aggregation_layer_combo.blockSignals(False)
        self.exposure_layer_combo.blockSignals(False)
        self.hazard_layer_combo.blockSignals(False)