Returns true if the instance event is defined.
 Returns false otherwise.
771150
def define_event(name, args = {})
      args = {:create_method => true}.merge(args)
      name = name.to_sym
      
      if args[:create_method]
        define_method name do
          return event(name)
        end
      end
      
      @unobservable_instance_events ||= Set.new
      if @unobservable_instance_events.include? name
        return false
      else
        @unobservable_instance_events.add name
        return true
      end
    end
313073
function(event) {
    var isSandboxed = null;
    if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {
      isSandboxed = false;
    }
    return isSandboxed;
  }
1031624
private boolean isEventLoopActive() {

        EventExecutorGroup eventExecutors = clientResources.eventExecutorGroup();
        if (eventExecutors.isShuttingDown() || eventExecutors.isShutdown() || eventExecutors.isTerminated()) {
            return false;
        }

        return true;
    }
905830
@Override
    public boolean hasInstance(Scriptable value) {
        Scriptable proto = value.getPrototype();
        while (proto != null) {
            if (proto.equals(this))
                return true;
            proto = proto.getPrototype();
        }

        return false;
    }
1133834
def has_callbacks(self, name):
        
        r = self.event_listeners.get(name)
        if not r:
            return False
        return len(r) > 0
77785
private void processInstanceEvent(InstanceContentEvent instanceEvent) {
		Instance instance = instanceEvent.getInstance();
		boolean predictionCovered = false;
		boolean trainingCovered = false;
		boolean continuePrediction = instanceEvent.isTesting();
		boolean continueTraining = instanceEvent.isTraining();
		
		ErrorWeightedVote errorWeightedVote = newErrorWeightedVote();
		Iterator<PassiveRule> ruleIterator= this.ruleSet.iterator();
		while (ruleIterator.hasNext()) { 
			if (!continuePrediction && !continueTraining)
				break;
			
			PassiveRule rule = ruleIterator.next();
			
			if (rule.isCovering(instance) == true){
				predictionCovered = true;

				if (continuePrediction) {
					double [] vote=rule.getPrediction(instance);
					double error= rule.getCurrentError();
					errorWeightedVote.addVote(vote,error);
					if (!this.unorderedRules) continuePrediction = false;
				}
				
				if (continueTraining) {
					if (!isAnomaly(instance, rule)) {
						trainingCovered = true;
						rule.updateStatistics(instance);
						// Send instance to statistics PIs
						sendInstanceToRule(instance, rule.getRuleNumberID());
						
						if (!this.unorderedRules) continueTraining = false;
					}
				}
			}
		}
		
		if (predictionCovered) {
			// Combined prediction
			ResultContentEvent rce = newResultContentEvent(errorWeightedVote.computeWeightedVote(), instanceEvent);
			resultStream.put(rce);
		}
		else if (instanceEvent.isTesting()) {
			// predict with default rule
			double [] vote=defaultRule.getPrediction(instance);
			ResultContentEvent rce = newResultContentEvent(vote, instanceEvent);
			resultStream.put(rce);
		}
		
		if (!trainingCovered && instanceEvent.isTraining()) {
			// train default rule with this instance
			defaultRule.updateStatistics(instance);
			if (defaultRule.getInstancesSeen() % this.gracePeriod == 0.0) {
				if (defaultRule.tryToExpand(this.splitConfidence, this.tieThreshold) == true) {
					ActiveRule newDefaultRule=newRule(defaultRule.getRuleNumberID(),(RuleActiveRegressionNode)defaultRule.getLearningNode(),
							((RuleActiveRegressionNode)defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); //other branch
					defaultRule.split();
					defaultRule.setRuleNumberID(++ruleNumberID);
					this.ruleSet.add(new PassiveRule(this.defaultRule));
					// send to statistics PI
					sendAddRuleEvent(defaultRule.getRuleNumberID(), this.defaultRule);
					defaultRule=newDefaultRule;
				}
			}
		}
	}
434497
def __callback(self, event, *args, **kwargs):
        # type: (str, *Any, **Any) -> Any
        
        comp_callback = self.context.get_callback(event)
        if not comp_callback:
            # No registered callback
            return True

        # Call it
        result = comp_callback(self.instance, *args, **kwargs)
        if result is None:
            # Special case, if the call back returns nothing
            return True

        return result
133845
function ()
		{
			if (_.isNull(_listeners))
				return false;

			var isArray = _.isArray(_listeners), listener, len, args=[], _arguments=arguments;			

			var eventObject = function ()
				{
					var args = _.toArray(_arguments);
					var evtObj = this;
					args.unshift(this);
					this.index=0;
					Object.defineProperty(this,'event',{value:self,enumerable:false,writable:false});
					Object.defineProperty(this,'owner',{value:self.getParent(),enumerable:false,writable:false});
					Object.defineProperty(this,'evetName',{value:self.getEventName(),enumerable:true,writable:false});
					Object.defineProperty(this,'stopPropagation',{value:false,enumerable:false});
					Object.defineProperty(this,'lastListeners',{value:(isArray ? _listeners.length : 1),enumerable:false});
					Object.defineProperty(this,'listeners',{value:_listeners,enumerable:false,writable:false});
					Object.defineProperty(this,'arguments',{value:args,enumerable:false,writable:false});
					if (_config.async)
						this.next = function () {
							if (_.isArray(this.listeners))
							{							
								if (this.listeners.length == this.lastListeners)
									this.index++;

								var listener = this.listeners[this.index];
								var evtObj = this;
								self.callListener(listener,evtObj);
							}
						};
				},
				ieo = arguments[0] != null && typeof arguments[0] == 'object'
									&& arguments[0].stopPropagation!=undefined ? true : false,
				evtObj = ieo ? arguments[0] : new eventObject;

			if (!isArray)
			{
				self.callListener(_listeners,evtObj);
			} else
			{
				if (_listeners.length==2)
				{

					self.callListener(_listeners[0],evtObj);

					if (evtObj.stopPropagation === true || _config.async === true)
						return false;
				
					listener = _listeners.length == 2 ? _listeners[1] : _listeners[0];
					self.callListener(listener,evtObj);

				} else {
					var listeners = _listeners.slice();

					if (_config.async === true)
						self.callListener(listeners[0],evtObj);
					else 
						for (var i = 0, l = listeners.length; i < l; i++)
						{

							if (evtObj.stopPropagation == true)
								return true;

							self.callListener(listeners[i],evtObj);
						}
				}
			}
			return true;
        }
1077632
public boolean isDeathRelatedEvent(final Attribute event) {
        if (isDeathEvent(event)) {
            return true;
        }
        if (isPostDeathEvent(event)) {
            return true;
        }
        return isUnorderedEvent(event);
    }
878769
def on(event, &proc)
      unless @events.has_key? event
        raise Error, "`#{event}` is not a valid event type"
      end
      event_id = new_event_key
      @events[event][event_id] = proc
      EventDescriptor.new(event, event_id)
    end
1090223
function (definition) {
        if (!definition) {
            return;
        }

        var result,
            script = definition.script;

        if (Script.isScript(script)) {
            result = script;
        }
        else if (_.isArray(script) || _.isString(script)) {
            result = new Script({ exec: script });
        }
        else if (_.isObject(script)) {
            result = new Script(script);
        }

        _.mergeDefined(this, /** @lends Event.prototype */ {
            /**
             * Name of the event that this instance is intended to listen to.
             * @type {String}
             */
            listen: _.isString(definition.listen) ? definition.listen.toLowerCase() : undefined,

            /**
             * The script that is to be executed when this event is triggered.
             * @type {Script}
             */
            script: result
        });
    }
193568
protected boolean isStartTagEvent(XMLEvent event, QName tagName) {
        return event.isStartElement()
                && event.asStartElement().getName().equals(tagName);
    }
807019
def is_set(self):
        
        if self.__event.is_set():
            if self.exception is not None:
                # todo better way to raise errors on behalf of other Threads?
                raise self.exception  # pylint: disable=raising-bad-type
            return True
        return False
1175007
private static boolean isInsideInstanceMember(Node n) {
    while (n != null) {
      if (n.isMemberFunctionDef()
          || n.isGetterDef()
          || n.isSetterDef()
          || n.isComputedProp()) {
        return !n.isStaticMember();
      }
      if (n.isClass()) {
        // Stop at the first enclosing class.
        return false;
      }
      n = n.getParent();
    }
    return false;
  }
133831
function() {
        if(this.active) {
            return false;
        }
        // register for event handlers defined on this class.
        var events = OpenLayers.Events.prototype.BROWSER_EVENTS;
        for (var i=0, len=events.length; i<len; i++) {
            if (this[events[i]]) {
                this.register(events[i], this[events[i]]); 
            }
        } 
        this.active = true;
        return true;
    }
521140
function hasCompleteEventParams(eventType, listener) {
        var hasParams = eventType && listener,
            isTypeString = typeof eventType === 'string',
            isTypeFunction = typeof listener === 'function';

        if (!isTypeFunction) {
            throw new TypeError(EventDispatcher.TYPE_ERROR);
        }

        return hasParams && isTypeString && isTypeFunction;
    }
983020
def eventFilter( self, object, event ):
        
        if ( event.type() == event.KeyPress ):
            if ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
                self.addQuery()
                return True
        
        return False