Return the Event for the given type that has the given attribute value
@param {String} eventType
@param {String} attributeKey
@param {String} attributeValue
@returns {Object} evt - The event if found, null otherwise
961676
function(eventType, attributeKey, attributeValue) {
    var attrsKey = this._event_attributes_key(eventType);
    for(var i = 0; i < this._events.length ; i++) {
      var evt = this._events[i];
      if ( (evt.eventType === eventType) && (evt[attrsKey][attributeKey] === attributeValue) ) {
        return evt;
      }
    }
    return null;
  }
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;
    }
1051035
def parse_keyvalue(parser, event, node): #pylint: disable=unused-argument
    

    valuetype = _get_required_attribute(node, 'VALUETYPE')

    # TODO 2/16 KS: Type attribute not used. Extend to use. Type  was late
    #               extension to spec to allow real types.
    cim_type = _get_attribute(node, 'TYPE')  # pylint: disable=unused-variable

    (next_event, next_node) = six.next(parser)

    if next_event != pulldom.CHARACTERS:
        raise ParseError('Expecting character data')

    value = next_node.nodeValue

    if valuetype == 'string':
        pass

    elif valuetype == 'boolean':

        # CIM-XML says "These values MUST be treated as
        # case-insensitive" (even though the XML definition
        # requires them to be lowercase.)

        p = value.strip().lower()

        if p == 'true':
            value = True
        elif p == 'false':
            value = False
        else:
            raise ParseError('invalid boolean value %r' % p)

    elif valuetype == 'numeric':

        try:

            # XXX: Use TYPE attribute to create named CIM type.
            # if 'TYPE' in attrs(tt):
            #    return tocimobj(attrs(tt)['TYPE'], p.strip())

            # XXX: Would like to use long() here, but that tends to cause
            # trouble when it's written back out as '2L'
            # pylint: disable=redefined-variable-type
            # Redefined from bool to int
            # pylint: disable=redefined-variable-type
            value = int(value.strip(), 0)

        except ValueError:
            raise ParseError(
                'invalid numeric value "%s"' % value)

    else:
        raise ParseError('Invalid VALUETYPE')

    _get_end_event(parser, 'KEYVALUE')

    return value
1320724
function(type, evt) {
        var layer = evt.feature ? evt.feature.layer : evt.layer,
            object = this.target.object;
        if (object instanceof OpenLayers.Map || object === layer) {
            return this.target.triggerEvent(type, evt);
        }
    }
1248155
function(type, evt) {
			var state = this._eventTypes ? this._eventTypes[type] : null;
			if (state) {
				var listeners = state.listeners;
				try {
					state.level++;
					if (listeners) {
						for (var i=0, len=listeners.length; i < len; i++) {
							if (listeners[i]) {
								var l = listeners[i].listener;
								if (typeof l === "function") {
									l.call(this, evt);
								} else if (l.handleEvent && typeof l.handleEvent === "function") {
									l.handleEvent(evt);
								}
							}
						}
					}
				} finally {
					state.level--;
					if (state.compact && state.level === 0) {
						for (var j=listeners.length - 1; j >= 0; j--) {
							if (!listeners[j]) {
								listeners.splice(j, 1);
							}
						}
						if (listeners.length === 0) {
							delete this._eventTypes[type];
						}
						state.compact = false;
					}
				}
			}
		}
447356
public static ObjectAttributeRange getObjectAttributeRanges(final String schemaArn, final String facetName,
                                                                final String attributeName, final String attributeValue) {

        val attributeKey = getAttributeKey(schemaArn, facetName, attributeName);
        return new ObjectAttributeRange().withAttributeKey(attributeKey)
            .withRange(new TypedAttributeValueRange()
                .withStartValue(getTypedAttributeValue(attributeValue))
                .withEndValue(getTypedAttributeValue(attributeValue))
                .withStartMode(RangeMode.INCLUSIVE.toString())
                .withEndMode(RangeMode.INCLUSIVE.toString()));
    }
855648
function _getHandlerAttribute (member, handlerAttributeArray) {
        var attribute;
        if (1 !== handlerAttributeArray.length()) {
            gpf.Error.htmlHandlerMultiplicityError({
                member: member
            });
        }
        attribute = handlerAttributeArray.get(0);
        if (!(attribute instanceof _HtmEvent)) {
            return attribute;
        }
        return null;
    }
1146389
public void pushAttributeValueEvent(final String deviceName, final String attributeName) throws DevFailed {
        xlogger.entry();
        for (final EventType eventType : EventType.getEventAttrValueTypeList()) {
            pushAttributeValueEventIdlLoop(deviceName, attributeName, eventType);
        }
        xlogger.exit();
    }
176677
public static void checkEventCriteria(final AttributeImpl attribute) throws DevFailed {
        // Check if value is not numerical (always true for State and String)
        if (attribute.isState() || attribute.isString()) {
            return;
        }
        // Else check criteria
        final EventProperties props = attribute.getProperties().getEventProp();
        if (props.arch_event.period.equals(Constants.NOT_SPECIFIED)
                && props.arch_event.abs_change.equals(Constants.NOT_SPECIFIED)
                && props.arch_event.rel_change.equals(Constants.NOT_SPECIFIED)) {
            throw DevFailedUtils.newDevFailed(ExceptionMessages.EVENT_CRITERIA_NOT_SET,
                    "Archive event properties (archive_abs_change or "
                            + "archive_rel_change or archive_period) for attribute " + attribute.getName()
                            + " are not set");
        }
    }
271871
public void pushEvent(final String attributeName, final AttributeValue value, final EventType eventType)
            throws DevFailed {
        switch (eventType) {
            case CHANGE_EVENT:
            case ARCHIVE_EVENT:
            case USER_EVENT:
                // set attribute value
                final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName,
                        device.getAttributeList());
                attribute.lock();
                try {
                    attribute.updateValue(value);
                    // push the event
                    EventManager.getInstance().pushAttributeValueEvent(name, attributeName, eventType);
                } catch (final DevFailed e) {
                    EventManager.getInstance().pushAttributeErrorEvent(name, attributeName, e);
                } finally {
                    attribute.unlock();
                }
                break;
            default:
                throw DevFailedUtils.newDevFailed("Only USER, ARCHIVE or CHANGE event can be send");
        }
    }
883038
function Event(type) {
      var event = this;
      if (type instanceof Event) {
        return type;
      }
      return (event instanceof Event)
        ? _.assign(event, { 'timeStamp': _.now() }, typeof type == 'string' ? { 'type': type } : type)
        : new Event(type);
    }
12620
function(eventType) {
    var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
    if (handlers) {
      if (typeof eventType === "string" && eventType) {
        copy = handlers[eventType] ? handlers[eventType].slice(0) : [];
      } else {
        copy = _deepCopy(handlers);
      }
    }
    return copy;
  }
617656
function WEvent(evt) {
  if (evt) {
    this.originalEvent = evt;
    this.type = evt.type;
    this.which = evt.which || evt.charCode || evt.keyCode;
    if (!this.which && evt.button !== undefined) {
      this.which = ( evt.button & 1 ? 1 : ( evt.button & 2 ? 3 : ( evt.button & 4 ? 2 : 0 ) ) );
    }
    this.button = evt.button;
    this.currentTarget = evt.currentTarget;
    this.delegateTarget = null;
    this.target = evt.target || evt.srcElement;
    this.shiftKey = evt.shiftKey;
    this.altKey = evt.altKey;
    this.ctrlKey = evt.ctrlKey;
    this.metaKey = evt.metaKey;
  }
  this.current = undefined;
  this.previous = undefined;
  this.eventId = _.uniqueId('e');
  this.propagationStopped = false;
  this.immediatePropagationStopped = false;
}
1192080
def event_type(self, event_type):
        
        if event_type is not None and len(event_type) > 100:
            raise ValueError("Invalid value for `event_type`, length must be less than or equal to `100`")

        self._event_type = event_type
549589
public static void checkEventCriteria(final AttributeImpl attribute, final EventType eventType) throws DevFailed {
        switch (eventType) {
            case CHANGE_EVENT:
                ChangeEventTrigger.checkEventCriteria(attribute);
                break;
            case ARCHIVE_EVENT:
                ArchiveEventTrigger.checkEventCriteria(attribute);
                break;
            default:
                break;
        }
    }
1084259
protected void pushAttributeValueEvent(ZMQ.Socket eventSocket) throws DevFailed {
        xlogger.entry();
        eventTrigger.setError(null);
        eventTrigger.updateProperties();
        if (isSendEvent()) {
            sendAttributeValueEvent(eventSocket);
        }
        xlogger.exit();
    }
1358006
public static Event map(EventType eventType) {
        Event event = new Event();
        event.setEventType(mapEventTypeEnum(eventType.getEventType()));
        Date date = (eventType.getTimestamp() == null)
                ? new Date() : eventType.getTimestamp().toGregorianCalendar().getTime();
        event.setTimestamp(date);
        event.setOriginator(mapOriginatorType(eventType.getOriginator()));
        MessageInfo messageInfo = mapMessageInfo(eventType.getMessageInfo());
        event.setMessageInfo(messageInfo);
        String content = mapContent(eventType.getContent());
        event.setContent(content);
        event.getCustomInfo().clear();
        event.getCustomInfo().putAll(mapCustomInfo(eventType.getCustomInfo()));
        return event;
    }