Edit File: posixpath.cpython-311.pyc
� �����fuB�����������������������F����d�Z�dZdZdZdZdZdZdZdZddl Z ddl Z ddlZddlZdd lT�g�d �Z d��Zd��Zd ��Zd��Zd��Zd��Zej��������j���������e_���������d��Zd��Zd��Zd��Zd��Zd��Zd��Zdadad��Z �ddlm Z �d��Z!n#�e"$�r�d��Z!Y�nw�xY�wd��Z#dd�d�Z$d ��Z%e j&��������d!k����Z'd$d"�Z(d#��Z)dS�)%a���Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Windows), os.path provides the same operations in a manner specific to that platform, and is an alias to another module (e.g. ntpath). Some of this can actually be useful on non-Posix systems too, e.g. for manipulation of the pathname component of URLs. �.�..�/�:z /bin:/usr/binNz /dev/null�����)�*)&�normcase�isabs�join� splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount� expanduser� expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath� commonpathc������������������4�����t����������|�t����������������������rdS�dS�)N����/r���)� isinstance�bytes��paths��� �0/opt/alt/python311/lib64/python3.11/posixpath.py�_get_sepr5���)���s�������$�������t��s�����c������������������*�����t����������j��������|�������������S�)z6Normalize case of pathname. Has no effect under Posix��os�fspath)�ss��� r4���r���r���4���s������ �9�Q�<�<�r6���c������������������r�����t����������j��������|�������������}�t����������|�������������}|����������������������|������������S�)zTest whether a path is absolute)r9���r:���r5���� startswith)r;���r$���s��� r4���r ���r ���<���s,������ � �!���A� �1�+�+�C��<�<����r6���c����������������������t����������j��������|�������������}�t����������|�������������}|�} �|s |dd����������|z����t����������t�����������j��������|������������D�]?}|���������������������|������������r|}�|r|���������������������|������������r||z ��}�7|||z���z ��}�@n/#�t����������t����������t����������f$�r�t����������j ��������d|�g|�R������w�xY�w|S�)z�Join two or more pathname components, inserting '/' as needed. If any component is an absolute path, all previous path components will be discarded. An empty last part will result in a path that ends with a separator.Nr���r ���)r9���r:���r5����mapr=����endswith� TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr$���r3����bs��� r4���r ���r ���G���s������� � � �!���A� �1�+�+�C��D���� ���!��H�s�N�N��R�Y��"�"�� �� �A��|�|�C� � �� ������ �T�]�]�3�/�/�� ��� �����a����� ��� �~�|�4��������$�V�Q�3��3�3�3�3� �������Ks����A)B��,B=c����������������������t����������j��������|�������������}�t����������|�������������}|����������������������|������������dz���}|�d|����������|�|d����������}}|r+||t ����������|������������z��k����r|���������������������|������������}||fS�)z�Split a pathname. Returns tuple "(head, tail)" where "tail" is everything after the final slash. Either part may be empty.����N�r9���r:���r5����rfind�len�rstrip)rG���r$����i�head�tails��� r4���r���r���d���s�������� � �!���A� �1�+�+�C� ������q��A��2�A�2���!�"�"��$�D��� ���C��I�I� �%�%��{�{�3������:�r6���c�����������������������t����������j��������|�������������}�t����������|�t����������������������rd}d}nd}d}t ����������j��������|�|d�|������������S�)Nr/�������.r���r���)r9���r:���r0���r1���rD���� _splitext)rG���r$���r(���s��� r4���r ���r ���u���sN������ � �!���A��!�U��������������� ��C��v�6�6�6r6���c������������������B�����t����������j��������|�������������}�|�dd����������|�fS�)zJSplit a pathname into drive and path. On Posix, drive is always empty.Nr���r8���)rG���s��� r4���r���r�������s"������� � �!���A��R�a�R�5�!�8�Or6���c�����������������������t����������j��������|�������������}�t����������|�������������}|����������������������|������������dz���}|�|d����������S�)z)Returns the final component of a pathnamerJ���N)r9���r:���r5���rL���)rG���r$���rO���s��� r4���r���r�������s;������ � �!���A� �1�+�+�C� ������q��A��Q�R�R�5�Lr6���c������������������������t����������j��������|�������������}�t����������|�������������}|����������������������|������������dz���}|�d|����������}|r+||t ����������|������������z��k����r|���������������������|������������}|S�)z-Returns the directory component of a pathnamerJ���NrK���)rG���r$���rO���rP���s��� r4���r���r�������sm������ � �!���A� �1�+�+�C� ������q��A��R�a�R�5�D��� ���C��I�I� �%�%��{�{�3�����Kr6���c����������������������� �t����������j��������|�������������}n#�t����������t����������t����������f$�r�Y�dS�w�xY�wt����������j��������|j��������������������S�)z&Test whether a path is a symbolic linkF)r9����lstat�OSError� ValueErrorrB����stat�S_ISLNK�st_mode)r3����sts��� r4���r���r�������sQ������� �X�d�^�^�����Z��0��������u�u������<�� �#�#�#s������2�2c������������������b����� �t����������j��������|��������������n#�t����������t����������f$�r�Y�dS�w�xY�wdS�)zCTest whether a path exists. Returns True for broken symbolic linksFT)r9���rY���rZ���r[���r2���s��� r4���r���r�������sB������� ���������Z� ��������u�u������4s������,�,c���������������������� �t����������j��������|�������������}t����������j��������|j��������������������rdS�n#�t ����������t����������f$�r�Y�dS�w�xY�wt����������j��������|�������������}�t����������|�t����������������������rt����������|�d������������}nt����������|�d������������}t����������|������������} �t����������j��������|������������}n#�t ����������t����������f$�r�Y�dS�w�xY�w|j��������}|j��������}||k����rdS�|j ��������}|j ��������}||k����rdS�dS�)z$Test whether a path is a mount pointF����..r���T)r9���rY���r\���r]���r^���rZ���r[���r:���r0���r1���r ���r*����st_dev�st_ino)r3����s1�parent�s2�dev1�dev2�ino1�ino2s��� r4���r���r�������s'������ �X�d�^�^����<�� �#�#�� ��5� ��� �Z� ��������u�u�������9�T�?�?�D��$�����"��d�E�"�"����d�D�!�!�� �f� � �F�� �X�f� � �����Z� ��������u�u�������9�D� �9�D��t�|�|��t� �9�D� �9�D��t�|�|��t��5s!����2��A�A�$B9��9C� Cc����������������������t����������j��������|�������������}�t����������|�t����������������������rd}nd}|����������������������|������������s|�S�t����������|�������������}|����������������������|d������������}|dk�����rt����������|�������������}|dk����rxdt�����������j��������vrW �ddl }n#�t����������$�r�|�cY�S�w�xY�w �|���������������������t����������j����������������������������������j ��������}n�#�t����������$�r�|�cY�S�w�xY�wt�����������j��������d���������}nw �ddl }n#�t����������$�r�|�cY�S�w�xY�w|�d|����������}t����������|t����������������������rt����������|d������������} �|���������������������|������������}n#�t����������$�r�|�cY�S�w�xY�w|j ��������}|�t"����������j��������dk����r|�S�t����������|�t����������������������rt����������j��������|������������}d }nd }|���������������������|������������}||�|d����������z���p|S�)zOExpand ~ and ~user constructions. If user or $HOME is unknown, do nothing.����~�~rJ���r����HOMEN�ASCII�vxworksr/���r���)r9���r:���r0���r1���r=���r5����findrM����environ�pwd�ImportError�getpwuid�getuid�pw_dir�KeyError�str�getpwnam�sys�platform�fsencoderN���) r3����tilder$���rO���rt����userhome�name�pwent�roots ��� r4���r���r�������s3�������9�T�?�?�D��$������������?�?�5�!�!����� �4�.�.�C�� � �#�q���A��1�u�u���I�I���A�v�v����#�#� �� � � � ���� �� �� ����� ���� ��<�<�� ���4�4�;������ �� �� ������ ���� ��z�&�)�H�H� ��J�J�J�J���� �� �� ��K�K�K� ������A�a�C�y���d�E�"�"�� &��t�W�%�%�D� ��L�L��&�&�E�E���� �� �� ���K�K�K� ������<����C�L�I�5�5����$�������;�x�(�(����������t�$�$�H��t�A�B�B�x��(�D�(sH����B��B)�(B)�-+C��C(�'C(�?D��D�D�E��E+�*E+c������������������v����t����������j��������|�������������}�t����������|�t����������������������rSd|�vr|�S�t����������sddl}|���������������������d|j��������������������at����������j��������}d}d}t����������t�����������dd������������}nHd|�vr|�S�t����������sddl}|���������������������d |j��������������������a t����������j��������}d }d}t�����������j��������}d} ��||�|������������}|sn�|���������������������d������������\��}}|� ��������������������d ������������} | ���������������������|������������r| ���������������������|������������r | d d����������} �|�7t����������j��������t�����������j��������t����������j��������| ���������������������������������} n|| ���������} |�|d����������}|�d|����������| z���}�t%����������|�������������}|�|z ��}�n#�t&����������$�r�|}Y�nw�xY�w��|�S�)zZExpand shell variables of form $var and ${var}. Unknown variables are left unchanged.����$r���Ns���\$(\w+|\{[^}]*\})����{����}�environb�$z\$(\w+|\{[^}]*\})�{�}TrJ������)r9���r:���r0���r1���� _varprogb�re�compilerp����search�getattr�_varprogrs����span�groupr=���r@���r~����fsdecoderM���ry���)r3���r����r�����start�endrs���rO����m�jr�����valuerQ���s��� r4���r���r���%��s��������9�T�?�?�D��$�������t����K��� D��I�I�I�� � �#8�"�(�C�C�I��!�������"�j�$�/�/����d�?�?��K��� B��I�I�I��z�z�"6���A�A�H���������*�� �A���F�4��O�O���� ���v�v�a�y�y���1��w�w�q�z�z���?�?�5�!�!�� �d�m�m�C�&8�&8�� ���"��:�D� �����B�J�r�{�4�/@�/@�$A�B�B����� �������8�D�����8�e�#�D��D� � �A��D�L�D�D�� ��� �� �� ��A�A�A� �����(��Ks����9AF&��&F5�4F5)�_path_normpathc������������������������t����������j��������|�������������}�t����������|�t����������������������r5t����������j��������t����������t����������j��������|�������������������������������������pdS�t����������|�������������pdS�)�0Normalize path, eliminating double slashes, etc.rS���r���)r9���r:���r0���r1���r~���r����r����r2���s��� r4���r���r������s\�������y������d�E�"�"�� J��;�~�b�k�$�.?�.?�@�@�A�A�I�T�I��d�#�#�*�s�*r6���c������������������0����t����������j��������|�������������}�t����������|�t����������������������r d}d}d}d}nd}d}d}d}|�|k����r|S�|����������������������|������������}|r2|����������������������|d z��������������r|����������������������|d z��������������sd }|����������������������|������������}g�}|D�]M}|||fv�r� ||k����s|s|r|r"|d���������|k����r|���������������������|��������������7|r|�������������������������������������N|}|���������������������|������������}�|r||z��|�z���}�|�p|S�)r����r/���r6���rS���rb���r�����r���r�����������r����) r9���r:���r0���r1���r=���r����append�popr ���) r3���r$����empty�dot�dotdot�initial_slashes�comps� new_comps�comps ��� r4���r���r���^��sh������y������d�E�"�"�� ��C��E��C��F�F��C��E��C��F��5�=�=��J��/�/�#�.�.��� �� ��O�O�C��E�"�"� �+/�?�?�3�q�5�+A�+A� ��O�� � �3����� ��� �� �D���s�|�#�#��������y����� )�"� �� 7� 7�� � ��&�&�&�&��� �� � ��������x�x������� .���&��-�D��{�s�r6���c�����������������������t����������j��������|�������������}�t����������|�������������sLt����������|�t����������������������rt����������j����������������������}nt����������j����������������������}t����������||�������������}�t����������|�������������S�)zReturn an absolute path.) r9���r:���r ���r0���r1����getcwdb�getcwdr ���r���)r3����cwds��� r4���r���r������s`������ �9�T�?�?�D���;�;����d�E�"�"�� ��*�,�,�C�C��)�+�+�C��C������D�>�>�r6���F)�strictc����������������������t����������j��������|�������������}�t����������|�dd����������|�|i�������������\��}}t����������|������������S�)zlReturn the canonical path of the specified filename, eliminating any symbolic links encountered in the path.Nr���)r9���r:���� _joinrealpathr���)�filenamer����r3����oks��� r4���r*���r*������s>��������y��"�"�H��X�b�q�b�\�8�V�R�@�@�H�D�"��4�=�=�r6���c�����������������������t����������|�t����������������������rd}d}d}nd}d}d}t����������|������������r|dd�����������}|}�|�r0|���������������������|������������\��}}}|r||k����r�%||k����r/|�r*t ����������|�������������\��}�}||k����rt����������|�||������������}�n|}��Zt����������|�|������������} �t ����������j��������| ������������} t����������j ��������| j ��������������������}n#�t����������$�r�|r��d}Y�nw�xY�w|s| }���| |v�r4|| ���������}�|����|rt ����������j��������| �������������nt����������| |������������dfS�d�|| <���t����������|�t ����������j ��������| ������������||������������\��}�}|st����������|�|������������dfS�|�|| <���|��0|�d fS�) Nr/���rS���rb���r���r���r���rJ���FT)r0���r1���r ���� partitionr���r ���r9���rY���r\���r]���r^���rZ���r�����readlink) r3����restr�����seenr$���r"���r#���r�����_�newpathr_����is_linkr����s ��� r4���r����r�������s�������$��������������������T�{�{����A�B�B�x���� ��,����s�+�+� ��a���� �t�v�~�~���6�>�>��� �"�4�[�[� ��d��6�>�>���f�f�5�5�D������t�T�"�"�� /���'�"�"�B���l�2�:�.�.�G�G����� �� �� ��� ���G�G�G� ������� ��D���d�?�?���=�D������ 2���� � � � ���G�T�*�*�E�1�1���W� � ��r�{�7�';�';�V�T�J�J���b��� +���d�#�#�U�*�*���W� �Y���,�\���:�s����)C��C)�(C)�darwinc������������������|����|�st����������d�������������t����������j��������|�������������}�t����������|�t����������������������rd}d}d}nd}d}d}|�|}nt����������j��������|������������} �d ��t����������|���������������������������������|������������D���������������}d ��t����������|����������������������������������|������������D���������������}t����������t����������||g������������������������}|gt����������|������������|z ��z��||d����������z���}|s|S�t����������|��S�#�t����������t����������t����������t����������f$�r�t����������j��������d|�|���������������w�xY�w)z#Return a relative version of a pathzno path specifiedrS���r/���rb���r���r���r���Nc�����������������������g�|�]}|�|��S���r������.0�xs��� r4���� <listcomp>zrelpath.<locals>.<listcomp>���s������@�@�@�A�a�@�a�@�@�@r6���c�����������������������g�|�]}|�|��S�r����r����r����s��� r4���r����zrelpath.<locals>.<listcomp>���s������>�>�>�1�A�>�Q�>�>�>r6���r,���)r[���r9���r:���r0���r1���r���r���rM���r���r ���rA���rB���rC����DeprecationWarningrD���rE���) r3���r����r"���r$���r#���� start_list� path_listrO����rel_lists ��� r4���r,���r,������sZ��������.��,�-�-�-� �9�T�?�?�D��$��������������������}����� �%� � ���@�@�����!5�!5�c�!:�!:�@�@�@� �>�>��� � � 3� 3�C� 8� 8�>�>�>� ���j�)�4�5�5�6�6���8�s�:���q�0�1�I�a�b�b�M�A���� ��M��X�����~�|�5G�H��������$�Y��e�<�<�<� ����s����"BD��=D��5D;c��������������������� � ��|�st����������d�������������t����������t����������t����������j��������|�������������������������}�t����������|�d���������t����������������������rd� d� nd� d� �� fd�|�D���������������} �t����������� fd�|�D���������������������������\��}n#�t�����������$�r�t����������d ������������d �w�xY�w� fd�|D���������������}t����������|������������}t����������|������������}|}t����������|������������D�]\��}}|||���������k����r|d |����������}�n�|r� n � d d����������}|� ���������������������|������������z���S�#�t����������t����������f$�r�t����������j��������dg|��R������w�xY�w) zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencer���r/���rS���r���r���c������������������:������g�|�]}|�������������������������������������S�r����)r���)r����r3���r$���s��� �r4���r����zcommonpath.<locals>.<listcomp>��s#�������9�9�9�4�t�z�z�#���9�9�9r6���c��������������3����4����K����|�]}|d�d�����������k����V����d�S�)NrJ���r����)r����rG���r$���s��� �r4���� <genexpr>zcommonpath.<locals>.<genexpr>!��s/�����������5�5�!��2�A�2��#��5�5�5�5�5�5r6���z%Can't mix absolute and relative pathsNc������������������,������g�|�]}�fd��|D�����������������S�)c������������������$������g�|�]}|�|�k����� |�� S�r����r����)r�����cr"���s��� �r4���r����z)commonpath.<locals>.<listcomp>.<listcomp>%��s#�������:�:�:�a��:�a�6�k�k��k�k�kr6���r����)r����r;���r"���s��� �r4���r����zcommonpath.<locals>.<listcomp>%��s.�������P�P�P�q�:�:�:�:�1�:�:�:�P�P�Pr6���r-���)r[����tupler?���r9���r:���r0���r1����set�min�max� enumerater ���rA���rB���rD���rE���)�paths�split_pathsr ���re���rg����commonrO���r�����prefixr"���r$���s��� @@r4���r-���r-�����s�����������B��@�A�A�A��#�b�i��'�'�(�(�E��%��(�E�"�"�������������9�9�9�9�5�9�9�9�� P��5�5�5�5�u�5�5�5�5�5�F�E�E���� P�� P�� P��D�E�E�4�O� P�����Q�P�P�P�K�P�P�P�� �� � �� �� � �����b�M�M�� �� �D�A�q��B�q�E�z�z��B�Q�B���������*���3�r��r�7�������(�(�(�(���~�&��������$�\�:�E�:�:�:�:� ����s%���� D,��/B ��D,�� B(�(BD,��,%E)N)*�__doc__r"���r#���r(���r$���r%���r&���r'���r)���r9���r|���r\���rD����__all__r5���r���r ���r ���r���r ���rT���r���r���r���r���r���r���r���r����r����r����posixr����r���ru���r���r*���r����r}���r+���r,���r-���r����r6���r4����<module>r�������sL���� �� �� �� �� �� �� �� �� �� ��� � � � �� � � � ������������������������������������������������: �� �� �"7��7��7���(�0���� ���������������$��$��$�����������V6)��6)��6)�z���� �.��.��.�j0+�$�$�$�$�$�$�T+��+��+��+��Q���%��%��%�$��$��$��$��$�%����` �� �� ��"'�����������<��<��<�~�"�l�h�6���!��!��!��!�R#��#��#��#��#s����+A5��5B��?B�