def BrowseCallback(sdRef, flags, interfaceIndex, errorCode, serviceName,
                   regtype, replyDomain):
    if errorCode != pybonjour.kDNSServiceErr_NoError:
        return

    resolved = False

    def ResolveCallback(sdRef, flags, interfaceIndex, errorCode, fullname,
                        hosttarget, port, txtRecord):
      global resolved
      if errorCode == pybonjour.kDNSServiceErr_NoError:
        print 'Resolved service:'
        print '  host =', hosttarget
        print '  port       =', port
        resolved = True

    resolver = pybonjour.DNSServiceResolve(
        0, interfaceIndex, serviceName, regtype, replyDomain, ResolveCallback)
    try:
      while not resolved:
        ready = select.select([resolver], [], [], TIMEOUT)
        if ready[0] not in resolver:
            print 'Resolve timed out'
            break
        pybonjour.DNSServiceProcessResult(resolver)
    finally:
      resolver.close()
dataset/ETHPy150Open stevenle/googletv-anymote/scripts/discover.py/BrowseCallback/swapped operands of `not in`