+
    i                       ^ RI Ht ^ 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 ^ RIHt ^ RI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      ! ]P8                  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 R  lt$R! R" lt%R# R$ lt&R% R& lt'R# )'    )annotationsN)	Generator)contextmanager)Path)NamedTemporaryFile)AnyBinaryIOCallablecast)get_path_uid)format_size)retryc                    V ^8  d   QhRRRR/#    pathstrreturnbool )formats   "d/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_internal/utils/filesystem.py__annotate__r      s      3 4     c                   \         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)win32geteuidTNF)sysplatformhasattrosr   isabslexistsr   r   OSErroraccessW_OKdirname)r   previous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               $    V ^8  d   QhRRRRRR/# )r   r   r   kwargsr   r   zGenerator[BinaryIO, None, None]r   )r   s   "r   r   r   /   s"     & &C &3 &3R &r   c              +    "   \        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.
deleteFdirprefixsuffixz.tmpNr   )
r   r!   r   r'   basenamer   r	   flushfsyncfileno)r   r,   fresults   &,  r   adjacent_tmp_filer8   .   s      
 

GGOOD!
 ww%
 	

 
 
 
h"	&LLLNHHV]]_%
 
 LLNHHV]]_%
 
 
s6   AC:C&*B-.4C&#
C:-6C##C&&C7	1	C:g      ?)stop_after_delaywaitc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   L   s     ( (C (D (r   c                *   \         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.
posix)r!   r   isdirr'   namer%   r&   _test_writable_dir_win)r   parents   & r   test_writable_dirrB   L   sb     ggmmD!!&>	ww'yyrww''!$''r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   ^   s     I I I Ir   c                  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)(accesstest_deleteme_fishfingers_custard_$abcdefghijklmnopqrstuvwxyz0123456789 c              3  P   <"   T F  p\         P                  ! S4      x  K  	  R # 5iN)randomchoice).0_alphabets   & r   	<genexpr>)_test_writable_dir_win.<locals>.<genexpr>d   s     !L8a&--"9"98s   #&TFz3Unexpected condition testing for writable directory)rangejoinr!   r   openO_RDWRO_CREATO_EXCLcloseunlinkFileExistsErrorPermissionErrorr$   )r   r2   rM   r?   filefdrN   s   &     @r   r@   r@   ^   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               $    V ^8  d   QhRRRRRR/# )r   r   r   patternr   z	list[str]r   )r   s   "r   r   r   z   s!      S 3 9 r   c                   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  d   <"   T F%  p\         P                  P                  SV4      x  K'  	  R # 5irI   )r!   r   rR   )rL   r6   roots   & r   rO   find_files.<locals>.<genexpr>   s#     =Wbggll4++Ws   -0)r!   walkfnmatchfilterextend)r   r^   r7   rM   filesmatchesra   s   &&    @r   
find_filesri   z   sG     F''$-a..0=W== ( Mr   c                    V ^8  d   QhRRRR/# r   r   r   r   zint | floatr   )r   s   "r   r   r      s     ! !C !K !r   c                    \         P                  P                  V 4      '       d   ^ # \         P                  P                  V 4      # r   )r!   r   islinkgetsizer   s   &r   	file_sizerq      s+    	ww~~d77??4  r   c                    V ^8  d   QhRRRR/# r   r   r   r   r   )r   s   "r   r   r      s     ( (3 (3 (r   c                *    \        \        V 4      4      # rI   )r   rq   rp   s   &r   format_file_sizeru      s    y''r   c                    V ^8  d   QhRRRR/# rk   r   )r   s   "r   r   r      s        r   c                    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!   rc   r   rR   rq   )r   sizera   _dirsrg   filename	file_paths   &      r   directory_sizer|      sP    D ggdmUHT4IIi((D  , Kr   c                    V ^8  d   QhRRRR/# rs   r   )r   s   "r   r   r      s     - - - -r   c                *    \        \        V 4      4      # rI   )r   r|   rp   s   &r   format_directory_sizer      s    ~d+,,r   c               $    V ^8  d   QhRRRRRR/# )r   	directoryr   target_filer	   r   Noner   )r   s   "r   r   r      s&     	@ 	@# 	@H 	@ 	@r   c                   \         P                  ! V 4      P                  R ,          R,          p\         P                  \         P                  9   d(   \         P                  ! VP                  4       V4       R# \         P                  \         P                  9   d&   \         P                  ! VP                  VRR7       R# R# )i  i  F)follow_symlinksN)r!   statst_modechmodsupports_fdr5   supports_follow_symlinksr?   )r   r   modes   && r   copy_directory_permissionsr      s|    
	""U*
	 	
 
xx2>>!
##%t,	R00	0
!!4? 
1r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   	predicatez Callable[[str, list[str]], bool]r   Generator[Path]r   )r   s   "r   r   r      s$      
:r   c              #    "   . p\        4       p\        P                  ! \        V 4      P	                  4       4       Fh  w  rEp\        V4      pV! WF4      '       d9   VP                  \        VP                  4      RR 4       VP                  V4       VP                  V4       Kj  	  \        VRR7       F  pW9  g   K  Vx  K  	  R# 5i)zVYields every subdirectory of +path+ that has no files matching the
predicate under it.NT)reverse)setr!   rc   r   resolveupdatelistparentsaddappendsorted)	r   r   directoriesexcludedroot_strrM   	filenamesra   ds	   &&       r   _subdirs_without_genericr      s      KuH"$''$t**<*<*>"?YH~X)) OOD.s34LL4  #@ K.G /s   B9C
 
C
c                    V ^8  d   QhRRRR/# r   r   r   r   r   r   )r   s   "r   r   r      s     V V V Vr   c                    \        V R 4      # )z?Yields every subdirectory of +path+ that has no files under it.c                    \        V4      ^ 8  # rm   )lenra   r   s   &&r   <lambda>'subdirs_without_files.<locals>.<lambda>   s    #i.STBTr   r   rp   s   &r   subdirs_without_filesr      s    #D*TUUr   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r      s        r   c                    \        V R 4      # )zDYields every subdirectory of +path+ that has no .whl files under it.c                j    \         ;QJ d    R  V 4       F  '       g   K   R# 	  R# ! R  V 4       4      # )c              3  B   "   T F  qP                  R 4      x  K  	  R# 5i)z.whlN)endswith)rL   xs   & r   rO   ;subdirs_without_wheels.<locals>.<lambda>.<locals>.<genexpr>   s     )Pi**V*<*<is   TF)anyr   s   &&r   r   (subdirs_without_wheels.<locals>.<lambda>   s'    cc)Pi)Pcc&Pc&Pc)Pi)P&Pr   r   rp   s   &r   subdirs_without_wheelsr      s    #P r   )(
__future__r   rd   r!   os.pathrJ   r   collections.abcr   
contextlibr   pathlibr   tempfiler   typingr   r	   r
   r   pip._internal.utils.compatr   pip._internal.utils.miscr   pip._internal.utils.retryr   r*   r8   replacerB   r@   ri   rq   ru   r|   r   r   r   r   r   r   r   r   <module>r      s    "  	   
 % %  ' 0 0 3 0 +6 & &0 
.rzz
:
($I8!(-	@4V
r   