def process_iq(self, stanza):
typ = stanza.stanza_type<EOL>if typ in ("<STR_LIT:result>", "<STR_LIT:error>"):<EOL><INDENT>return self._process_iq_response(stanza)<EOL><DEDENT>if typ not in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>raise BadRequestProtocolError("<STR_LIT>")<EOL><DEDENT>logger.debug("<STR_LIT>".format(<EOL>stanza, typ))<EOL>payload = stanza.get_payload(None)<EOL>logger.debug("<STR_LIT>".format(payload))<EOL>if not payload:<EOL><INDENT>raise BadRequestProtocolError("<STR_LIT>")<EOL><DEDENT>handler = self._get_iq_handler(typ, payload)<EOL>if not handler:<EOL><INDENT>payload = stanza.get_payload(None, specialize = True)<EOL>logger.debug("<STR_LIT>".format(payload))<EOL>if not isinstance(payload, XMLPayload):<EOL><INDENT>handler = self._get_iq_handler(typ, payload)<EOL><DEDENT><DEDENT>if handler:<EOL><INDENT>response = handler(stanza)<EOL>self._process_handler_result(response)<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise ServiceUnavailableProtocolError("<STR_LIT>")<EOL><DEDENT>
Process IQ stanza received.

        :Parameters:
            - `stanza`: the stanza received
        :Types:
            - `stanza`: `Iq`

        If a matching handler is available pass the stanza to it.  Otherwise
        ignore it if it is "error" or "result" stanza or return
        "feature-not-implemented" error if it is "get" or "set".