HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/root/usr/lib/python3/dist-packages/docker/utils/__pycache__/fnmatch.cpython-310.pyc
o

�2.a��@s@dZddlZgd�ZiZdZdd�Zdd�Zd	d
�Zdd�ZdS)
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)�fnmatch�fnmatchcase�	translate�dcCst��dS)zClear the pattern cacheN)�_cache�clear�rr�6/usr/lib/python3/dist-packages/docker/utils/fnmatch.py�_purgesr
cCs|��}|��}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).
    )�lowerr)�name�patrrr	rs
rcCs\zt|}Wn ty&t|�}tt�tkrt��t�|�t|<}Ynw|�|�duS)z�Test whether FILENAME matches PATTERN, including case.
    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    N)	r�KeyErrorr�len�	_MAXCACHEr�re�compile�match)rr
�re_pat�resrrr	r/s�rcCs�dt|�}}d}||kr�||}|d}|dkrH||krC||dkrC|d}||kr5||dkr5|d}||kr>|d}n�|d}n�|d}n�|d	krQ|d
}nz|dkr�|}||kre||dkre|d}||krs||d
krs|d}||kr�||d
kr�|d}||kr�||d
ks}||kr�|d}n7|||��dd�}|d}|ddkr�d|dd�}n
|ddkr�d|}|�d|�d
�}n|t�|�}||ks
|dS)zfTranslate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    r�^��*�/z.*z(.*/)?z[^/]*�?z[^/]�[�!�]z\[�\z\\N�$)r�replacer�escape)r
�i�nr�c�j�stuffrrr	r?sJ



�
�-r)	�__doc__r�__all__rrr
rrrrrrr	�<module>s