def __try_handlers(self, handler_list, stanza, stanza_type = None):
<EOL>if stanza_type is None:<EOL><INDENT>stanza_type = stanza.stanza_type<EOL><DEDENT>payload = stanza.get_all_payload()<EOL>classes = [p.__class__ for p in payload]<EOL>keys = [(p.__class__, p.handler_key) for p in payload]<EOL>for handler in handler_list:<EOL><INDENT>type_filter = handler._pyxmpp_stanza_handled[<NUM_LIT:1>]<EOL>class_filter = handler._pyxmpp_payload_class_handled<EOL>extra_filter = handler._pyxmpp_payload_key<EOL>if type_filter != stanza_type:<EOL><INDENT>continue<EOL><DEDENT>if class_filter:<EOL><INDENT>if extra_filter is None and class_filter not in classes:<EOL><INDENT>continue<EOL><DEDENT>if extra_filter and (class_filter, extra_filter) not in keys:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>response = handler(stanza)<EOL>if self._process_handler_result(response):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False<EOL>
Search the handler list for handlers matching
        given stanza type and payload namespace. Run the
        handlers found ordering them by priority until
        the first one which returns `True`.

        :Parameters:
            - `handler_list`: list of available handlers
            - `stanza`: the stanza to handle
            - `stanza_type`: stanza type override (value of its "type"
              attribute)

        :return: result of the last handler or `False` if no
            handler was found.