
    ir                         S r SSKrSSKJrJr  SSKJr  \R                  " S\R                  5      r	\
" \5      rS\S\4S jrS\S\4S	 jrS
\S\4S jrS
\S\4S jrg)z=tldextract helpers for testing and fetching remote resources.    N)AddressValueErrorIPv6Address)scheme_charszo^(?:(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$urlreturnc                 v   [        U 5      R                  S5      S   R                  S5      S   R                  S5      S   R                  S5      S   nU(       a+  US   S:X  a"  UR                  S5      nUS	   S:X  a  US    S3$ UR                  S
5      S   R                  5       nUR	                  S5      nU$ )zExtract the netloc of a URL-like string.

Similar to the netloc attribute returned by
urllib.parse.{urlparse,urlsplit}, but extract more leniently, without
raising errors.
/r   ?#@[]   :u
   .。．｡)_schemeless_url	partition
rpartitionstriprstrip)r   after_userinfo
maybe_ipv6hostnamewithout_root_labels        U/home/kali/github-search/github-env/lib/python3.13/site-packages/tldextract/remote.pylenient_netlocr      s     		3		3	 
3	 
C		  .+s2#--c2
a=C m_A&&'',Q/557H!)>?    c                     U R                  S5      nUS:X  a  U SS  $ US:  d(  XS-
     S:w  d  [        U S US-
   5      [        -
  (       a  U $ XS-   S  $ )Nz//r      r   r   )findsetscheme_chars_set)r   double_slashes_starts     r   r   r   )   sm    88D>q 12wq a'(C/s-)A-./2BB
a')**r   maybe_ipc                 b    U S   R                  5       (       d  g[        R                  U 5      SL$ )z7Check whether the given str looks like an IPv4 address.r   FN)	isdecimalIP_RE	fullmatchr$   s    r   looks_like_ipr*   6   s,    A;  ""??8$D00r   c                 <     [        U 5        g! [         a     gf = f)z7Check whether the given str looks like an IPv6 address.FT)r   r   r)   s    r   looks_like_ipv6r,   >   s(    H   s    
)__doc__re	ipaddressr   r   urllib.parser   compileASCIIr'   r!   r"   strr   r   boolr*   r,    r   r   <module>r6      s    C 	 4 %


>HH	 |$   2
+ 
+ 
+1C 1D 1c d r   