Custom events don't allow to have dots in the name so we need to replace them with '_'
326186
function (metricType, statsdKey) {
                statsdKey = statsdKey.replace(/([^a-zA-Z0-9:_])/g, '_');
                return [prefixes[metricType], '_', statsdKey].join('');
            }
544461
function (eventName,handler) {
			var event;
			if (event = this.getEvent(eventName))
			{
				if (!event.prependListener(handler))
					this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			} else
				this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			return this;
		}
248670
function endRule(event){
            if (textIndent){
                reporter.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", textIndent.line, textIndent.col, rule);
            }
        }
248335
private String stripLevel(String eventName) {
        int i = eventName.lastIndexOf('.');
        return i > 1 ? eventName.substring(0, i) : "";
    }
1266036
def remove_event(self, name=None, time=None, chan=None):
        """"""
        events = self.rater.find('events')
        if name is not None:
            pattern = "event_type[@type='" + name + "']"
        else:
            pattern = "event_type"

        if chan is not None:
            if isinstance(chan, (tuple, list)):
                chan = ', '.join(chan)

        for e_type in list(events.iterfind(pattern)):

            for e in e_type:

                event_start = float(e.find('event_start').text)
                event_end = float(e.find('event_end').text)
                event_chan = e.find('event_chan').text

                if time is None:
                    time_cond = True
                else:
                    time_cond = allclose(time[0], event_start) and allclose(
                            time[1], event_end)

                if chan is None:
                    chan_cond = True
                else:
                    chan_cond = event_chan == chan

                if time_cond and chan_cond:
                    e_type.remove(e)

        self.save()
440715
function () {

            Tooltip.superclass.initEvents.call(this);
            var SIGNATURE = CustomEvent.LIST;

            /**
            * CustomEvent fired when user mouses over a context element. Returning false from
            * a subscriber to this event will prevent the tooltip from being displayed for
            * the current context element.
            * 
            * @event contextMouseOverEvent
            * @param {HTMLElement} context The context element which the user just moused over
            * @param {DOMEvent} e The DOM event object, associated with the mouse over
            */
            this.contextMouseOverEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER);
            this.contextMouseOverEvent.signature = SIGNATURE;

            /**
            * CustomEvent fired when the user mouses out of a context element.
            * 
            * @event contextMouseOutEvent
            * @param {HTMLElement} context The context element which the user just moused out of
            * @param {DOMEvent} e The DOM event object, associated with the mouse out
            */
            this.contextMouseOutEvent = this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT);
            this.contextMouseOutEvent.signature = SIGNATURE;

            /**
            * CustomEvent fired just before the tooltip is displayed for the current context.
            * <p>
            *  You can subscribe to this event if you need to set up the text for the 
            *  tooltip based on the context element for which it is about to be displayed.
            * </p>
            * <p>This event differs from the beforeShow event in following respects:</p>
            * <ol>
            *   <li>
            *    When moving from one context element to another, if the tooltip is not
            *    hidden (the <code>hidedelay</code> is not reached), the beforeShow and Show events will not
            *    be fired when the tooltip is displayed for the new context since it is already visible.
            *    However the contextTrigger event is always fired before displaying the tooltip for
            *    a new context.
            *   </li>
            *   <li>
            *    The trigger event provides access to the context element, allowing you to 
            *    set the text of the tooltip based on context element for which the tooltip is
            *    triggered.
            *   </li>
            * </ol>
            * <p>
            *  It is not possible to prevent the tooltip from being displayed
            *  using this event. You can use the contextMouseOverEvent if you need to prevent
            *  the tooltip from being displayed.
            * </p>
            * @event contextTriggerEvent
            * @param {HTMLElement} context The context element for which the tooltip is triggered
            */
            this.contextTriggerEvent = this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER);
            this.contextTriggerEvent.signature = SIGNATURE;
        }
1297549
function setEventData(events) { // events are already normalized at this point
		eventsByID = {};
		var i, len=events.length, event;
		for (i=0; i<len; i++) {
			event = events[i];
			if (eventsByID[event._id]) {
				eventsByID[event._id].push(event);
			}else{
				eventsByID[event._id] = [event];
			}
		}
	}
44938
function(event, options) {
    options = options || { bubbles: false, cancelable: false, detail: undefined }
    var e = document.createEvent('CustomEvent')
    e.initCustomEvent(event, options.bubbles, options.cancelable, options.detail)
    return e
  }
1138644
function unifyEventNames ( eventName ) {
        if ( eventName.slice( -2 ) === "ed" ) {
            eventName = eventName.slice( 0, -2 );
        } else if ( eventName.slice( -4 ) === ":one" || eventName.slice( -4 ) === ":any" ) {
            eventName = eventName.slice( 0, -4 );
        }

        return eventName;
    }
759332
function(oEvent) {
			var sEntityType,
				sEntityId,
				aSplit,
				sId = oEvent.getParameter("arguments").id;

			if (sId) {
				aSplit = sId.split("#");
				if (aSplit.length === 2) {
					sId = aSplit[0];
					sEntityType = aSplit[1];

					aSplit = sEntityType.split(":");
					if (aSplit.length === 2) {
						sEntityType = aSplit[0];
						sEntityId = aSplit[1];
					}
				}

				sId = sId.replace(/.html$/, "");

				if (sEntityType === 'event') { // legacy keyword is singular
					sEntityType = "events";
				}
			}

			this.navTo("apiId", {id: sId, entityType: sEntityType, entityId: sEntityId});
		}
336303
function(component, eventNames) {
          eventNames = eventNames.trim().split(/\s+/);

          for (var i = 0, l = eventNames.length; i < l; i++) {
            var eventName = eventNames[i];
            this._registerEventHandler(component, eventName);
          }
        }
537343
function(source, propertyName)
	{
		if (!conbo.isAccessor(source, propertyName) && !conbo.isFunc(source, propertyName))
		{
			if (source instanceof conbo.EventDispatcher)
			{
				conbo.makeBindable(source, [propertyName]);
			}
			else
			{
				conbo.warn('It will not be possible to detect changes to "'+propertyName+'" because "'+source.toString()+'" is not an EventDispatcher');
			}
		}
	}
1040699
def set_(name, add, match):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'comment': '',
           'result': True}
    if name not in __reg__:
        __reg__[name] = {}
        __reg__[name]['val'] = set()
    for event in __events__:
        if salt.utils.stringutils.expr_match(event['tag'], match):
            try:
                val = event['data']['data'].get(add)
            except KeyError:
                val = event['data'].get(add)
            if val is None:
                val = 'None'
            ret['changes'][add] = val
            __reg__[name]['val'].add(val)
    return ret
208971
function getOptionsTriggerEvent(opts = {}) {
  // 需要trigger的方法
  const fns = []
  const eventNames = new Set()
  eachOptions([opts, opts.methods || {}], (fn) => {
    const fnStr = fn.toString()
    // this.triggerEvent('customevent', {}) => 'customevent', {}
    let matchParams;
    while ((matchParams = MATCH_TRIGGEREVENT_PARAMS.exec(fnStr)) !== null) {
      if (!matchParams) return;
      // 'customevent', {} => ['customevent', {}]
      const params = matchParams[1].split(',')
      let [eventName] = params
      // eventName like 'customevent' so we need remove quotes
      eventName = eventName.replace(/['"]/g, '');
      if (eventNames.has(eventName)) return;
      eventNames.add(eventName)
      fns.push({
        eventName: processEventName(eventName)
      })
    }
  })
  return fns
}
772385
def eventFilter(self, object, event):
        
        if event.type() != event.KeyPress:
            return super(XRichTextEdit, self).eventFilter(object, event)
        
        cursor    = object.textCursor()
        curr_list = cursor.currentList()
        
        # make sure we're in a current list
        if not curr_list:
            return super(XRichTextEdit, self).eventFilter(object, event)
        
        # unindent for Backtab (Shift+Tab)
        if event.key() == Qt.Key_Backtab:
            delta = -1
        
        # indent for Tab
        elif event.key() == Qt.Key_Tab:
            delta = 1
        
        # otherwise, don't bother calculating
        else:
            return super(XRichTextEdit, self).eventFilter(object, event)
        
        # look for the proper list to move to
        curr_block      = cursor.block()
        curr_indent     = curr_list.format().indent()
        curr_style      = curr_list.format().style()
        prev_block      = curr_block
        next_block      = curr_block
        add_to_list     = None
        add_to_indent   = curr_indent + delta
        
        while prev_block or next_block:
            if prev_block:
                prev_block = prev_block.previous()
                prev_list  = prev_block.textList()
                
                if not prev_list:
                    prev_block = None
                
                else:
                    prev_indent = prev_list.format().indent()
                    
                    if prev_indent == add_to_indent:
                        add_to_list = prev_list
                        break
                    
            if next_block:
                next_block = next_block.next()
                next_list  = next_block.textList()
                
                if not next_list:
                    next_block = None
                
                else:
                    next_indent = next_list.format().indent()
                    
                    if next_indent == add_to_indent:
                        add_to_list = next_list
                        break
        
        if add_to_list is None and 0 < delta:
            if curr_style in (QTextListFormat.ListCircle,
                              QTextListFormat.ListDisc,
                              QTextListFormat.ListSquare):
                self.insertUnorderedList()
            else:
                self.insertOrderedList()
        
        elif add_to_list:
            add_to_list.add(curr_block)
        
        return True
805566
function make_event(event, target) {
  return string_p(event)?  Event.make(event, target)
  :      /* otherwise */   event }
801888
function reorderEvents( node, eventName ) {
		if( node.addEventListener || !node.shoestringData || !node.shoestringData.events ) {
			// add event listner obviates the need for all the callback order juggling
			return;
		}

		var otherEvents = node.shoestringData.events[ eventName ] || [];
		for( var j = otherEvents.length - 1; j >= 0; j-- ) {
			// DOM Events only, Custom events maintain their own order internally.
			if( !otherEvents[ j ].isCustomEvent ) {
				node.detachEvent( "on" + eventName, otherEvents[ j ].callback );
				node.attachEvent( "on" + eventName, otherEvents[ j ].callback );
			}
		}
	}