'Raises an event.
If "event" is an Event type, it will be initialized with args and kw,
but only if there are actually listeners.
Returns the event object, unless it was never created (because there
were no listeners) in which case returns None.'

def raiseEvent(self, event, *args, **kw):

    self._eventMixin_init()
    classCall = False
    if isinstance(event, Event):
        eventType = event.__class__
        classCall = True
        if (event.source is None):
            event.source = self
    elif issubclass(event, Event):
        if (event not in self._eventMixin_handlers):
            return None
        if (len(self._eventMixin_handlers[event]) == 0):
            return None
        classCall = True
        eventType = event
        event = eventType(*args, **kw)
        args = ()
        kw = {}
        if (event.source is None):
            event.source = self
    if ((self._eventMixin_events is not True) and (eventType not in self._eventMixin_events)):
        raise RuntimeError(('Event    %s    not    defined    on    object    of    type    %s' % (eventType, type(self))))
    handlers = self._eventMixin_handlers.get(eventType, [])
    for (priority, handler, once, eid) in handlers:
        if classCall:
            rv = event._invoke(handler, *args, **kw)
        else:
            rv = handler(event, *args, **kw)
        if once:
            self.removeListener(eid)
        if (rv is None):
            continue
        if (rv is False):
            self.removeListener(eid)
        if (rv is True):
            if classCall:
                event.halt = True
            break
        if (type(rv) == tuple):
            if ((len(rv) >= 2) and (rv[1] == True)):
                self.removeListener(eid)
            if ((len(rv) >= 1) and rv[0]):
                if classCall:
                    event.halt = True
                break
            if (len(rv) == 0):
                if classCall:
                    event.halt = True
                break
        if (classCall and event.halt):
            break
    return event
