<s> """<STR_LIT>""" <EOL> import _socket <EOL> from gevent . _compat import text_type <EOL> from gevent . hub import get_hub <EOL> __all__ = [ '<STR_LIT>' ] <EOL> text_type ( '<STR_LIT:foo>' ) . encode ( '<STR_LIT>' ) <EOL> class Resolver ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , hub = None ) : <EOL> if hub is None : <EOL> hub = get_hub ( ) <EOL> self . pool = hub . threadpool <EOL> if _socket . gaierror not in hub . NOT_ERROR : <EOL> hub . NOT_ERROR += ( _socket . gaierror , _socket . herror ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( id ( self ) , self . pool ) <EOL> def close ( self ) : <EOL> pass <EOL> def gethostbyname ( self , * args ) : <EOL> return self . pool . apply ( _socket . gethostbyname , args ) <EOL> def gethostbyname_ex ( self , * args ) : <EOL> return self . pool . apply ( _socket . gethostbyname_ex , args ) <EOL> def getaddrinfo ( self , * args , ** kwargs ) : <EOL> return self . pool . apply ( _socket . getaddrinfo , args , kwargs ) <EOL> def gethostbyaddr ( self , * args , ** kwargs ) : <EOL> return self . pool . apply ( _socket . gethostbyaddr , args , kwargs ) <EOL> def getnameinfo ( self , * args , ** kwargs ) : <EOL> return self . pool . apply ( _socket . getnameinfo , args , kwargs ) </s>
