Register listener.
Remove them after once event triggered.

@param {string} name
@param {Function} fn
@param {Object} [ctx]
351823
function (name, fn, ctx) {
        // If the context is not passed, use `this`.
        ctx = ctx || this;

        var self = this;

        function onHandler() {
            fn.apply(ctx, arguments);
            self.off(name, onHandler);
        }

        this.on(name, onHandler, ctx);

        return this;
    }
1171816
function addHookFn (proto, name) {
  proto[name] = function () {
    var args = [].splice.call(arguments, 0);
    var fn = args.splice(args.length - 1)[0];
    fn = _.isFunction(fn) ? fn : undefined;
    var self = this;
    _.each(args, function (arg) {
      self.on(util.format('%s.%s', name, arg), fn);
    });
    this.analyzeListenerTree();
  };
}
911529
function setEventHandler(name, handler, dom, tag) {
  var eventName,
    cb = handleEvent.bind(tag, dom, handler);

  // avoid to bind twice the same event
  // possible fix for #2332
  dom[name] = null;

  // normalize event name
  eventName = name.replace(RE_EVENTS_PREFIX, '');

  // cache the listener into the listeners array
  if (!contains(tag.__.listeners, dom)) { tag.__.listeners.push(dom); }
  if (!dom[RIOT_EVENTS_KEY]) { dom[RIOT_EVENTS_KEY] = {}; }
  if (dom[RIOT_EVENTS_KEY][name]) { dom.removeEventListener(eventName, dom[RIOT_EVENTS_KEY][name]); }

  dom[RIOT_EVENTS_KEY][name] = cb;
  dom.addEventListener(eventName, cb, false);
}
1158706
@SuppressWarnings("unchecked")
  public static <T extends LogEventListener> T removeListener(String name) {
    Map<String, LogEventListener> listeners = SelenideLogger.listeners.get();
    return listeners == null ? null : (T) listeners.remove(name);
  }
1069030
function(event, selector, handler, fn) {
      if (/^f/.test(typeof selector)) {
        handler = selector;
      }
      fn = handler;
      return this.each(function(index, el) {
        var events = event.split(' ');
        u.each(events, function(i, event, origEvent){
          origEvent = u._events.remove(el, event, fn);
          handler = origEvent.length ? origEvent[0].handler : handler;
          el.removeEventListener(event, handler);
        });
      });
    }
472586
function registerListener(context, listener, ...arg) {
    if (context.set) {
        for (let i = 0; i < arg.length; i++) {
            if (isFunction(arg[i])) {
                listener.push(arg[i]);
            }
        }
    }
    return context;
}
1268654
def unregister(self, name: str):
        ''''''
        del self._callbacks[name]

        if self._event_dispatcher is not None:
            self._event_dispatcher.unregister(name)
837047
function (el, event, fn) {
				if (typeof el.removeEventListener === "function") {
					el.removeEventListener(event, fn, false);
				} else if (el.detachEvent) {
					el.detachEvent("on" + event, fn);
				}
			}
618068
function(name) {
		var args = arguments;
		args[0] = this.eventName(name);
		$.fn.on.apply(this.$el, args);
	}
1179189
def remove_object(self, name):
        
        if name not in self._object_map:
            raise RuntimeError('No object with name {} is registered.'.format(name))

        for fn_name in list(self._function_map.keys()):
            if fn_name.startswith(name + '.') or fn_name.startswith(name + ':'):
                self._remove_function(fn_name)

        del self._object_map[name]
580416
function (name) {
		var prop = this.properties[name];
		if (prop) {
			this.stopListening(prop, EVENT_CHANGE, this.change);
			delete this.properties[name];
			return prop;
		}
		return null;
	}
182448
function addListener(target, eventType, fn) {
		target.attachEvent(eventType, fn);
		listenersArr[listenersArr.length] = [target, eventType, fn];
	}
849044
def remove_listener(self, event_name, listener):
        """"""
        self.listeners[event_name].remove(listener)
        return self
864866
public static function addListener($name, $listener)
    {
        if (!isset(static::$listeners[$name])) {
            static::$listeners[$name] = [];
        }
        if(!is_array($listener)){
            static::$listeners[$name][] = $listener;
        }else{
            static::$listeners[$name] = array_merge(static::$listeners[$name], $listener);
        }

    }
103215
public static function addListener($name, $listener)
    {
        if (!isset(static::$listeners[$name])) {
            static::$listeners[$name] = [];
        }

        static::$listeners[$name][] = $listener;
    }
582119
function(name, callback, context) {
    if (eventsApi(this, 'stopReplying', name)) {
      return this;
    }

    // Remove everything if there are no arguments passed
    if (!name && !callback && !context) {
      delete this._requests;
    } else if (!removeHandlers(this._requests, name, callback, context)) {
      Radio.debugLog('Attempted to remove the unregistered request', name, this.channelName);
    }

    return this;
  }
586685
function addEvent(el,name,func){
		if(name.match(" ")){
			var a = name.split(' ');
			for(var i=0;i<a.length;i++){
				addEvent( el, a[i], func);
			}
		}
		if(el.addEventListener){
			el.removeEventListener(name, func, false);
			el.addEventListener(name, func, false);
		}
		else {
			el.detachEvent('on'+name, func);
			el.attachEvent('on'+name, func);
		}
	}