+
    j
                     Z    R t ^ RIt^ RIt^RIHt R R ltRR R lltR R ltR	 R
 ltR# )z'Utility functions for aiohappyeyeballs.N)AddrInfoTypec                   V ^8  d   QhR\         \        \        \        \        3,          \         \        \        \        3,          ,          \         \        \        3,          ,          R,          R\        \        ,          R,          /# )   addrNreturn)tuplestrintlistr   )formats   "h/Users/leo/.hermes/workspace/livekit-agents/.venv/lib/python3.14/site-packages/aiohappyeyeballs/utils.py__annotate__r   	   sZ     H H
S#s"
#eCcM&:
:U38_
Lt
SH	,$H    c                B   V f   R# V ^ ,          pV ^,          pRV9   pV'       dE   ^ p^ p\        V 4      pV^8  d
   V ^,          pV^8  d
   V ^,          pWWE3p \        P                  pMW3p \        P                  pV\        P                  \        P
                  RV 3.# )z7Convert an address tuple to a list of addr_info tuples.N: )lensocketAF_INET6AF_INETSOCK_STREAMIPPROTO_TCP)r   hostportis_ipv6flowinfoscopeidaddr_lenfamilys   &       r   addr_to_addr_infosr   	   s     |7D7DTkGt9q=1gGq=AwHH.|V''););RFGGr   c                X    V ^8  d   QhR\         \        ,          R\        R,          RR/# )r   
addr_infos
interleaveNr   )r
   r   r	   )r   s   "r   r   r   "   s-      \"03d
	r   c                    Vf   ^p/ p. pV  F@  pV^ ,          pVP                  V^ 4      pWa8  d   VP                  V4       V^,           W%&   KB  	  W0R&   R# )z
Pop addr_info from the list of addr_infos by family up to interleave times.

The interleave parameter is used to know how many addr_infos for
each family should be popped of the top of the list.
NNNN)getappend)r!   r"   seenkept	addr_infor   counts   &&     r   pop_addr_infos_interleaver+   "   sb     
D!D	1#KK	"qy   qMr   c          	      4   V ^8  d   QhR\         \        \        3,          \         \        \        \        \        3,          ,          R\         \        P                  \        3,          \         \        P
                  \        \        \        3,          ,          /# )r   r   r   )r   r   r	   	ipaddressIPv4AddressIPv6Address)r   s   "r   r   r   8   sa     6 6
S/E#sC"45
56
9  #%&y/D/Dc3PS/S)TT6r   c                R    \         P                  ! V ^ ,          4      .V R,          O5# )z+Convert an address tuple to an IPv4Address.:   NN)r-   
ip_address)r   s   &r   _addr_tuple_to_ip_addressr3   8   s%       a)5DH55r   c          	          V ^8  d   QhR\         \        ,          R\        \        \        3,          \        \        \        \        \        3,          ,          RR/# )r   r!   r   r   N)r
   r   r   r   r	   )r   s   "r   r   r   ?   sF      \"
S/E#sC"45
5 
r   c                N   V  Uu. uF  q"R,          V8w  g   K  VNK  	  pp\        V4      \        V 4      8X  d6   \        V4      pV  Uu. uF  p\        VR,          4      V8w  g   K  VNK   	  pp\        V4      \        V 4      8X  d   \        RV R24      hW0R&   R# u upi u upi )zu
Remove an address from the list of addr_infos.

The addr value is typically the return value of
sock.getpeername().
zAddress z not found in addr_infosr$   N)r   r3   
ValueError)r!   r   air(   
match_addrs   &&   r   remove_addr_infosr:   ?   s     $62"v~BBD6
4yC
O#.t4
#
#2'@B'HJ'VBB 	 
 4yC
O#8D6)ABCCqM 7
s   BB	B"'B")N)	__doc__r-   r   typesr   r   r+   r3   r:    r   r   <module>r>      s&    -   H2,6r   