Return true if the element is listening for the
given eventBit or eventName and the handler matches.
175655
public boolean hasHandlers(int eventBits, String eventName, Function handler) {
    for (int i = 0, j = elementEvents.length(); i < j; i++) {
      BindFunction function = elementEvents.get(i);
      if ((function.hasEventType(eventBits) || function.isTypeOf(eventName))
         && (handler == null || function.isEquals(handler))) {
        return true;
      }
    }
    return false;
  }
1367765
function is(node, selector) {
    return (node.matches
            || node.webkitMatchesSelector
            || node.mozMatchesSelector
            || node.msMatchesSelector
            || node.oMatchesSelector).call(node, selector);
}
603508
function(eventName, options) {
    if (!this.__eventListeners) {
      this.__eventListeners = { }
    }
    var listenersForEvent = this.__eventListeners[eventName];
    if (!listenersForEvent) return;
    for (var i = 0, len = listenersForEvent.length; i < len; i++) {
      // avoiding try/catch for perf. reasons
      listenersForEvent[i](options || { });
    }
  }
1129863
public static boolean isMonitorNotify(String methodName, String methodSig) {
        return ("notify".equals(methodName) || "notifyAll".equals(methodName)) && "()V".equals(methodSig);
    }
436278
@Override
    public boolean isAuditRequired(String eventType, String outcome) {
        // TODO: need to handle auditData

        for (Map.Entry<String, List<Map<String, Object>>> handlerMap : handlerEventsMap.entrySet()) {

            List<Map<String, Object>> handlerEventsList = handlerMap.getValue();
            if (handlerEventsList.isEmpty()) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "handlerEventsList is empty, returning true for isAuditRequired");
                }
                return true;
            }
            for (Map<String, Object> handlerEvents : handlerEventsList) {
                if (handlerEvents.isEmpty()) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "no events or outcomes specified, all events and outcomes are honoured");
                    }
                    return true;
                } else {
                    boolean foundMatchingEvent = false;
                    boolean foundAnOutcome = false;
                    boolean foundMatchingEventAndOutcome = false;
                    for (Entry<String, Object> entry : handlerEvents.entrySet()) {
                        if (entry.getKey().equals(AuditConstants.EVENT_NAME) && entry.getValue().equals(eventType)) {
                            foundMatchingEvent = true;
                        } else {
                            if (entry.getKey().equals(AuditConstants.OUTCOME)) {
                                foundAnOutcome = true;
                                if (entry.getValue().toString().equalsIgnoreCase(outcome)) {
                                    if (foundMatchingEvent) {
                                        foundMatchingEventAndOutcome = true;
                                    }
                                }
                            }
                        }

                    }
                    if (foundMatchingEventAndOutcome || (foundMatchingEvent && !foundAnOutcome)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
402425
public boolean hasSubscribers(String eventName, boolean exact) {
        while (!StringUtils.isEmpty(eventName)) {
            if (hasSubscribers(eventName)) {
                return true;
            } else if (exact) {
                return false;
            } else {
                eventName = stripLevel(eventName);
            }
        }
        
        return false;
    }
177398
def eventFilter( self, object, event ):
        
        if ( object != self.uiShortcutTXT ):
            return False
            
        if ( event.type() == event.KeyPress ):
            seq = QKeySequence(event.key() + int(event.modifiers()))
            self.uiShortcutTXT.setText( seq.toString() )
            return True
            
        elif ( event.type() == event.KeyRelease):
            return True
        
        return False
573649
def matches(self, client, event_data):
        """"""

        for f in self.filters:
            if not f(client, event_data):
                return False

        return True
1300285
protected boolean isValidEventNameForScope(String eventName, Element listenerElement) {
    if (eventName != null && eventName.trim().length() > 0) {
      if ("start".equals(eventName) || "end".equals(eventName)) {
        return true;
      } else {
        addError("Attribute 'event' must be one of {start|end}", listenerElement);
      }
    } else {
      addError("Attribute 'event' is mandatory on listener", listenerElement);
    }
    return false;
  }
217338
public boolean equivalent(Element otherElement, boolean logging) {
		if (eventable.getElement().equals(otherElement)) {
			if (logging) {
				LOGGER.info("Element equal");
			}
			return true;
		}

		if (eventable.getElement().equalAttributes(otherElement)) {
			if (logging) {
				LOGGER.info("Element attributes equal");
			}
			return true;
		}

		if (eventable.getElement().equalId(otherElement)) {
			if (logging) {
				LOGGER.info("Element ID equal");
			}
			return true;
		}

		if (!eventable.getElement().getText().equals("")
				&& eventable.getElement().equalText(otherElement)) {

			if (logging) {
				LOGGER.info("Element text equal");
			}

			return true;
		}

		return false;
	}
588753
@Override
    public boolean validateEventsAndOutcomes(String handlerName, List<Map<String, Object>> configuredEvents) {

        if (configuredEvents.isEmpty()) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "configuredEvents is empty, returning true as all events are valid");
            }
            return true;
        }
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "configuredEvents: " + configuredEvents.toString());
        }
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "size of configuredEvents: " + configuredEvents.size());
        }

        for (Map<String, Object> events : configuredEvents) {

            if (events.isEmpty()) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "no events or outcomes specified, all events and outcomes are honoured");
                }
                return true;
            } else {
                boolean isFoundEventName = false;
                String foundEventName = null;
                boolean isFoundOutcome = false;
                String foundOutcome = null;
                for (Entry<String, Object> entry : events.entrySet()) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "entry: " + entry.toString());
                    }

                    // if the event is a custom one, we cannot validate, so return true:  buyer beware
                    if (entry.getKey().equals(AuditConstants.CUSTOM) && entry.getValue().equals(Boolean.TRUE)) {
                        return true;
                    } else {
                        if (entry.getKey().equals(AuditConstants.EVENT_NAME)) {
                            isFoundEventName = true;
                            foundEventName = (String) entry.getValue();
                            if (!validateEventName((String) entry.getValue())) {
                                String eventsList = "";
                                for (String temp : AuditConstants.validEventNamesList) {
                                    eventsList = eventsList.concat(temp).concat(" ");
                                }
                                Tr.error(tc, INCORRECT_AUDIT_EVENT_CONFIGURATION, new Object[] { foundEventName, handlerName, eventsList });
                                return false;
                            }
                        } else if (entry.getKey().equals(AuditConstants.OUTCOME)) {
                            isFoundOutcome = true;
                            foundOutcome = (String) entry.getValue();
                            if (!validateOutcomeName((String) entry.getValue())) {
                                String outcomesList = "";
                                for (String temp : AuditConstants.validOutcomesList) {
                                    outcomesList = outcomesList.concat(temp).concat(" ");
                                }
                                Tr.error(tc, INCORRECT_AUDIT_OUTCOME_CONFIGURATION, new Object[] { foundOutcome, handlerName, outcomesList });
                                return false;
                            }
                        }
                    }
                }
                if (!isFoundEventName && isFoundOutcome) {
                    String eventsList = "";
                    for (String temp : AuditConstants.validEventNamesList) {
                        eventsList = eventsList.concat(temp).concat(" ");
                    }
                    Tr.error(tc, "INCORRECT_AUDIT_CONFIGURATION_OUTCOME_SPECIFIED_MISSING_EVENTNAME",
                             new Object[] { foundOutcome, handlerName, eventsList });
                    return false;
                }
            }
        }
        return true;
    }
941487
function (e, handler) {
		var timeStamp = (e.timeStamp || (e.originalEvent && e.originalEvent.timeStamp)),
		    elapsed = L.DomEvent._lastClick && (timeStamp - L.DomEvent._lastClick);

		// are they closer together than 500ms yet more than 100ms?
		// Android typically triggers them ~300ms apart while multiple listeners
		// on the same event should be triggered far faster;
		// or check if click is simulated on the element, and if it is, reject any non-simulated events

		if ((elapsed && elapsed > 100 && elapsed < 500) || (e.target._simulatedClick && !e._simulated)) {
			L.DomEvent.stop(e);
			return;
		}
		L.DomEvent._lastClick = timeStamp;

		handler(e);
	}
223918
@SuppressWarnings("PMD.SwitchStmtsShouldHaveDefault")
  public boolean isCompatible(@NonNull EventType eventType) {
    switch (eventType) {
      case CREATED:
        return (listener instanceof CacheEntryCreatedListener<?, ?>);
      case UPDATED:
        return (listener instanceof CacheEntryUpdatedListener<?, ?>);
      case REMOVED:
        return (listener instanceof CacheEntryRemovedListener<?, ?>);
      case EXPIRED:
        return (listener instanceof CacheEntryExpiredListener<?, ?>);
    }
    throw new IllegalStateException("Unknown event type: " + eventType);
  }
431380
@Beta
    public boolean containsCustomEventMappingFor(final String eventType) {
        if (eventType == null || eventType.isEmpty()) {
            return false;
        } else {
            return this.eventTypeToEventDataMapping.containsKey(canonicalizeEventType(eventType));
        }
    }
477946
def is_registered(self, event: str, handler: T.Callable) -> bool:
        """"""

        return handler in self._events.get(event, [])
193568
protected boolean isStartTagEvent(XMLEvent event, QName tagName) {
        return event.isStartElement()
                && event.asStartElement().getName().equals(tagName);
    }
980941
def match(cls, event):
        
        if 'detail' not in event:
            return False
        if 'eventName' not in event['detail']:
            return False
        k = event['detail']['eventName']

        # We want callers to use a compiled expression, but want to avoid
        # initialization cost of doing it without cause. Not thread safe,
        # but usage context is lambda entry.
        if k in cls.trail_events:
            v = dict(cls.trail_events[k])
            if isinstance(v['ids'], six.string_types):
                v['ids'] = e = jmespath.compile('detail.%s' % v['ids'])
                cls.trail_events[k]['ids'] = e
            return v

        return False