Removes handlers we have added, and restores others if possible
8024
public function deregisterGlobalHandlers()
    {
        if ($this->registered) {
            // Restore the previous error handler if available
            set_error_handler(
                is_callable($this->errorHandler) ? $this->errorHandler : function () { }
            );
            // Restore the previous exception handler if available
            set_exception_handler(
                is_callable($this->exceptionHandler) ? $this->exceptionHandler : function () { }
            );
            $this->registered = false;
        }
    }
759894
def recover_all_handler(self):
        
        for handler in self._handler_cache:
            self.logger.addHandler(handler)
        self._handler_cache = list()
75872
def remove_all_handlers(logger=None):
    
    if not isinstance(logger, logging.Logger):
        logger = logging.getLogger(logger)

    remove_file_handlers(logger)
    logger.handlers = []
1080741
def cleanup(self):
        """"""
        self.parser = None
        self.request = None
        self.url = None
        self.headers = None
        self._request_handler_task = None
        self._request_stream_task = None
        self._total_request_size = 0
        self._is_stream_handler = False
673385
public function cleanup()
    {
        // unlock everything
        foreach ($this->locks as $lock) {
            flock($lock, LOCK_UN);
            fclose($lock);
        }

        $this->locks = [];
    }
311674
def cleanup(self):
        
        self.lock.acquire()
        logger.debug('Acquired lock in cleanup for ' + str(self))
        self.children = [child for child in self.children if child.is_alive()]
        self.lock.release()
1101179
def unmount_process(self, process):
    

    # There is no remove_handlers, but .handlers is public so why not.  server.handlers is a list of
    # 2-tuples of the form (host_pattern, [list of RequestHandler]) objects.  We filter out all
    # handlers matching our process from the RequestHandler list for each host pattern.
    def nonmatching(handler):
      return 'process' not in handler.kwargs or handler.kwargs['process'] != process

    def filter_handlers(handlers):
      host_pattern, handlers = handlers
      return (host_pattern, list(filter(nonmatching, handlers)))

    self.app.handlers = [filter_handlers(handlers) for handlers in self.app.handlers]
1232349
def unbind(self, handler, argspec):
        
        self.handlers[argspec.key].remove((handler, argspec))
        if not len(self.handlers[argspec.key]):
            del self.handlers[argspec.key]
851760
def _delete_handler(self, handler_class):
        """"""
        to_remove = self._get_handler(handler_class)
        if not to_remove:
            logging.warning('Error we should have an element to remove')
        else:
            self.handlers.remove(to_remove)
            self.logger.removeHandler(to_remove)
325388
public function cleanup()
    {
        $this->cleaned = true;
        $this->remoteMethods = [];
        $this->localMethods = [];
        $this->persistentCallbacks = [];
        $this->callbacks = [];
    }
1049014
def unhook_all():
    
    _listener.start_if_necessary()
    _listener.blocking_keys.clear()
    _listener.nonblocking_keys.clear()
    del _listener.blocking_hooks[:]
    del _listener.handlers[:]
    unhook_all_hotkeys()
433931
def cleanup(self):
        
        for actor in self.actors:
            if actor.skip:
                continue
            actor.cleanup()
        super(ActorHandler, self).cleanup()
168772
public static void removeHandlersForRootLogger() {
        java.util.logging.Logger rootLogger = getRootLogger();
        java.util.logging.Handler[] handlers = rootLogger.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            rootLogger.removeHandler(handlers[i]);
        }
    }
496395
function() {

		for (var name in this._events_listeners) {

			if (this._events_listeners[name]) {

				Lava.Core.removeGlobalHandler(this._events_listeners[name]);
				this._events_listeners[name] = null;
				this._event_usage_counters[name] = 0;

			}

		}

	}
1198032
function cleanup()
    {
      if(chan.timer) clearTimeout(chan.timer);
      chan.timer = setTimeout(function(){
        chan.state = "gone"; // in case an app has a reference
        x.channels[chan.id] = {state:"gone"}; // remove our reference for gc
      }, chan.timeout);
    }
525296
def reset_handler(self, cmd):
        """"""
        self.cmd_counts[cmd.name] += 1
        if cmd.ref.startswith('refs/tags/'):
            self.lightweight_tags += 1
        else:
            if cmd.from_ is not None:
                self.reftracker.track_heads_for_ref(
                    cmd.ref, cmd.from_)
91358
public void cleanUp() {
    m_Owner     = null;
    m_Train     = null;
    m_Test      = null;
    m_Generator = null;
    m_Values    = null;
  }