def raiseQueryEvent(event, *args, **kwargs):
    """Raise a specific event and wait for answers from CALLBACKS

    Any additional keyword argument will be passed to registered
    CALLBACKS. Callback answers are returned as a list.

    :param event: the event to raise
    """
    result = []
    if event not in EVENTS or event not in CALLBACKS:
        return result
    for callback in CALLBACKS[event].values():
        tmp = callback(*args, **kwargs)
        if tmp is None:
            # Callback is registered but associated extension is
            # disabled.
            continue
        result += tmp
    return result
dataset/ETHPy150Open tonioo/modoboa/modoboa/lib/events.py/raiseQueryEvent/original