def listener(self, chain=None, filters=None, **kwargs):
        """

        :param chain:
        :param filters:
        :param kwargs:
        :return:
        """
        # for single decorator usage 'chain' is the on_event function
        if inspect.isfunction(chain):
            self._create_listener(chain, **kwargs)
        else:
            if chain:
                self.listeners.validate_chain(chain)

            if filters:
                if not isinstance(filters, (list, set)):
                    filters = [filters]
                self.listeners.validate_filters(filters)

            def wrapper(f):
                self._create_listener(f, chain, filters, **kwargs)
            return wrapper
def listener ( self , chain = None , filters = None , ** kwargs ) : if inspect . isfunction ( chain ) : self . _create_listener ( chain , ** kwargs ) else : if chain : self . listeners . validate_chain ( chain ) if filters : if not isinstance ( filters , ( list , set ) ) : filters = [ filters ] self . listeners . validate_filters ( filters ) def wrapper ( f ) : self . _create_listener ( f , chain , filters , ** kwargs ) return wrapper
:param chain:
        :param filters:
        :param kwargs:
        :return: