
    Ioj                       S r SSKJr  SSKrSSKrSSKrSSKJrJr  SSK	J
r
JrJr  \
(       a  SSKJrJrJr  \" S\\5      r/ SQrSSS	 jjrSSS
 jjrSS jr\SS j5       r\SS j5       rS S jrS r\S!S j5       r\S"S j5       rS#S jr\S$S j5       r\S%S j5       rS&S jr\R8                  " S5      r\R8                  " S5      rS'S jrS(S jr S r!g))z
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.

Changes include:
 * `yield from` and PEP3102 `*` removed.
 * Hidden files are not ignored.
    )annotationsN)IterableIterator)TYPE_CHECKINGTypeVaroverload)	BytesPathStrOrBytesPathStrPath_StrOrBytesT)escapeglobiglobc                &    [        [        XS95      $ )a]  Return a list of paths matching a pathname pattern.

The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.

If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
)	recursive)listr   )pathnamer   s     I/mnt/workspace/venv-train/lib/python3.13/site-packages/setuptools/glob.pyr   r      s     h455    c                r    [        X5      nU(       a$  [        U 5      (       a  [        U5      nU(       a   eU$ )ap  Return an iterator which yields the paths matching a pathname pattern.

The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.

If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
)_iglob_isrecursivenext)r   r   itss       r   r   r   '   s0     
	$B\(++HuIr   c              #    #    [         R                  R                  U 5      u  p#U(       a  [        U5      (       a  [        O[
        n[        U 5      (       dY  U(       a)  [         R                  R                  U 5      (       a  U v   g [         R                  R                  U5      (       a  U v   g U(       d  U" X#5       S h  vN   g X :w  a  [        U5      (       a  [        X!5      nOU/n[        U5      (       d  [        nU H3  nU" X#5       H$  n[         R                  R                  X&5      v   M&     M5     g  Ny7fN)ospathsplitr   glob2glob1	has_magiclexistsisdirr   glob0join)r   r   dirnamebasenameglob_in_dirdirsnames          r   r   r   9   s     h/G$h)?)?%UKXwwx((
 	 ww}}W%%w111 y11'-g'AyX2D'',,w-- 3  	2s   C D>D<A:D>c                    g r    r(   patterns     r   r"   r"   ]   s    8;r   c                    g r   r.   r/   s     r   r"   r"   _   s    >Ar   c                   U (       dE  [        U[        5      (       a   [        R                  R	                  S5      n O[        R                  n  [        R
                  " U 5      n[        R                  " X!5      $ ! [         a    / s $ f = fNASCII)	
isinstancebytesr   curdirencodelistdirOSErrorfnmatchfilter)r(   r0   namess      r   r"   r"   a   si    gu%%ii&&w/GiiG

7# >>%))  	s   A: :B	B	c                    U(       d*  [         R                  R                  U 5      (       a  U/$  / $ [         R                  R                  [         R                  R	                  X5      5      (       a  U/$ / $ r   )r   r   r%   r$   r'   )r(   r)   s     r   r&   r&   o   s]     77==!!: "
 I 77??277<<:;;:Ir   c                    g r   r.   r/   s     r   r!   r!      s    <?r   c                    g r   r.   r/   s     r   r!   r!      s    BEr   c              #  h   #    [        U5      (       d   eUS S v   [        U 5       S h  vN   g  N7f)Nr   )r   	_rlistdirr/   s     r   r!   r!      s0         
"1+!!!s   (202c                    g r   r.   r(   s    r   rB   rB      s    25r   c                    g r   r.   rD   s    r   rB   rB      s    69r   c              #    #    U (       dE  [        U [        5      (       a   [        R                  R	                  S5      n O[        R                  n  [        R
                  " U 5      nU Hb  nUv   U (       a  [        R                  R                  X5      OUn[        U5       H$  n[        R                  R                  X$5      v   M&     Md     g ! [         a     g f = f7fr3   )
r5   r6   r   r7   r8   r9   r:   r   r'   rB   )r(   r=   xr   ys        r   rB   rB      s     gu%%ii&&w/GiiG

7# +2rww||G'4A'',,q$$ !	   s+   ACC &A)C
CCCCz([*?[])s   ([*?[])c                    [        U [        5      (       a  [        R                  U 5      S L$ [        R                  U 5      S L$ r   )r5   r6   magic_check_bytessearchmagic_check)r   s    r   r#   r#      s;    !U ''*$66!!!$D00r   c                @    [        U [        5      (       a  U S:H  $ U S:H  $ )Ns   **z**)r5   r6   )r0   s    r   r   r      s$    '5!!%$r   c                    [         R                  R                  U 5      u  p[        U [        5      (       a  [
        R                  SU 5      n X-   $ [        R                  SU 5      n X-   $ )zEscape all special characters.s   [\1]z[\1])r   r   
splitdriver5   r6   rJ   subrL   )r   drives     r   r   r      s_     gg((2OE(E""$((8<  ??7H5r   )F)r   r   r   boolreturnzlist[_StrOrBytesT])r   r   r   rR   rS   zIterator[_StrOrBytesT])r(   r   r0   strrS   z	list[str])r(   r	   r0   r6   rS   zlist[bytes])r(   r
   r0   str | bytesrS   zlist[str] | list[bytes])r(   r   r0   rT   rS   Iterator[str])r(   r	   r0   r6   rS   Iterator[bytes])r(   r
   r0   rU   rS   Iterator[str | bytes])r(   r   rS   rV   )r(   r	   rS   rW   )r(   r
   rS   rX   )r   rU   rS   rR   )r0   rU   rS   rR   )"__doc__
__future__r   r;   r   recollections.abcr   r   typingr   r   r   	_typeshedr	   r
   r   rT   r6   r   __all__r   r   r   r"   r&   r!   rB   compilerL   rJ   r#   r   r   r.   r   r   <module>ra      s    #  	 	 . 3 3<<>36L
%6$.H 
 ; 
 ;	 A 
 A*	  
 ? 
 ?	 E 
 E" 
 5 
 5	 9 
 9%$ jj#JJz* 1	r   