def _setDNSCache():
 def _getaddrinfo(*args, **kwargs):
  if (args in kb.cache):
   return kb.cache[args]
  else:
   kb.cache[args] = socket._getaddrinfo(*args, **kwargs)
   return kb.cache[args]
 if (not hasattr(socket, '_getaddrinfo')):
  socket._getaddrinfo = socket.getaddrinfo
  socket.getaddrinfo = _getaddrinfo

def _setDNSCache ( ) : def _getaddrinfo ( * args , ** kwargs ) : if ( args in kb . cache ) : return kb . cache [ args ] else : kb . cache [ args ] = socket . _getaddrinfo ( * args , ** kwargs ) return kb . cache [ args ] if ( not hasattr ( socket , '_getaddrinfo' ) ) : socket . _getaddrinfo = socket . getaddrinfo socket . getaddrinfo = _getaddrinfo
makes a cached version of socket .