
                           S SK Jr  S SKrS SKrS SKrS SKJr  SSKJrJ	r	  \
\\\\R                  \\4   4      r\R                   (       a  SSKJr  SS jr\SSS 4           SS	 jjr      SS
 jrSS jrSS jr\" S5      rg)    )annotationsN)LocationParseError   )_DEFAULT_TIMEOUT_TYPE_TIMEOUT   )BaseHTTPConnectionc                $    U R                   (       + $ )z
Returns True if the connection is dropped and should be closed.
:param conn: :class:`urllib3.connection.HTTPConnection` object.
)is_connected)conns    *lib/third_party/urllib3/util/connection.pyis_connection_droppedr      s    
         c                \   U u  pVUR                  S5      (       a  UR                  S5      nSn[        5       n UR                  S5        [        R                  " XVU[        R                  5       H  n	U	u  ppnSn [        R                  " XU5      nSn UR                  [        R                  UU5        [        X5        U[        La  UR!                  U5        U(       a  UR#                  U5        UR%                  U5        SnUs  $    Ub   Ue[        S5      e! [         a    [        SU S35      Sef = f! [         a)  nUR                  [        R                  :w  a  e  SnANSnAff = f! [         a(  nUnUb  UR'                  5          SnAGM(   SnAGM/  SnAff = f! Snf = f)	aG  Connect to *address* and return the socket object.

Convenience function.  Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object.  Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect.  If no *timeout* is supplied, the
global default timeout setting returned by :func:`socket.getdefaulttimeout`
is used.  If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection.
An host of '' or port 0 tells the OS to use the default.
[z[]Nidna'z', label empty or too longib z!getaddrinfo returns an empty list)
startswithstripallowed_gai_familyencodeUnicodeErrorr   socketgetaddrinfoSOCK_STREAM
setsockopt
SOL_SOCKETOSErrorerrnoENOPROTOOPT_set_socket_optionsr   
settimeoutbindconnectclose)addresstimeoutsource_addresssocket_optionsgoogle_protocol_idhostporterrfamilyresafsocktypeproto	canonnamesasock_SO_GOOGLE_NET_PROTOCOL_ID	exception_s                      r   create_connectionr9      s   & JDszz$
C
  !FQF !!$ff6H6HI-0*e 	==u5D
 *4&%%.&  5..(		.)LLCK= JJ 	I
 9::_  Q 1TF*D!EFDPQ&  ??e&7&77 8   	C

  	 CsZ   D <E2!D<7AE2F' D9<
E/E*%E2*E//E22
F$<FF$'F+c                <    Uc  g U H  nU R                   " U6   M     g )N)r   )r5   optionsopts      r   r!   r!   m   s"      r   c                 \    [         R                  n [        (       a  [         R                  n U $ )zThis function is designed to work in the context of
getaddrinfo, where family=socket.AF_UNSPEC is the default and
will perform a DNS search for both IPv6 and IPv4 records.)r   AF_INETHAS_IPV6	AF_UNSPEC)r.   s    r   r   r   w   s"    
 ^^Fx!!Mr   c                    SnSn[         R                  (       a:   [         R                   " [         R                  5      nUR                  U S45        SnU(       a  UR                  5         U$ ! [         a     N%f = f)z4Returns True if the system can bind an IPv6 address.NFr   T)r   has_ipv6AF_INET6r#   	Exceptionr%   )r+   r5   rB   s      r   	_has_ipv6rE      sf    DH	==1DIItQi H 

O  		s   9A- -
A:9A:z::1)r   r	   returnbool)r&   ztuple[str, int]r'   r   r(   ztuple[str, int] | Noner)   _TYPE_SOCKET_OPTIONS | Noner*   intrF   socket.socket)r5   rJ   r;   rH   rF   None)rF   zsocket.AddressFamily)r+   strrF   rG   )
__future__r   r   r   typingurllib3.exceptionsr   r'   r   r   listtuplerI   Unionbytes_TYPE_SOCKET_OPTIONSTYPE_CHECKING_base_connectionr	   r   r9   r!   r   rE   r?    r   r   <module>rX      s    "    1 4E#sFLLe,D"DEF 	5! .-126N;N;N; +N; 0	N;
 N; N;b
"=	. Ur   