def request_software_version(stanza_processor, target_jid, callback,
                                                    error_callback = None):
    stanza = Iq(to_jid = target_jid, stanza_type = "get")
    payload = VersionPayload()
    stanza.set_payload(payload)
    def wrapper(stanza):
        """Wrapper for the user-provided `callback` that extracts the payload 
        from stanza received."""
        payload = stanza.get_payload(VersionPayload)
        if payload is None:
            if error_callback:
                error_callback(stanza)
            else:
                logger.warning("Invalid version query response.")
        else:
            callback(payload)
    stanza_processor.set_response_handlers(stanza, wrapper, error_callback)
    stanza_processor.send(stanza)
Request software version information from a remote entity.
dataset/ETHPy150Open kuri65536/python-for-android/python3-alpha/python-libs/pyxmpp2/ext/version.py/request_software_version