Detach one or more events from the bot instance
176331
def detach_events(self, *events):
        """"""
        reg = self.registry
        delete = defaultdict(list)

        # remove from self.events
        all_events = reg.events
        for e in events:
            regexp = getattr(e.regexp, 're', e.regexp)
            iotype = e.iotype
            if e in all_events[iotype].get(regexp, []):
                all_events[iotype][regexp].remove(e)
                if not all_events[iotype][regexp]:
                    del all_events[iotype][regexp]
                    # need to delete from self.events_re
                    delete[iotype].append(regexp)

        # delete from events_re
        for iotype, regexps in delete.items():
            reg.events_re[iotype] = [r for r in reg.events_re[iotype]
                                     if r[0] not in regexps]
1138362
function off(event, selector, handler) {
    const enterCallbacks = Object.keys(this.trackedElements[selector].enter || {});
    const leaveCallbacks = Object.keys(this.trackedElements[selector].leave || {});

    if ({}.hasOwnProperty.call(this.trackedElements, selector)) {
        if (handler) {
            if (this.trackedElements[selector][event]) {
                const callbackName = (typeof handler === 'function') ? handler.name : handler;
                delete this.trackedElements[selector][event][callbackName];
            }
        } else {
            delete this.trackedElements[selector][event];
        }
    }

    if (!enterCallbacks.length && !leaveCallbacks.length) {
        delete this.trackedElements[selector];
    }
}
901555
function detatchDelegatedLogic({
    delegatedEventName,
    pathStr,
    allEvents
}) {
    const retain = [];
    const events = allEvents[delegatedEventName];

    nofn.forEach(events, (event) => {
        // pathStr is assigned to info in delegateListener
        if (event.info.pathStr !== pathStr) {
            retain.push(event);
        }
    });

    if (retain.length) {
        allEvents[delegatedEventName] = retain;
    } else {
        delete allEvents[delegatedEventName];
    }
}
1167272
def remove_handlers_bound_to_instance(self, obj):
        
        for handler in self.handlers:
            if handler.im_self == obj:
                self -= handler
923544
def unhold(self):
        ''' 

        '''
        # no-op if we are already no holding
        if self._hold is None: return

        self._hold = None
        events = list(self._held_events)
        self._held_events = []

        for event in events:
            self._trigger_on_change(event)
320166
def remove_event(self, ref):
        
        # is this reference one which has been setup?
        if ref in self._refs:
            self._refs[ref].remove_callback(ref)
302000
def detach(self, listener):
        """"""
        if listener in self.listeners:
            self.listeners.remove(listener)
575322
def off(self, event, handler=None):
        """"""
        if handler:
            self.events[event].off(handler)
        else:
            del self.events[event]
            delattr(self, event)
586451
function (events, fn) {
        // Wrap fn in a self-detaching handler; saved on the original fn so off() can detect it later
        if (!fn._eventOnceWrapper) {
            fn._eventOnceWrapper = function (event) {
                // Note: this wrapper is reused for all attachments of the same fn, so it shouldn't reference
                // anything from the outer closure other than 'fn'
                event.target.off(event.type, fn._eventOnceWrapper);
                fn.apply(this, arguments);
            };
        }
        return this.on(events, fn._eventOnceWrapper);
    }
278145
def OnDestroy(self, event):
        """"""
        # deregister observers
        if hasattr(self, 'cardmonitor'):
            self.cardmonitor.deleteObserver(self.cardtreecardobserver)
        if hasattr(self, 'readermonitor'):
            self.readermonitor.deleteObserver(self.readertreereaderobserver)
            self.cardmonitor.deleteObserver(self.readertreecardobserver)
        event.Skip()
59033
def remove(self, event=None):
        
        observers = self._pool.get(event)
        if observers:
            self._pool[event] = []
1153325
function(events,fct) {
            
            var that=this;
                              
            function offFct() {
                that.off(events,fct);
                that.off(events,offFct);
            }
            
            this.on(events,fct);
            this.on(events,offFct);
            
            return this;
        }
7675
function(target, events) {
      for (var i = 0, l = events.length, e; (i < l) && (e = events[i]); i++) {
        this.removeEvent(target, e);
      }
    }
547538
function unbindEventListeners(instanceData) {

		var eventDelegates = instanceData.eventDelegates;

		for (var i = 0; i < eventDelegates.length; i++) {
			eventDelegates[i].detachEvents();
		}

		instanceData.eventDelegates = [];
	}
1333129
function unbind (type, callback) {
        if (!events.has(type)) {
          throw new Error('Unknown event: ' + type);
        }

        if (typeof callback !== 'function') {
          throw new Error('Callback must be a function, instead got: ' + (typeof callback));
        }

        var eventsOfType = events.get(type, Immutable.List());

        if (eventsOfType.includes(callback)) {
          events = events.set(type, eventsOfType.delete(eventsOfType.indexOf(callback)));
        }

        return self;
      }
354621
protected function _detachListeners()
    {
        $EventManager = EventManager::instance();
        foreach ($this->_listeners as $listener) {
            $EventManager->detach($listener);
        }
    }
843996
def remove_event_handler(self, handler, event_name):
        
        if event_name not in self._event_handlers:
            raise ValueError("Input event name '{}' does not exist".format(event_name))

        new_event_handlers = [(h, args, kwargs) for h, args, kwargs in self._event_handlers[event_name]
                              if h != handler]
        if len(new_event_handlers) == len(self._event_handlers[event_name]):
            raise ValueError("Input handler '{}' is not found among registered event handlers".format(handler))
        self._event_handlers[event_name] = new_event_handlers