
    do                         d Z ddlZddlZddlZddlZg dZd Z ej        dd          d             Zd	 Z	d
 Z
d ZdS )a  Filename matching with shell patterns.

fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.

The functions operate by translating the pattern into a regular
expression.  They cache the compiled regular expressions for speed.

The function translate(PATTERN) returns a regular expression
corresponding to PATTERN.  (It does not compile it.)
    N)filterfnmatchfnmatchcase	translatec                     t           j                            |           } t           j                            |          }t          | |          S )a  Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).
    )ospathnormcaser   )namepats       /croot/python-split_1694437901252/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.11/fnmatch.pyr   r      s>     7D!!D
'

3

CtS!!!    i   T)maxsizetypedc                     t          | t                    r0t          | d          }t          |          }t          |d          }nt          |           }t	          j        |          j        S )Nz
ISO-8859-1)
isinstancebytesstrr   recompilematch)r   pat_strres_strress       r   _compile_patternr   &   s]    #u c<((G$$G\**nn:c??  r   c                 \   g }t           j                            |          }t          |          }t           j        t          u r&| D ]"} ||          r|                    |           #nB| D ]?} |t           j                            |                    r|                    |           @|S )zJConstruct a list from those elements of the iterable NAMES that match PAT.)r   r	   r
   r   	posixpathappend)namesr   resultr   r   s        r   r   r   0   s    F
'

3

CS!!E	w) 	$ 	$DuT{{ $d###	$  	$ 	$DuRW%%d++,, $d###Mr   c                 :    t          |          } ||           duS )zTest whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    N)r   )r   r   r   s      r   r   r   @   s$     S!!E5;;d""r   c                    t                      }g }|j        }dt          |           }}||k     r| |         }|dz   }|dk    r|r
|d         |ur ||           n_|dk    r |d           nL|dk    r(|}||k     r| |         dk    r|dz   }||k     r| |         d	k    r|dz   }||k     r#| |         d	k    r|dz   }||k     r| |         d	k    ||k    r |d
           n| ||         }d|vr|                    dd          }n"g }	| |         dk    r|dz   n|dz   }
	 |                     d|
|          }
|
dk     rn(|	                    | ||
                    |
dz   }|
dz   }
F| ||         }|r|	                    |           n|	dxx         dz  cc<   t          t          |	          dz
  dd          D ]P}
|	|
dz
           d         |	|
         d         k    r-|	|
dz
           dd         |	|
         dd         z   |	|
dz
  <   |	|
= Qd                    d |	D                       }t          j        dd|          }|dz   }|s |d           nh|dk    r |d           nV|d         dk    rd|dd         z   }n|d         dv rd|z   } |d| d	           n |t          j	        |                     ||k     ||k    sJ |}g }|j        }dt          |          }}||k     r0||         |ur& |||                    |dz  }||k     r
||         |u&||k     r||         |u sJ |dz  }||k    r |d           n||         |usJ g }||k     r:||         |ur0|                    ||                    |dz  }||k     r
||         |u0d                    |          }||k    r |d            ||           n |d| d           ||k     ||k    sJ d                    |          }d| dS )zfTranslate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    r      *?.[!]z\[-\\\   T   Nc              3   j   K   | ].}|                     d d                               dd          V  /dS )r,   r-   r+   z\-N)replace).0ss     r   	<genexpr>ztranslate.<locals>.<genexpr>   sT       %6 %6)* &'YYtU%;%;%C%CC%O%O %6 %6 %6 %6 %6 %6r   z([&~|])z\\\1z(?!)^)r5   r(   z.* z(?>.*?)z(?s:z)\Z)
objectr   lenr1   findrangejoinr   subescape)r   STARr   addincjstuffchunkskchunkinpfixeds                 r   r   r   J   s&    88D
C
*Cc#hhqA
a%%FaC88 CG4//D			#XXCHHHH#XXA1uuQ3aC1uuQ3aCa%%CFcMMaC a%%CFcMMAvvE



AaCe##!MM$66EEF"1v}}!!A#A HHS!Q//q55!c!A#h///aCaC   !HE *e,,,,r


c)


"3v;;q=!R88 * *!!A#;r?VAYq\99*01+crc*:VAYqrr]*JF1Q3K &q	  HH %6 %6.4%6 %6 %6 6 6E z7E::aC &CKKKKc\\CHHHHQx3 #eABBiqZ// $uCE%%%%C	! a%%@ 6666 C
C
*Cc#hhqA
a%%CF$&&CF	Q a%%CF$&& a%%1v~~~~	Q66CIII1vT!!!!!eeAd**LLQ   FA !eeAd** 66CIIICJJJJC!!!!"""! a%%" 6666
''#,,C3r   )__doc__r   r   r   	functools__all__r   	lru_cacher   r   r   r    r   r   <module>rP      s   
 
 
			     				    
;
;
;" " "& U$///! ! 0/!   # # #o o o o or   