original_docstring: Provides mapping from host address to IP prior to making a request.
docstring: Provides mapping from host address to IP prior to making a request.
docstring_tokens: Provides mapping from host address to IP prior to making a request .
code: def patch_hosts(host_to_ip):
      """Provides mapping from host address to IP prior to making a request."""
  
      def patched_create_connection(address, *args, **kwargs):
          host, port = address
          if host in host_to_ip:
              host = host_to_ip[host]
  
          return old_create_connection((host, port), *args, **kwargs)
  
      connection.create_connection = patched_create_connection
code_tokens: def patch_hosts ( host_to_ip ) : def patched_create_connection ( address , * args , ** kwargs ) : host , port = address if host in host_to_ip : host = host_to_ip [ host ] return old_create_connection ( ( host , port ) , * args , ** kwargs ) connection . create_connection = patched_create_connection
short_docstring: Provides mapping from host address to IP prior to making a request.
short_docstring_tokens: Provides mapping from host address to IP prior to making a request .
comment: """Provides mapping from host address to IP prior to making a request."""