Declare a new event. May overwrite an existing entry.
352561
def new_event_type(self, name, mergeable=False):
    '''  '''

    self.event_types[name] = self.EventType(name, mergeable)
1306967
def new(self, event):
        """"""

        # Grid table handles interaction to code_array

        self.grid.actions.clear(event.shape)

        _grid_table = GridTable(self.grid, self.grid.code_array)
        self.grid.SetTable(_grid_table, True)

        # Update toolbars
        self.grid.update_entry_line()
        self.grid.update_attribute_toolbar()
479146
def _trigger(self, event_name, *args, **kwargs):
        
        self.log('event: %s' % event_name, *args)
        for f in self._events[event_name]:
            f(*args, **kwargs)
1311851
def on_created(self, event):
        """"""
        for delegate in self.delegates:
            if hasattr(delegate, "on_created"):
                delegate.on_created(event)
269709
def put(self, event, *args, **kwargs):
        
        self._queue.put((event, args, kwargs))
522918
def new_event(self, event_data: str) -> None:
        """"""
        event = self.parse_event_xml(event_data)

        if EVENT_OPERATION in event:
            self.manage_event(event)
785995
function (event) {
        var self = this;

        event.monologued = false;
        event.recorded_at = new Date();

        self.events.insert(event, function (err) {
          if (!err) {
            _.delay(function () {
              self.events.remove({
                event_id: event.event_id
              });
            }, 60000);
          }
        });
      }
641586
function new_listener(event/*, listener*/) {

			// Ignore if not tcn event
			if(NoPg.isLocalEventName(event)) {
				return;
			}

			event = NoPg.parseEventName(event);

			// Stringifying back the event normalizes the original event name
			var event_name = NoPg.stringifyEventName(event);

			var channel_name = NoPg.parseTCNChannelName(event);

			// If we are already listening, just increase the counter.
			if(counter.hasOwnProperty(event_name)) {
				counter[event_name] += 1;
				return;
			}

			// Create the listener if necessary
			var tcn_listener;
			if(!tcn_listeners.hasOwnProperty(event_name)) {
				tcn_listener = tcn_listeners[event_name] = create_tcn_listener(self._events, event);
			} else {
				tcn_listener = tcn_listeners[event_name];
			}

			// Start listening tcn events for this channel
			//debug.log('Listening channel ' + channel_name + ' for ' + event_name);
			self._db.on(channel_name, tcn_listener);
			counter[event_name] = 1;
		}
541210
def write_event(self, event):
        

        if not self.header_written:
            self._out.write("<stream>")
            self.header_written = True

        event.write_to(self._out)
422738
def write_events(self, events):
        
        with self.write_lock, self.conn:
            self.conn.executemany(
                'INSERT INTO state_events('
                '   identifier, source_statechange_id, log_time, data'
                ') VALUES(?, ?, ?, ?)',
                events,
            )
632840
def new_config_event(self):
        
        try:
            self.on_set_config()
        except Exception as ex:
            self.logger.exception(ex)
            raise StopIteration()
753275
def register(self, event, fn):
        

        # TODO: Can we check the method signature?
        self._handler_dict.setdefault(event, [])
        if fn not in self._handler_dict[event]:
            self._handler_dict[event].append(fn)
652471
function( e )
        {
            var event      = new Event( aType );
            event.target   = self;
            event.srcEvent = e;

            aHandler( event );
        }
158727
def _modify_event(self, event_name, method, func):
        
        if event_name not in self.ALL_EVENTS:
            raise TypeError(('event_name ("%s") can only be one of the '
                             'following: %s') % (event_name,
                                                 repr(self.ALL_EVENTS)))
        if not isinstance(func, collections.Callable):
            raise TypeError(('func must be callable to be added as an '
                             'observer.'))
        getattr(self._events[event_name], method)(func)
1134618
def AddEvent(self, event):
    
    self._RaiseIfNotWritable()

    self._storage_file.AddEvent(event)
    self.number_of_events += 1

    self._UpdateCounters(event)
289179
def register(self, event, fn):
        
        self._callbacks.setdefault(event, []).append(fn)
        return fn
672153
def new_event(event):
    
    op_name = event.EventType.DESCRIPTOR.values_by_number[event.type].name
    if op_name == 'PUT':
        cls = PutEvent
    elif op_name == 'DELETE':
        cls = DeleteEvent
    else:
        raise Exception('Invalid op_name')

    return cls(event)