Adds a breakpoint which would trigger on `event_type`.

        :param event_type:  The event type to trigger on
        :param bp:          The breakpoint
        :return:            The created breakpoint.
517932
def add_breakpoint(self, event_type, bp):
        
        if event_type not in event_types:
            raise ValueError("Invalid event type %s passed in. Should be one of: %s" % (event_type,
                                                                                        ", ".join(event_types))
                             )
        self._breakpoints[event_type].append(bp)
929132
function createEvent(type, options) {
  switch (type) {
    case 'dblclick':
    case 'click':
      return createMouseEvent(type, options);
    case 'keydown':
    case 'keyup':
      return createKeyboardEvent(type, options);
  }
}
300451
def event_trigger(self, event_type):
        """"""
        def callback(**kwargs):
            self.queued_events.append(event_type(**kwargs))
        return callback
382387
function Event(type, eventInitDict) {
  this.type = type;
  this.bubbles = eventInitDict.bubbles;
  this.cancelable = eventInitDict.cancelable;

  this.target = null;
  this.currentTarget = null;
  this.eventPhase = eventPhases.NONE;

  this.timestamp = now();
}
120151
def trigger(self, source, actions, event_args):
		
		type = BlockType.TRIGGER
		return self.action_block(source, actions, type, event_args=event_args)
619857
def push_event(self, event_name, event_type, block_id):
        """"""
        self._db.rpush(event_name, dict(type=event_type, id=block_id))
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
249784
public void addEventType(String eventType)
    {
        if(this.eventTypes == null)
            this.eventTypes = new ArrayList<String>();
        this.eventTypes.add(eventType);
    }
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);
        }
    }
1191763
public ExecutionResult addEvent(HystrixEventType eventType) {
        return new ExecutionResult(eventCounts.plus(eventType), startTimestamp, executionLatency,
                userThreadLatency, failedExecutionException, executionException,
                executionOccurred, isExecutedInThread, collapserKey);
    }
1336431
def _create_event(self, event_state, event_type, event_value,
                      proc_list, proc_desc, peak_time):
        
        if event_state == "WARNING" or event_state == "CRITICAL":
            # Define the automatic process sort key
            self.set_process_sort(event_type)

            # Create the new log item
            # Time is stored in Epoch format
            # Epoch -> DMYHMS = datetime.fromtimestamp(epoch)
            item = [
                time.mktime(datetime.now().timetuple()),  # START DATE
                -1,  # END DATE
                event_state,  # STATE: WARNING|CRITICAL
                event_type,  # TYPE: CPU, LOAD, MEM...
                event_value,  # MAX
                event_value,  # AVG
                event_value,  # MIN
                event_value,  # SUM
                1,  # COUNT
                [],  # TOP 3 PROCESS LIST
                proc_desc,  # MONITORED PROCESSES DESC
                glances_processes.sort_key]  # TOP PROCESS SORTKEY

            # Add the item to the list
            self.events_list.insert(0, item)

            # Limit the list to 'events_max' items
            if self.len() > self.events_max:
                self.events_list.pop()

            return True
        else:
            return False
1273490
public static IEventTrigger createEventTrigger(final EventType eventType, final AttributeImpl attribute)
            throws DevFailed {
        LOGGER.debug("create event trigger for attribute {} of type {}", attribute.getName(), eventType);
        final EventProperties props = attribute.getProperties().getEventProp();
        IEventTrigger eventTrigger;
        switch (eventType) {
            case PERIODIC_EVENT:
                final long period = Long.parseLong(props.per_event.period);
                eventTrigger = new PeriodicEventTrigger(period, attribute);
                break;
            case CHANGE_EVENT:
                eventTrigger = new ChangeEventTrigger(attribute, props.ch_event.abs_change, props.ch_event.rel_change);
                break;
            case ARCHIVE_EVENT:
                long periodA;
                try {
                    // Check if specified and a number
                    periodA = Long.parseLong(props.arch_event.period);
                } catch (final NumberFormatException e) {
                    periodA = -1;
                }
                eventTrigger = new ArchiveEventTrigger(periodA, props.arch_event.abs_change,
                        props.arch_event.rel_change, attribute);
                break;
            case ATT_CONF_EVENT:
            case DATA_READY_EVENT:
            case USER_EVENT:
            case INTERFACE_CHANGE_EVENT:
            case PIPE_EVENT:
            default:
                eventTrigger = new DefaultEventTrigger();
                break;

        }
        return eventTrigger;
    }
1064367
def GetEventTypeString(self, event_type):
    
    if 0 <= event_type < len(self._EVENT_TYPES):
      return self._EVENT_TYPES[event_type]
    return 'Unknown {0:d}'.format(event_type)
1359545
def __yield_handlers(self, event_type):
        
        if event_type not in self.event_types:
            raise ValueError("%r not found in %r.event_types == %r" % (event_type, self, self.event_types))

        # Search handler stack for matching event handlers
        for frame in list(self._event_stack):
            if event_type in frame:
                yield frame[event_type]

        # Check instance for an event handler
        if hasattr(self, event_type):
            yield getattr(self, event_type)
610241
void triggerBasicEvent(Event.EventType type, String message)
  {
    triggerBasicEvent(type, message, false);
  }
451591
def register_watcher(self, event_type, callback, register_timeout=None):
        
        self._push_watchers[event_type].add(callback)
        self.wait_for_response(
            RegisterMessage(event_list=[event_type]),
            timeout=register_timeout)
243911
def register_event(self, event_type, pattern, handler):
        
        if event_type not in self._supported_events:
            raise ValueError("Unsupported event type {}".format(event_type))
        if event_type != "CHANGE" and not isinstance(pattern, Pattern) and not isinstance(pattern, basestring):
            raise ValueError("Expected pattern to be a Pattern or string")
        if event_type == "CHANGE" and not (len(pattern)==2 and isinstance(pattern[0], int) and isinstance(pattern[1], numpy.ndarray)):
            raise ValueError("For \"CHANGE\" events, ``pattern`` should be a tuple of ``min_changed_pixels`` and the base screen state.")

        # Create event object
        event = {
            "pattern": pattern,
            "event_type": event_type,
            "count": 0,
            "handler": handler,
            "name": uuid.uuid4(),
            "active": True
        }
        self._events[event["name"]] = event
        return event["name"]