Add greenlet_name to the event dict for greenlets that have a non-default name.
336136
def add_greenlet_name(
        _logger: str,
        _method_name: str,
        event_dict: Dict[str, Any],
) -> Dict[str, Any]:
    """"""
    current_greenlet = gevent.getcurrent()
    greenlet_name = getattr(current_greenlet, 'name', None)
    if greenlet_name is not None and not greenlet_name.startswith('Greenlet-'):
        event_dict['greenlet_name'] = greenlet_name
    return event_dict
1044032
def event(self, name):
        
        events = self.events()
        if name not in events:
            events[name] = Event(name, self, 0)
        return events[name]
475629
def track_name_event(self, name):
        """"""
        l = self.int_to_varbyte(len(name))
        return '\x00' + META_EVENT + TRACK_NAME + l + name
278341
def bind(self, event_name, callback, *args, **kwargs):
        
        self.event_callbacks[event_name].append((callback, args, kwargs))
1168205
@JsonProperty("event")
	public void setEventName(String eventName) {
		try {
			this.event = (Class<? extends RemoteApplicationEvent>) Class
					.forName(eventName);
		}
		catch (ClassNotFoundException e) {
			this.event = UnknownRemoteApplicationEvent.class;
		}
	}
473228
def add_event(event_name, **kwrest, &callback)
      result = vm.Listener.new(vm.Event[event_name], **kwrest, &callback)
      @events << result
      result end
1025727
def add_callback(self, name, func):
        

        if name not in self.callbacks:
            raise ValueError("Unknown callback name: %s" % name)

        self.callbacks[name].add(func)
716361
def raise_event(self, event_name, **kwargs):
        
        handlers = list(self._event_handlers[event_name])
        logger.debug('Event: %s %s', event_name, handlers)
        for func in handlers:
            func(self, **kwargs)
820302
def _attach_handler_events(self, handler, events=None):
        
        if not events:
            events = self
        for name in events:
            meth = getattr(handler, name, None)
            if meth:
                self.events[name] += meth
313491
function (name)
        {
            for (var i=0; i<ModalDialog.events.length; ++i) {
                if (typeof(ModalDialog.events[i][0]) == 'string' && ModalDialog.events[i][0] == name && typeof(ModalDialog.events[i][1]) == 'function') {
                    ModalDialog.events[i][1]();
                }
            }
        }
854340
def _get_on_name(self, func):
        """"""
        r = re.match("^on_(.+)$", func.__name__)
        if r:
            event = r.group(1)
        else:
            raise ValueError("The function name should be "
                             "`on_<eventname>`().")
        return event
592747
def add_field(self, name, default_value=None):
        """"""
        self._fields[name] = default_value

        def func(cluster):
            return self.get(name, cluster)

        setattr(self, name, func)
516444
def name_inner_event(cls):
    """'"""
    if hasattr(cls, 'Event'):
        cls.Event._event_name = '{}.Event'.format(cls.__name__)
    else:
        warnings.warn('Class {} does not have a inner Event'.format(cls))
    return cls
1146819
def join(self):
        """"""
        self.closed = True

        while self.expect > 0:
            val = self.wait_change.get()
            self.expect -= 1

            if val is not None:
                # Wait a while for all running greenlets to exit, and
                # then attempt to force them to exit so join()
                # terminates in a reasonable amount of time.
                gevent.joinall(list(self.greenlets), timeout=30)
                gevent.killall(list(self.greenlets), block=True, timeout=30)
                raise val
418706
def register(self, name: str):
        ''''''
        if name in self._callbacks:
            raise ValueError('Hook already registered')

        self._callbacks[name] = None

        if self._event_dispatcher is not None:
            self._event_dispatcher.register(name)
933231
def add(cls, name, value):
        """"""
        attr = cls(value)
        attr._name = name
        setattr(cls, name, attr)
966592
def add(self, name, value):
        # type: (str, str) -> None
        """"""
        self._last_key = name
        if name in self:
            self._dict[name] = value
            self._as_list[name].append(value)
        else:
            self[name] = value