def resolve_srv(self, domain, service, protocol, callback):
            """Start looking up an SRV record for `service` at `domain`.

            `callback` will be called with a properly sorted list of (hostname,
            port) pairs on success. The list will be empty on error and it will
            contain only (".", 0) when the service is explicitely disabled.

            :Parameters:
                - `domain`: domain name to look up
                - `service`: service name e.g. 'xmpp-client'
                - `protocol`: protocol name, e.g. 'tcp'
                - `callback`: a function to be called with a list of received
                  addresses
            :Types:
                - `domain`: `str`
                - `service`: `str`
                - `protocol`: `str`
                - `callback`: function accepting a single argument
            """
            if isinstance(domain, str):
                domain = domain.encode("idna").decode("us-ascii")
            domain = "_{0}._{1}.{2}".format(service, protocol, domain)
            try:
                records = dns.resolver.query(domain, 'SRV')
            except dns.exception.DNSException as err:
                logger.warning("Could not resolve {0!r}: {1}"
                                    .format(domain, err.__class__.__name__))
                callback([])
                return
            if not records:
                callback([])
                return

            result = []
            for record in reorder_srv(records):
                hostname = record.target.to_text()
                if (".", "") in hostname:
                    continue
                result.append((hostname, record.port))

            if not result:
                callback([(".", 0)])
            else:
                callback(result)
            return
dataset/ETHPy150Open kuri65536/python-for-android/python3-alpha/python-libs/pyxmpp2/resolver.py/BlockingResolver.resolve_srv/swapped operands of `in`