+
     hV  c                   s4   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
HtHtHtHtHt ^ RIHt ^ RIHt ^ RIHt R R	 lt]R
 R l4       t]! ^RR7      ! ]P0                  4      tR R ltR R ltR R ltR R ltR R ltR R ltR R ltR# )    N)contextmanager)NamedTemporaryFile)AnyBinaryIO	GeneratorListUnioncast)get_path_uid)format_size)retryc                0    V ^8  d   QhR\         R\        /#    pathreturnstrZboolZformat   "C/usr/lib/python3.14/site-packages/pip/_internal/utils/filesystem.py__annotate__r      s      3 4     c                 s   \         P                  R 8X  g   \        \        R4      '       g   R# \        P                  P                  V 4      '       g   Q hRpW8w  d   \        P                  P                  V 4      '       dQ   \        P                  ! 4       ^ 8X  d    \        V 4      pV^ 8H  # \        P                  ! V \        P                  4      # T \        P                  P                  V 4      rK  R#   \         d     R# i ; i)Zwin32geteuidTNF)sysZplatformZhasattrosr   ZisabsZlexistsr   r	   OSErroraccessW_OKdirname)r   ZpreviousZpath_uids   &  r   check_path_ownerr      s     ||wgb)&<&<77==H

77??4  zz|q !+D1H  1}$yyrww//!277??4#8d  ! !s   C6 6DDc          	      sX    V ^8  d   QhR\         R\        R\        \        RR3,          /# )r   r   kwargsr   N)r   r   r   r   r   r   r   r   r   +   s-     & &C &3 &9XtT=Q3R &r   c              +  s  "   \        RRRR\        P                  P                  V 4      R\        P                  P	                  V 4      RR/VB ;_uu_ 4       p\        \        V4      p Vx  VP                  4        \        P                  ! VP                  4       4        RRR4       R#   TP                  4        \        P                  ! TP                  4       4       i ; i  + '       g   i     R# ; i5i)	a  Return a file-like object pointing to a tmp file next to path.

The file is created securely and is ensured to be written to disk
after the context reaches its end.

kwargs will be passed to tempfile.NamedTemporaryFile to control
the way the temporary file will be opened.
ZdeleteFZdirZprefixZsuffixz.tmpN )
r   r   r   r   basenamer   r   ZflushZfsyncZfileno)r   r    fresults   &,  r   adjacent_tmp_filer%   *   s      
 

GGOOD!
 ww%
 	

 
 
 
h"	&LLLNHHV]]_%
 
 LLNHHV]]_%
 
 
s6   AC:C&*B-.4C&#
C:-6C##C&&C7	1	C:g      ?)Zstop_after_delayZwaitc                r   r   r   r   r   r   r   r   H   s     ( (C (D (r   c                s*   \         P                  P                  V 4      '       g+   \         P                  P                  V 4      pW8X  d   MTp KO  \         P                  R8X  d&   \         P
                  ! V \         P                  4      # \        V 4      # )z_Check if a directory is writable.

Uses os.access() on POSIX, tries creating files on Windows.
Zposix)r   r   Zisdirr   namer   r   _test_writable_dir_win)r   Zparents   & r   test_writable_dirr(   H   sb     ggmmD!!&>	ww'yyrww''!$''r   c                r   r   r   r   r   r   r   r   Z   s     I I I Ir   c                 s  a R pRo\        ^
4       F  pVRP                  V3R l\        ^4       4       4      ,           p\        P                  P                  W4      p \        P                  ! V\        P
                  \        P                  ,          \        P                  ,          4      p\        P                  ! V4       \        P                  ! V4        R# 	  \        R4      h  \         d     K  \         d      R# i ; i)Z(accesstest_deleteme_fishfingers_custard_Z$abcdefghijklmnopqrstuvwxyz0123456789Z c              3   sP   <"   T F  p\         P                  ! S4      x  K  	  R # 5iN)randomZchoice).0_alphabet   & r   	<genexpr>Z)_test_writable_dir_win.<locals>.<genexpr>`   s     !L8a&--"9"98s   #&TFz3Unexpected condition testing for writable directory)Zrangejoinr   r   ZopenZO_RDWRZO_CREATZO_EXCLZcloseZunlinkZFileExistsErrorZPermissionErrorr   )r   r"   r,   r&   ZfileZfdr-   s   &     @r   r'   r'   Z   s     :H5H2Y"''!L58!LLLww||D'	ryy2::5		ABB HHRLIIdO# ( G
HH  	 	 	s   AC**D8DDDc                sR    V ^8  d   QhR\         R\         R\        \         ,          /# )r   r   patternr   )r   r   r   r   r   r   r   v   s%      S 3 49 r   c                s   a . p\         P                  ! V 4       F7  w  or4\        P                  ! WA4      pVP	                  V3R lV 4       4       K9  	  V# )zReturns a list of absolute paths of files beneath path, recursively,
with filenames which match the UNIX-style shell glob pattern.c              3   sd   <"   T F%  p\         P                  P                  SV4      x  K'  	  R # 5ir)   )r   r   r0   )r+   r#   rootr.   r   r/   Zfind_files.<locals>.<genexpr>|   s#     =Wbggll4++Ws   -0)r   walkfnmatchZfilterZextend)r   r1   r$   r,   filesZmatchesr2   s   &&    @r   
find_filesr6   v   sG     F''$-a..0=W== ( Mr   c                R    V ^8  d   QhR\         R\        \        \        3,          /# r   r   r   ZintZfloatr   r   r   r   r      s#     ! !C !E#u*- !r   c                 s    \         P                  P                  V 4      '       d   ^ # \         P                  P                  V 4      # )r    )r   r   ZislinkZgetsizer      &r   	file_sizer;      s+    	ww~~d77??4  r   c                0    V ^8  d   QhR\         R\         /# r   r   r   r   r   r   r      s     ( (3 (3 (r   c                 *    \        \        V 4      4      # r)   )r
   r;   r9   r:   r   format_file_sizer?      s    y''r   c                r7   r   r8   r   r   r   r   r      s#       sEz!2 r   c                 s    R p\         P                  ! V 4       F@  w  r#pV F4  p\         P                  P                  W%4      pV\	        V4      ,          pK6  	  KB  	  V# )g        )r   r3   r   r0   r;   )r   Zsizer2   Z_dirsr5   ZfilenameZ	file_paths   &      r   directory_sizer@      sP    D ggdmUHT4IIi((D  , Kr   c                r<   r   r=   r   r   r   r   r      s     - - - -r   c                 r>   r)   )r
   r@   r9   r:   r   format_directory_sizerA      s    ~d+,,r   ) r4   r   Zos.pathr*   r   Z
contextlibr   Ztempfiler   Ztypingr   r   r   r   r   r   Zpip._internal.utils.compatr	   Zpip._internal.utils.miscr
   Zpip._internal.utils.retryr   r   r%   Zreplacer(   r'   r6   r;   r?   r@   rA   r!   r   r   <module>rB      s}     	   
 % ' > > 3 0 +6 & &0 
.rzz
:
($I8!(-r   