Registers new events after instance creation

        Args:
            *names (str): Name or names of the events to register
422446
def register_event(self, *names):
        
        for name in names:
            if name in self.__events:
                continue
            self.__events[name] = Event(name)
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)
490001
def trigger(self, name, *args, **kwargs):
        

        mark_remove = []
        for callback, once in self.event_listeners.get(name, []):
            callback(event_origin=self, *args, **kwargs)
            if once:
                mark_remove.append( (callback, once) )

        for callback, once in mark_remove:
            self.off(name, callback, once=once)
49960
public void addNamedEvent (String shortName, Class<? extends ComponentSystemEvent> cls)
    {
        String key = shortName;
        Collection<Class<? extends ComponentSystemEvent>> eventList;
        
        // Per the spec, if the short name is missing, generate one.
        
        if (shortName == null)
        {
            key = getFixedName (cls);
        }
        
        eventList = events.get (key);
        
        if (eventList == null)
        {
            // First event registered to this short name.
            
            eventList = new LinkedList<Class<? extends ComponentSystemEvent>>();
            
            events.put (key, eventList);
        }
        
        eventList.add (cls);
    }
760936
def register_lists(self, category_lists, lists_init_kwargs=None, editor_init_kwargs=None):
        
        lists_init_kwargs = lists_init_kwargs or {}
        editor_init_kwargs = editor_init_kwargs or {}

        for lst in category_lists:
            if isinstance(lst, string_types):  # Spawn CategoryList object from base category alias.
                lst = self.list_cls(lst, **lists_init_kwargs)
            elif not isinstance(lst, CategoryList):
                raise SitecatsConfigurationError(
                    '`CategoryRequestHandler.register_lists()` accepts only '
                    '`CategoryList` objects or category aliases.'
                )

            if self._obj:
                lst.set_obj(self._obj)

            for name, val in lists_init_kwargs.items():  # Setting CategoryList attributes from kwargs.
                setattr(lst, name, val)

            lst.enable_editor(**editor_init_kwargs)

            self._lists[lst.get_id()] = lst
1304615
function(objEvents, name, callback, args) {
    if (objEvents) {
      var events = objEvents[name];
      var allEvents = objEvents.all;
      if (events && allEvents) allEvents = allEvents.slice();
      if (events) triggerEvents(events, args);
      if (allEvents) triggerEvents(allEvents, [name].concat(args));
    }
    return objEvents;
  }
807879
def register(self, name):
        
        signal = Signal(providing_args=['args', 'kwargs'])
        self._registry[name] = signal
        return signal
323650
def create(self, key, *args, **kwargs):
        
        instance = self._class(key, *args, **kwargs)
        self._events.create.trigger(list=self, instance=instance, key=key, args=args, kwargs=kwargs)
        return self.insert(instance)
32861
def _AddEvents(cls, Class):
        
        def make_event(event):
            return property(lambda self: self._GetDefaultEventHandler(event),
                             lambda self, Value: self._SetDefaultEventHandler(event, Value))
        for event in dir(Class):
            if not event.startswith('_'):
                setattr(cls, 'On%s' % event, make_event(event))
                cls._EventNames.append(event)
122889
def register(self, name, fun, description=None):
        
        self.methods[name] = fun
        self.descriptions[name] = description
1170959
def on(self, event, new_state):
        
        if self.name == new_state.name:
            raise RuntimeError("Use loop method to define {} -> {} -> {}".format(self.name, event.name, new_state.name))
        self._register_transition(event, new_state)
247578
def create(*events):
    
    or_event = threading.Event()

    def changed():
        if any([event.is_set() for event in events]):
            or_event.set()
        else:
            or_event.clear()

    for e in events:
        orify(e, changed)

    changed()
    return or_event
895260
def add_entry_points(self, names):
        
        names = util.return_set(names)
        self.entry_point_names.update(names)
771150
def define_event(name, args = {})
      args = {:create_method => true}.merge(args)
      name = name.to_sym
      
      if args[:create_method]
        define_method name do
          return event(name)
        end
      end
      
      @unobservable_instance_events ||= Set.new
      if @unobservable_instance_events.include? name
        return false
      else
        @unobservable_instance_events.add name
        return true
      end
    end
691212
def add_events(new_events)
      new_events.map do |new_event|
        # Check for other states that use a different class type for their name.
        # This typically prevents string / symbol misuse.
        if conflict = events.detect { |event| event.name.class != new_event.class }
          raise ArgumentError, "#{new_event.inspect} event defined as #{new_event.class}, #{conflict.name.inspect} defined as #{conflict.name.class}; all events must be consistent"
        end

        unless event = events[new_event]
          events << event = Event.new(self, new_event)
        end

        event
      end
    end
1094962
def register(cls, name, entrypoint):
        
        if not issubclass(entrypoint, Entrypoint):
            raise ValidationError(
                "Invalid type for entry '{}', MUST implement "
                "kser.entry.Entrypoint".format(name),
                extra=dict(entrypoint=name)
            )
        cls.ENTRYPOINTS[name] = entrypoint
        logger.debug("{}.Registered: {}".format(cls.__name__, name))
657090
def trigger(self_, *param_names):
        
        events = self_.self_or_cls.param._events
        watchers = self_.self_or_cls.param._watchers
        self_.self_or_cls.param._events  = []
        self_.self_or_cls.param._watchers = []
        param_values = dict(self_.get_param_values())
        params = {name: param_values[name] for name in param_names}
        self_.self_or_cls.param._TRIGGER = True
        self_.set_param(**params)
        self_.self_or_cls.param._TRIGGER = False
        self_.self_or_cls.param._events = events
        self_.self_or_cls.param._watchers = watchers