Your IP : 3.128.201.71


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/ntpath.cpython-310.pyc

o

6��f)s�@s
dZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTgd�Z
dd
�ZzddlmZmZmZdd�ZWn
eyKdd�ZYnwdd�Zdd�Zdd�Zdd�Zdd�Zejje_dd�Zdd�Zd d!�Z d"d#�Z!zdd$l"m#Z#Wney�d	Z#Ynwd%d&�Z$d'd(�Z%d)d*�Z&d+d,�Z'd-d.�Z(zdd/l"m)Z)Wney�e(Z*Ynwd0d1�Z*z
dd2l"m+Z+m,Z-Wney�e*Z.Ynwd3d4�Z/d5d6�Z0d7d8�d9d:�Z.e1e
d;�o�e
�2�d<d=kZ3dCd>d?�Z4d@dA�Z5z	ddBl"m6Z7Wd	Se�yYd	Sw)Dz�Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
�.�..�\�;�/z.;C:\binZnul�N)�*)&�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat�
commonpathcCst|t�rdSdS)N�\/�\/)�
isinstance�bytes��path�r4�-/opt/alt/python310/lib64/python3.10/ntpath.py�
_get_bothseps#s
r6)�
LCMapStringEx�LOCALE_NAME_INVARIANT�LCMAP_LOWERCASEcCsdt�|�}|s	|St|t�r(t��}|�|d��dd�}tt	t
|�}|�|d�Stt	t
|�dd��S)�nNormalize case of pathname.

        Makes all characters lowercase and all slashes into backslashes.
        �surrogateescaperr)�os�fspathr0r1�sys�getfilesystemencoding�decode�replace�_LCMapStringEx�_LOCALE_NAME_INVARIANT�_LCMAP_LOWERCASE�encode)�s�encodingr4r4r5r3s

�
�rcCs@t�|�}t|t�rt�t�|��dd����S|�dd���S)r:rr)r<r=r0r1�fsencode�fsdecoderA�lower�rFr4r4r5rFs

cCsjt�|�}t|t�r|�dd��d�rdSn|�dd��d�r!dSt|�d}t|�d	ko4|d	t|�vS)
zTest whether a path is absolute�/�\�\\?\Trr�\\?\�r)	r<r=r0r1rA�
startswithr�lenr6rKr4r4r5r	Ws

�r	c

Gs@t�|�}t|t�rd}d}d}nd}d}d}zs|s"|dd�|t|�\}}ttj|�D]>}t|�\}}	|	rG|	d|vrG|sB|sD|}|	}q.|r\||kr\|��|��krZ|}|	}q.|}|rh|d|vrh||}||	}q.|r�|d|vr�|r�|dd�|kr�|||WS||WSttt	fy�t
jd	|g|�R��w)
NrMr.�:rr/�:r���r
)r<r=r0r1r�maprJ�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)
r3�pathsr!�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr4r4r5r
gsL


�
�r
cCst�|�}t|�dkr�t|t�rd}d}d}nd}d}d}|�||�}|dd�|dkrq|dd	�|krq|�|d�}|d
krG|dd�|fS|�||d�}||dkr]|dd�|fS|d
kret|�}|d|�||d�fS|dd�|kr�|dd�|dd�fS|dd�|fS)
a�Split a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    �rMrLrSrrrTr�rUNrP)r<r=rRr0r1rA�find)r_r!r$r^Znormp�indexZindex2r4r4r5r�s.

$rcCs�t�|�}t|�}t|�\}}t|�}|r+||d|vr+|d8}|r+||d|vs|d|�||d�}}|�|�p>|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.rPN)r<r=r6rrR�rstrip)r_r]�d�i�head�tailr4r4r5r�s
�rcCs4t�|�}t|t�rt�|ddd�St�|ddd�S)NrMrL�.rrr)r<r=r0r1rZ�	_splitext�r_r4r4r5r
�s

r
cC�t|�dS)z)Returns the final component of a pathnamerP�rrkr4r4r5r��rcCrl)z-Returns the directory component of a pathnamerrmrkr4r4r5r�rnrc
Cs6zt�|�}Wn
tttfyYdSwt�|j�S)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)r<�lstat�OSError�
ValueErrorrX�stat�S_ISLNK�st_mode�r3�str4r4r5r�s�rc	Cs*zt�|�}WdSttfyYdSw)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r<rorprqrur4r4r5r
s��r)�_getvolumepathnamecCspt�|�}t|�}t|�}t|�\}}|r"|d|vr"|p!||vS||vr(dStr6|�|�t|��|�kSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTF)r<r=r6rrrwrd)r3r]�root�restr4r4r5r s
rcCsJt�|�}t|t�r
d}nd}|�|�s|Sdt|�}}||kr9||t|�vr9|d7}||kr9||t|�vs)dtjvrDtjd}n"dtjvrK|Sztjd}Wnty]d}Ynwt	|tjd�}|dkr�|d|�}t|t�rzt�
|�}tj�d�}||kr�|t|�kr�|St	t
|�|�}t|t�r�t�|�}|||d	�S)
zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.�~�~rPZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�ZUSERNAMEN)r<r=r0r1rQrRr6�environ�KeyErrorr
rI�getrrrH)r3�tilderf�n�userhome�driveZtarget_userZcurrent_userr4r4r5r;s@


�

�



rcCs0t�|�}t|t�r4d|vrd|vr|Sddl}t|j|jdd�}d}d}d}d	}d}ttd
d�}n#d|vr>d|vr>|Sddl}|j|jd}d
}d}d}d}d}tj}|dd�}	d}
t	|�}|
|k�r||
|
d�}||kr�||
dd�}t	|�}z|�
|�}
|	||d|
d�7}	W�nyty�|	||7}	|d}
Y�nfw||k�r||
d|
d�|kr�|	|7}	|
d7}
�nJ||
dd�}t	|�}z|�
|�}
Wnty�|	||7}	|d}
Y�n#w|d|
�}
z|du�rt�tjt�
|
��}n||
}Wnt�y||
|}Ynw|	|7}	n�||k�r
||
d|
d�|k�r:|	|7}	|
d7}
n�||
d|
d�|k�r�||
dd�}t	|�}z|�
|�}
Wnt�yp|	|||7}	|d}
Yn�w|d|
�}
z|du�r�t�tjt�
|
��}n||
}Wnt�y�|||
|}Ynw|	|7}	nh|dd�}
|
d7}
||
|
d�}|�r�||v�r�|
|7}
|
d7}
||
|
d�}|�r�||v�s�z|du�r�t�tjt�
|
��}n||
}Wnt�y�||
}Ynw|	|7}	|�r	|
d8}
n|	|7}	|
d7}
|
|ksh|	S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rNz_-�ascii�'�{�}�environb�$�%�'�{�}rPr`)r<r=r0r1�stringZ
ascii_lettersZdigits�getattrr}rRrcrqrHrIr~)r3r�ZvarcharsZquoteZpercentZbraceZrbraceZdollarr}�resrcZpathlen�c�var�valuer4r4r5rxs�



�
�
��


�
��
�
����Lrc	CsNt�|�}t|t�rd}d}d}d}d}n
d}d}d}d	}d
}|�|�r&|S|�||�}t|�\}}|�|�r@||7}|�|�}|�|�}d}|t	|�kr�||rW|||kr[||=n6|||kr�|dkr{||d|kr{||d|d�=|d8}n|dkr�|�
|�r�||=n	|d7}n|d7}|t	|�ksM|s�|s�|�|�||�|�S)
z0Normalize path, eliminating double slashes, etc.rMrLri�..)s\\.\rNrrrr)z\\.\rOrrP)
r<r=r0r1rQrAr�lstriprrR�endswith�appendr
)	r3r!r$rr Zspecial_prefixes�prefix�compsrfr4r4r5r�sH







�
rcCs@t�|�}t|�st|t�rt��}nt��}t||�}t|�S)z�Return the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    )	r<r=r	r0r1�getcwdb�getcwdr
r)r3�cwdr4r4r5�_abspath_fallbacks



r�)�_getfullpathnamec	Cs.ztt|��WSttfyt|�YSw)z&Return the absolute version of a path.)rr�rprqr�r2r4r4r5r3s
�r)�_getfinalpathname�readlinkc
Cs�d}t�}t|�|vrY|�t|��z|}t|�}t|�s/t|�s&|}W|Sttt|�|��}Wn"t	yI}z
|j
|vrDWYd}~|S�d}~wtyRY|Swt|�|vs|S)N)rPr`ra��� �2�C�Wi&i(i))�setr�add�_nt_readlinkr	rrr
rrp�winerrorrq)r3�allowed_winerror�seenZold_path�exr4r4r5�_readlink_deep@s4	��

����r�cCs�d}d}|rqzt|�}|rt||�WS|WStyn}zM|j|vr#�zt|�}||kr<|r3t||�n|WWYd}~SWn	tyFYnwt|�\}}|r[|s[||WYd}~S|rbt||�n|}WYd}~nd}~ww|s|S)N)rPr`rar�r�r�r��5�Ar�r��{�i�i�r|)r�r
rpr�r�r)r3r�rhr��new_path�namer4r4r5�_getfinalpathname_nonstrictjs2
 �����r�F)�strictc

Csvt|�}t|t�r!d}d}d}t��}t|�tt�t��kr dSnd}d}d}t��}t|�tt�kr5dS|�	|�}|sEt
|�sEt||�}zt|�}d	}Wnt
yi}z|rX�|j}t|�}WYd}~nd}~ww|s�|�	|�r�|�	|�r�||t|�d�}	n|t|�d�}	zt|	�|kr�|	}W|SW|St
y�}z|j|kr�|	}WYd}~|SWYd}~|Sd}~ww|S)
NrNs\\?\UNC\s\\s\\.\NULrOz\\?\UNC\z\\z\\.\NULr)rr0r1r<r�rrHr&r�rQr	r
r�rpr�r�rR)
r3r�r�Z
unc_prefixZnew_unc_prefixr�Z
had_prefixZinitial_winerrorr�Zspathr4r4r5r'�s^
�

��
��

���r'�getwindowsversionrar`cCsXt�|�}t|t�rd}d}d}nd}d}d}|dur|}|s#td��t�|�}zott|��}tt|��}t|�\}}t|�\}	}
t|�t|	�krQtd	|	|f��d
d�|�	|�D�}dd�|
�	|�D�}d
}
t
||�D]\}}t|�t|�krzn|
d7}
ql|gt|�|
||
d�}|s�|WSt|�WSt
ttttfy�t�d||��w)z#Return a relative version of a pathrMrir�rrrNzno path specifiedz&path is on mount %r, start on mount %rcS�g|]}|r|�qSr4r4��.0�xr4r4r5�
<listcomp>��zrelpath.<locals>.<listcomp>cSr�r4r4r�r4r4r5r��r�rrPr))r<r=r0r1rqrrrrr�ziprRr
rWrXrY�DeprecationWarningrZr[)r3�startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrfZe1Ze2�rel_listr4r4r5r)�sJ


�

�r)c	s�|std��tttj|��}t|dt�rd�d�d�nd�d�d�z���fd	d
�|D�}�fdd
�|D�}zt�fdd
�|D��\}WntyPtd�d�wttdd
�|D���dkrbtd��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}t|�D]\}	}
|
||	kr�|d|	�}n	q�|dt|��}|r�|�n|}|��|�WSttfy�tjdg|�R��w)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerrMrLrirrrcs g|]}t|��������qSr4)rrArJ)r�r_)r$r!r4r5r�s zcommonpath.<locals>.<listcomp>csg|]	\}}|����qSr4rm�r�rer_�r!r4r5r�sc3s$�|]
\}}|dd��kVqdS)NrPr4r�r�r4r5�	<genexpr>s�"zcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss�|]\}}|VqdS�Nr4r�r4r4r5r�&s�rPzPaths don't have the same drivec�g|]
}|r|�kr|�qSr4r4�r�r��rr4r5r�+�csg|]}�fdd�|D��qS)cr�r4r4r�r�r4r5r�-r�z)commonpath.<locals>.<listcomp>.<listcomp>r4)r�rFr�r4r5r�-sr-)rq�tuplerVr<r=r0r1r�rRrrAr�min�max�	enumerater
rWrXrZr[)r\Zdrivesplits�split_pathsr	r�r3�common�s1�s2rfr�r�r4)r$rr!r5r-
sL
�
��r-)�_isdirr�)8�__doc__rr r%r!r"r$r#r&r<r>rrrZ�__all__r6Z_winapir7rBr8rCr9rDr�ImportErrorr	r
rrr
rjrrrr�ntrwrrrrr�r�rr�r�r�r'r�r��hasattrr�r(r)r-r�rr4r4r4r5�<module>s�	
�/8
�=q2��*1
4�
84�

?>