
    h'%                        S r SSKJr   SSKrCSSKJr  SSKJrJ	r	  SSK
JrJr  SSKJr  SSKJrJrJrJrJrJrJrJr  SS	KJr  S
SKJrJr  SSKJr  SSKJ r J!r!J"r"J#r#J$r$  SSK%J&r&J'r'J(r)  Sr*\" S5      r+\\S\+4   /\+4   r, \-  S r0Sq1\ SS j5       r2\ SS j5       r3\ S S j5       r4\ S!S j5       r5S r6Sq7\ S 5       r8\ S 5       r9\ S 5       r:g! \. a    \/r- NUf = f! \; a    SSKJ<r<  Sr* gf = f)"z
Hypothesis strategies.
    )absolute_importN)reader)dirnamejoin)ascii_lettersdigits)
maxunicode)CallableIterableListOptionalSequenceTextTypeVarcast)open   )
DecodedURL
EncodedURL)assume)	compositeintegerslistssampled_fromtext)	IDNAErrorcheck_labelencode)decoded_urlsencoded_urlshostname_labels	hostnames	idna_textpathsport_numbersT.c                  (   [         (       d  / n [        [        [        5      S5      n[	        U5       n[        S U 5       SS9n[        U5        U H  nUu  pVnUS:w  a  M  US   R                  SS5      n[        U5      S:X  a  UR                  US   5        S	 U 5       u  p[        XS-   5       H*  nU[        :  a    Mq  U R                  [        U5      5        M,     M     S
S
S
5        SR                  U 5      q [         $ ! , (       d  f       N%= f)z.
Returns a string containing IDNA characters.
zidna-tables-properties.csv.gzc              3   B   #    U  H  oR                  S 5      v   M     g7f)utf-8N)decode).0lines     [/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/hyperlink/hypothesis.py	<genexpr>"idna_characters.<locals>.<genexpr>Q   s     ?hd[[))hs   ,)	delimiterPVALIDr   -r   c              3   :   #    U  H  n[        US 5      v   M     g7f)   N)int)r+   is     r-   r.   r/   b   s     !?h#a**hs   N )_idnaCharactersr   r   __file__	open_gzip
csv_readernextsplitlenappendranger	   unichr)resultdataFileNamedataFiler   rowcodespropdescriptionstartEndstartendr7   s               r-   idna_charactersrM   ?   s     F
  !#BL <(H#?h?! V!C/2,Ex' !"1v||C3H8}) 4!?h!?JE"5'2z>!fQi0 3 " )4 "hhv.O9 )(s   B2D
Dr8   c                     [        5       nUS:  d   eUb  US:  d   e[        [        U " [        XUS95      5      n [	        U5        U$ ! [
         a    [        S5         U$ f = f)z
A strategy which generates IDNA-encodable text.

@param min_size: The minimum number of characters in the text.
    C{None} is treated as C{0}.

@param max_size: The maximum number of characters in the text.
    Use C{None} for an unbounded size.
r   min_sizemax_sizealphabetF)rM   r   r   r   idna_encoder   r   )drawrP   rQ   rR   rC   s        r-   r#   r#   o   sw     #$1}}q= =xXNO
	   	5M	s   A
 
A#"A#c           
      V    U(       a  SnOSn[        [        U " [        USS95      5      $ )zn
A strategy which generates port numbers.

@param allow_zero: Whether to allow port C{0} as a possible value.
r   r   i  )	min_value	max_value)r   r6   r   )rT   
allow_zerorV   s      r-   r%   r%      s*     IICheLMNN    c                    U(       a1  [        [        U " [        SSS95      5      n UR                  S5        O6[        [        U " [        SS[        [        [        -   S	-   5      S
95      5      n [        U5        U$ ! [         a^    [        UR                  S5      5      S[        S5      -
  :  a1  USS n[        UR                  S5      5      S[        S5      -
  :  a  M1   Nuf = f! [         a    [        S5         U$ f = f)z
A strategy which generates host name labels.

@param allow_idn: Whether to allow non-ASCII characters as allowed by
    internationalized domain names (IDNs).
r   ?   rP   rQ   asciipunycodezxn--Nr3   rO   F)r   r   r#   r   UnicodeEncodeErrorr?   r   r   r   r   UnicodeErrorr   )rT   	allow_idnlabels      r-   r!   r!      s     tIq2$FGHE
'W% !"!#!%mf&<t&C!D	E	 = & ' %,,z23b3v;6FF "#2JE	 %,,z23b3v;6FF	'6  	5M	s$   A= 0C( =A#C%$C%(D Dc                   ^ [        [        U " [        US9R                  U4S j5      5      5      /nU[        [        [           U " [        [        US9SSS95      5      -  n[        S U 5       5      [        U5      -   S-
  S:  a,  USS	 n[        S U 5       5      [        U5      -   S-
  S:  a  M,  S
R                  U5      $ )a  
A strategy which generates host names.

@param allow_leading_digit: Whether to allow a leading digit in host
    names; they were not allowed prior to RFC 1123.

@param allow_idn: Whether to allow non-ASCII characters as allowed by
    internationalized domain names (IDNs).
)rb   c                 .   > T(       a  S$ U S   [         ;  $ )NTr   )r   )lallow_leading_digits    r-   <lambda>hostnames.<locals>.<lambda>   s    $7DOQqT=OOrY   r      r\   c              3   8   #    U  H  n[        U5      v   M     g 7f)N)r?   )r+   rc   s     r-   r.   hostnames.<locals>.<genexpr>   s     1&#e**&s      Nr_   .)	r   r   r!   filterr   r   sumr?   r   )rT   rg   rb   labelss    `  r-   r"   r"      s     #i8??	
 	$J#i8	
 		
 1&11CK?!CcICR[F 1&11CK?!CcI yy  rY   c                  N    [         c  S n SR                  U " 5       5      q [         $ )z8
Returns a string containing valid URL path characters.
c               3      #    [        [        5       H,  n [        U 5      nUS;   a  M   UR                  S5        Uv   M.     g ! [         a     M>  f = f7f)Nz#/?r)   )rA   r	   rB   r   r`   )r7   cs     r-   charspath_characters.<locals>.chars  sT     z*Aq	A Ez !) G + . ! !s'   &AA	A
AAAAr8   )_path_charactersr   )ru   s    r-   path_charactersrx      s(     #"  "wwuw/rY   c                 l    [        [        [           U " [        [	        S[        5       S9SS95      5      $ )Nr   )rP   rR   
   )rQ   )r   r   r   r   r   rx   rT   s    r-   r$   r$     s4     JdA0ABRP
 	
rY   c           
      2   [        [        [           U " [        SS95      5      n[        [        U " [        5       5      5      n[        [        [           U " [        5       5      5      nUS:X  a  Sn[        [        [        U " [        S5      5      5      UUUS9$ )z
A strategy which generates L{EncodedURL}s.
Call the L{EncodedURL.to_uri} method on each URL to get an HTTP
protocol-friendly URI.
T)rX   r   N)httphttps)schemehostportpath)
r   r   r6   r%   r   r"   r   r$   r   r   )rT   r   r   r   s       r-   r    r    #  s~     HSM4(E#FGD$y{+,HTNDM219Dd<0C#DEF	
 	
rY   c                 4    [        U " [        5       5      5      $ )z
A strategy which generates L{DecodedURL}s.
Call the L{EncodedURL.to_uri} method on each URL to get an HTTP
protocol-friendly URI.
)r   r    r{   s    r-   r   r   9  s     $|~.//rY   )Tuple )r   N)F)T)TT)=__doc__
__future__r   
hypothesiscsvr   r<   os.pathr   r   stringr   r   sysr	   typingr
   r   r   r   r   r   r   r   gzipr   r;   r8   r   r   r   hypothesis.strategiesr   r   r   r   r   idnar   r   r   rS   __all__r&   DrawCallablerB   	NameErrorchrrM   r9   r#   r%   r!   r"   rx   rw   r$   r    r   ImportErrorr   r   rY   r-   <module>r      sb   'z0 )%,	 	 	 '(!  CBG 	AXc1f-.12L,\ O @ O O + +Z )! )!V < 
 
 
 
* 0 0}  c  Gs#   C C CCC/.C/