
    F\h                     <   S r SSKrSSKrSSKrSSKJr  \" \\	   5      r
\R                  r/ SQrS rS rS\;   aI  SrSrSS	K7   SS
KJr  \R)                  S5        SSKr SSKJr  SSKr\R3                  \" \5      5        COWS\;   aI  SrSrSS	K7   SS
KJr  \R)                  S5        SSKrSSKr\R3                  \" \5      5        C SSKJr  O\" S5      e\\R8                  S'   SSKJrJrJ r J!r!J"r"J#r#J$r$J%r%  C\" S5      (       Ga  \&" 5       r'S r(\)" 5       r*\(" SS5        \(" SS5        \(" SS5        \(" SS5        \(" SS5        \(" SS5        \(" S S!5        \(" S"S#5        \(" S$S%5        \(" S&S'5        \(" S(S)5        \(" S*S+5        \(" S,S-5        \(" S.S/5        \(" S0S15        \(" S0S25        \(" S3S5        \*r+\)" 5       r*\(" SS5        \*r,\)" 5       r*\(" S4S55        \(" S6S5        \(" S7S5        \(" S8S5        \(" S9S:5        \(" S9S;5        \(" S<S=5        \*R[                  \5        \(" S>S?5        \(" S@S5        \(" SAS5        \(" SBSC5        \" SD5      (       a  \" SE5      (       a	  \(" SFSD5        \*r.\)" 5       r*\(" SS5        \(" SS5        \(" SS5        \(" SGSH5        \(" SIS5        \(" S7S5        \" SJ5      (       a	  \(" SKS5        \(" S S!5        \(" SLS5        \(" SS5        \(" SS5        \(" S3S5        \(" S7S5        \*r/C*CC'C(Sr0SMr1SNr2SSP jr3SQ r4SR r5\R3                  / SSQ5        \6" 5       r7SST jr8\R)                  SU5        \9\1\+::  a,  \:\1\.::  a$  SSOSSV.SW jjr;Sr<SMr=SNr>SX r?\R)                  SY5        SZ r@S[ rAS\ rBS] rCS^ rDS_ rE\R3                  / S`Q5        SSa jrFSSb jrGSScKJHrHJIrI   " Sd Se\H5      rJSf rK\K" 5       rLCKSSg jrM\S:g  rN\R3                  Sh5        \N(       a0  Si rO\J" \LR                  \O\Q\O\Q5      rRCOSSj jrS\R3                  Sk5        Sl rT\T" 5       u  rUrVCT\" Sm5      (       aU  \" Sn5      (       dH  \" So5      (       a;  SrWSM=rXrY\R3                  / SpQ5        Sq rZSr r[Ss r\St r]Su r^\R3                  / SvQ5        \" Sn5      (       a  Sw r_Sx r`\R3                  SySz/5        \" S{5      (       a  S| raS} rb\R3                  S~S/5        \R                  S:w  a   SS jrd " S S5      re\R)                  S5        SS jrfS rg\" S5      (       d	  \grhS\hli         " S S\R                  5      rk\S:X  a   " S S5      rlS rm\" S5      (       a  \R                  " 5       S:  a  S rog\prog! \ a     GNf = f! \ a     GNf = f! \ a     GNf = f! \ a     GNf = f)aN  OS routines for NT or Posix depending on what system we're on.

This exports:
  - all functions from posix or nt, e.g. unlink, stat, etc.
  - os.path is either posixpath or ntpath
  - os.name is either 'posix' or 'nt'
  - os.curdir is a string representing the current directory (always '.')
  - os.pardir is a string representing the parent directory (always '..')
  - os.sep is the (or a most common) pathname separator ('/' or '\\')
  - os.extsep is the extension separator (always '.')
  - os.altsep is the alternate pathname separator (None or '/')
  - os.pathsep is the component separator used in $PATH etc
  - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
  - os.defpath is the default search path for executables
  - os.devnull is the file path of the null device ('/dev/null', etc.)

Programs that import and use 'os' stand a better chance of being
portable between different platforms.  Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
    N)_check_methods)altsepcurdirpardirseppathseplinesepdefpathnamepathdevnullSEEK_SETSEEK_CURSEEK_ENDfsencodefsdecodeget_exec_pathfdopenextsepc                     U [        5       ;   $ N)globals)r   s    /usr/lib/python3.13/os.py_existsr   )   s    79    c                      [        U R                  5      $ ! [         a/    [        U 5       Vs/ s H  oS   S:w  d  M  UPM     Os  snf sns $ f = f)Nr   _)list__all__AttributeErrordir)modulens     r   _get_exports_listr$   ,   sF    7FNN## 7v;6;aA$#+;667s    AAA	AAposix
)*)_exitr(   )_have_functionsntz
zno os specific module foundzos.path)r   r   r   r   r
   r   r   r   r)   c                 h    U[         ;   a(  U [        ;   a  [        R                  [         U   5        g g g r   )_globalsr)   _setadd)strfns     r   _addr1   h   s'    (N!7HHXb\" "8Nr   HAVE_FACCESSATaccessHAVE_FCHMODATchmodHAVE_FCHOWNATchownHAVE_FSTATATstat
HAVE_LSTATlstatHAVE_FUTIMESATutimeHAVE_LINKATlinkHAVE_MKDIRATmkdirHAVE_MKFIFOATmkfifoHAVE_MKNODATmknodHAVE_OPENATopenHAVE_READLINKATreadlinkHAVE_RENAMEATrenameHAVE_SYMLINKATsymlinkHAVE_UNLINKATunlinkrmdirHAVE_UTIMENSATHAVE_FCHDIRchdirHAVE_FCHMOD
MS_WINDOWSHAVE_FCHOWNHAVE_FDOPENDIRlistdirscandirHAVE_FEXECVEexecveHAVE_FTRUNCATEtruncateHAVE_FUTIMENSHAVE_FUTIMESHAVE_FPATHCONFpathconfstatvfsfstatvfsHAVE_FSTATVFSHAVE_LCHFLAGSchflagsHAVE_LCHMODlchownHAVE_LCHOWNHAVE_LUTIMES      Fc                    [         R                  " U 5      u  p4U(       d  [         R                  " U5      u  p4U(       a]  U(       aV  [         R                  " U5      (       d;   [        X2S9  [
        n[        U[        5      (       a  [        [
        S5      nXE:X  a  g [        X5        g! [         a     NJf = f! [         a&    U(       a  [         R                  " U 5      (       d  e  gf = f)as  makedirs(name [, mode=0o777][, exist_ok=False])

Super-mkdir; create a leaf directory and all intermediate ones.  Works like
mkdir, except that any intermediate path segment (not just the rightmost)
will be created if it does not exist. If the target directory already
exists, raise an OSError if exist_ok is False. Otherwise no exception is
raised.  This is recursive.

)exist_okASCIIN)r   splitexistsmakedirsFileExistsErrorr   
isinstancebytesrA   OSErrorisdir)r   modern   headtailcdirs         r   rr   rr      s     D!JDZZ%
T[[..	T- dE"")D<d  		   tzz$//  0s$   "	B) B9 )
B65B69-C)(C)c                 2   [        U 5        [        R                  " U 5      u  pU(       d  [        R                  " U5      u  pU(       a>  U(       a6   [        U5        [        R                  " U5      u  pU(       a
  U(       a  M4  gggg! [         a     gf = f)a  removedirs(name)

Super-rmdir; remove a leaf directory and all empty intermediate
ones.  Works like rmdir except that, if the leaf directory is
successfully removed, directories corresponding to rightmost path
segments will be pruned away until either the whole path is
consumed or an error occurs.  Errors during this latter phase are
ignored -- they generally mean that a directory was not empty.

N)rP   r   rp   rv   )r   ry   rz   s      r   
removedirsr}      st     
$KD!JDZZ%

4	$K ZZ%
 44$4$  		s   B	 	
BBc                 :   [         R                  " U5      u  p#U(       a-  U(       a&  [         R                  " U5      (       d  [        U5        [	        X5        [         R                  " U 5      u  p#U(       a  U(       a   [        U5        ggg! [         a     gf = f)a  renames(old, new)

Super-rename; create directories as necessary and delete any left
empty.  Works like rename, except creation of any intermediate
directories needed to make the new pathname good is attempted
first.  After the rename, directories corresponding to rightmost
path segments of the old name will be pruned until either the
whole path is consumed or a nonempty directory is found.

Note: this function can fail with the new directory structure made
if you lack permissions needed to unlink the leaf directory or
file.

N)r   rp   rq   rr   rK   r}   rv   )oldnewry   rz   s       r   renamesr     sq     CJDT[[..
3CJD	t t  		s   ?B 
BB)rr   r}   r   c              #   V  #    [         R                  " SXX#5        [        U 5      /n[        R                  [        R
                  peU(       Ga)  UR                  5       n [        U [        5      (       a  U v   M3  / n/ n/ n	 [        U 5      n
SnU
      [        U
5      n U[        L a,  UR                  SS9=(       a    UR                  5       (       + nOUR                  5       n U(       a  UR!                  UR"                  5        OUR!                  UR"                  5        U(       dK  U(       aD  U(       a  SnO UR%                  5       nU(       + nU(       a  U	R!                  UR                  5        M  g! [         a  nUb  U" U5         SnAGMN  SnAff = f! [         a     OLf = f! [         a  nUb  U" U5        Sn SnAO,SnAff = f! [         a    Sn Nf = f! [         a    Sn Nf = fSSS5        O! , (       d  f       O= fU(       a  GM  U(       aI  XU4v   ['        U5       H3  nU" U U5      nU(       d  U" U5      (       a  M"  UR!                  U5        M5     O6UR!                  XU45        ['        U	5       H  nUR!                  U5        M     U(       a  GMZ  g7f)a
  Directory tree generator.

For each directory in the directory tree rooted at top (including top
itself, but excluding '.' and '..'), yields a 3-tuple

    dirpath, dirnames, filenames

dirpath is a string, the path to the directory.  dirnames is a list of
the names of the subdirectories in dirpath (including symlinks to directories,
and excluding '.' and '..').
filenames is a list of the names of the non-directory files in dirpath.
Note that the names in the lists are just names, with no path components.
To get a full path (which begins with top) to a file or directory in
dirpath, do os.path.join(dirpath, name).

If optional arg 'topdown' is true or not specified, the triple for a
directory is generated before the triples for any of its subdirectories
(directories are generated top down).  If topdown is false, the triple
for a directory is generated after the triples for all of its
subdirectories (directories are generated bottom up).

When topdown is true, the caller can modify the dirnames list in-place
(e.g., via del or slice assignment), and walk will only recurse into the
subdirectories whose names remain in dirnames; this can be used to prune the
search, or to impose a specific order of visiting.  Modifying dirnames when
topdown is false has no effect on the behavior of os.walk(), since the
directories in dirnames have already been generated by the time dirnames
itself is generated. No matter the value of topdown, the list of
subdirectories is retrieved before the tuples for the directory and its
subdirectories are generated.

By default errors from the os.scandir() call are ignored.  If
optional arg 'onerror' is specified, it should be a function; it
will be called with one argument, an OSError instance.  It can
report the error to continue with the walk, or raise the exception
to abort the walk.  Note that the filename is available as the
filename attribute of the exception object.

By default, os.walk does not follow symbolic links to subdirectories on
systems that support them.  In order to get this functionality, set the
optional argument 'followlinks' to true.

Caution:  if you pass a relative pathname for top, don't change the
current working directory between resumptions of walk.  walk never
changes the current directory, and assumes that the client doesn't
either.

Example:

import os
from os.path import join, getsize
for root, dirs, files in os.walk('python/Lib/xml'):
    print(root, "consumes ")
    print(sum(getsize(join(root, name)) for name in files), end=" ")
    print("bytes in", len(files), "non-directory files")
    if '__pycache__' in dirs:
        dirs.remove('__pycache__')  # don't visit __pycache__ directories

zos.walkNFTfollow_symlinks)sysauditfspathr   islinkjoinpoprt   tuplerY   rv   nextStopIteration_walk_symlinks_as_filesis_diris_junctionappendr   
is_symlinkreversed)toptopdownonerrorfollowlinksstackr   r   dirsnondirs	walk_dirs
scandir_iterrorcontentryr   	walk_intor   dirnamenew_paths                      r   walkr   !  sQ    x IIiw<C[ME;;		D
iikc5!!I		 J 	 $Z 0#"&==!&e!D!`UM^M^M`I`!& KK

+NN5::.6 #$(	/).)9)9);J )3N	 !((4W 1 "  	"	 )  *D	  # #F#$  ' / */J	/I ZZZ W$$#D>W-
 fX&6&6LL* * LL#W-.$Y/X& 0o %s   A=J) E8 J)G=F4GG=G$AG=<G"+G=7J)8
FFJ)FJ)
F)&F,'G=(F))F,,
G6GG=GG=GG=GG="G1.G=0G11G=4	J)=
HAJ)AJ)(J)r   r   dir_fdc             #     #    [         R                  " SXX#U5        [        U 5      n [        SX@U S44/n[	        U [
        5      n U(       a  [        XVXU5       Sh  vN   U(       a  M  U(       a1  UR                  5       u  pxU[        :X  a  [        U5        U(       a  M0  gg NF! U(       a1  UR                  5       u  pxU[        :X  a  [        U5        U(       a  M0  f f = f7f)a`  Directory tree generator.

This behaves exactly like walk(), except that it yields a 4-tuple

    dirpath, dirnames, filenames, dirfd

`dirpath`, `dirnames` and `filenames` are identical to walk() output,
and `dirfd` is a file descriptor referring to the directory `dirpath`.

The advantage of fwalk() over walk() is that it's safe against symlink
races (when follow_symlinks is False).

If dir_fd is not None, it should be a file descriptor open to a directory,
  and top should be relative; top will then be relative to that directory.
  (dir_fd is always supported for fwalk.)

Caution:
Since fwalk() yields file descriptors, those are only valid until the
next iteration step, so you should dup() them if you want to keep them
for a longer period.

Example:

import os
for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):
    print(root, "consumes", end="")
    print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files),
          end="")
    print("bytes in", len(files), "non-directory files")
    if '__pycache__' in dirs:
        dirs.remove('__pycache__')  # don't visit __pycache__ directories
zos.fwalkTN)
r   r   r   _fwalk_walkrt   ru   _fwalkr   _fwalk_closeclose)	r   r   r   r   r   r   isbytesactionvalues	            r   fwalkr     s     B 			*cGfMSkf3=>?S%(	!!%'OTTT %  %		\)%L % U  %		\)%L %s<   AC"B% B#B% *5C"!C"#B% %6CCC"c           
   #   V  ^^#    U R                  5       u  pVU[        :X  a  [        U5        g U[        :X  a  Uv   g U[        :X  d   eUu  pxmp U(       d  U
c  [        U	SUS9nOU
R                  SS9n[        U	[        [        -  US9mU R                  [        T45        U(       dS  U(       a&  [        R                  " WR                  5      (       d  g [        R                  " W[        T5      5      (       d  g [!        T5      n/ n/ nU(       d  U(       a  S O/ nU Hq  n
U
R"                  nU(       a  [%        U5      n U
R'                  5       (       a)  UR                  U5        Ub  UR                  U
5        M^  M`  UR                  U5        Ms     U(       a  TXT4v   OU R                  [        TXT445        [        R*                  " TTS S 5      mUc#  U R-                  UU4S jUS S S2    5       5        g U R-                  UU4S j[/        US S S2   US S S2   5       5       5        g ! [         a  nU(       a  e Ub  U" U5         S nAg S nAff = f! [         aC     U
R)                  5       (       a  UR                  U5         GMp   GMt  ! [         a      GM  f = ff = f7f)	NFr   r   )r   r   c              3   D   >#    U  H  n[         S TTU-   US44v   M     g7fFNr   ).0r   topfdtoppaths     r   	<genexpr>_fwalk.<locals>.<genexpr>5  s,      (&D ueWt^T4HI&s    c              3   F   >#    U  H  u  p[         S TTU-   X44v   M     g7fr   r   )r   r   r   r   r   s      r   r   r   9  s-      C#AKD ueWt^TIJ#As   !)r   r   r   _fwalk_yieldr   r9   rG   O_RDONLY
O_NONBLOCKrv   r   stS_ISDIRst_moder   samestatrY   r   r   r   r   r   extendzip)r   r   r   r   r   r   r   isrootdirfdtopnamer   orig_sterrr   r   r   entriesr   r   r   s                     @@r   r   r     sb    
 		\!%L|#K$$$16.w	" ="7E%PG#jjj?G(Z"7FE 	lE*+bjj99==$u+66U^
!_$"E::D~<<>>KK%*u- + NN4(  & 4%//LL,$(GHI))GWRa[1?LL ( 2J( ( LL C#&tDbDz74R4=#AC C_  	"	8  ''))t,, * s   A
J);H/ 
B5J) :I:J)>IB J)/
I9IJ)IJ)
J&$&J
J)
J"J&J)!J""J&&J)r   c                     [        X5        g)zhexecl(file, *args)

Execute the executable file with argument list args, replacing the
current process. N)execvfileargss     r   execlr   ?  s    
 
$r   c                 ,    US   n[        XSS U5        g)zexecle(file, *args, env)

Execute the executable file with argument list args and
environment env, replacing the current process. r   N)r[   r   r   envs      r   execler   F  s    
 r(C
4crC r   c                     [        X5        g)zexeclp(file, *args)

Execute the executable file (which is searched for along $PATH)
with argument list args, replacing the current process. N)execvpr   s     r   execlpr   N  s    
 4r   c                 ,    US   n[        XSS U5        g)zexeclpe(file, *args, env)

Execute the executable file (which is searched for along $PATH)
with argument list args and environment env, replacing the current
process. r   N)execvper   s      r   execlper   U  s     r(CDs)S!r   c                     [        X5        g)zexecvp(file, args)

Execute the executable file (which is searched for along $PATH)
with argument list args, replacing the current process.
args may be a list or tuple of strings. N_execvper   s     r   r   r   ^  s     Tr   c                     [        XU5        g)zexecvpe(file, args, env)

Execute the executable file (which is searched for along $PATH)
with argument list args and environment env, replacing the
current process.
args may be a list or tuple of strings. Nr   r   s      r   r   r   f  s     Tr   )r   r   r   r   r   r   c                    Ub
  [         nX4nO[        nU4n[        n[        R                  " U 5      (       a
  U" U /UQ76   g S n[        U5      n[        S:w  a  [        U 5      n [        [        U5      nU H#  n[        R                  " Xp5      n U" U/UQ76   M%     Ub  UeW
e! [        [        4 a  n	U	n
 S n	A	MF  S n	A	f[         a  n	U	n
Uc  U	n S n	A	M`   S n	A	Mf  S n	A	ff = f)Nr*   )r[   r   environr   r   r   r   r   mapr   FileNotFoundErrorNotADirectoryErrorrv   )r   r   r   	exec_funcargrest	saved_exc	path_listr!   fullnameelast_excs              r   r   r   q  s    
	+	'||D$!!Ic"It|~),	99S'	h))  
N "#56 	H 	H 	 !	s$   	B$$C!4B<<C!	CC!c                    SSK nU c  [        n UR                  5          UR                  S[        5         U R                  S5      n[        (       a9   U S   nUb  [        S5      eUnUb   [        U[        5      (       a  [        U5      nSSS5        Wc  [        nUR                  [        5      $ ! [         a    Sn Nxf = f! [        [        4 a     Nmf = f! , (       d  f       NT= f)zReturns the sequence of directories that will be searched for the
named executable (similar to a shell) when launching a process.

*env* must be an environment variable dict or None.  If *env* is None,
os.environ will be used.
r   NignorePATHs   PATHz*env cannot contain 'PATH' and b'PATH' keys)warningsr   catch_warningssimplefilterBytesWarningget	TypeErrorsupports_bytes_environ
ValueErrorKeyErrorrt   ru   r   r
   rp   r   )r   r   r   
path_listbs       r   r   r     s     
{ 
	 	 	"h5	I "!' \
 ($DF F&	$Iu)E)E$Y/	) 
#, 	??7##'  	I	 i(  
#	"sR   CB1CC3C1C =C?C  CCCCC
C')MutableMappingMappingc                   \    \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rSrg)_Environi  c                 @    X l         X0l        X@l        XPl        Xl        g r   )	encodekey	decodekeyencodevaluedecodevalue_data)selfdatar   r   r   r   s         r   __init___Environ.__init__  s    ""&&
r   c                      U R                   U R                  U5         nU R                  U5      $ ! [         a    [        U5      S ef = fr   )r   r   r   r   r   keyr   s      r   __getitem___Environ.__getitem__  sN    	*JJt~~c23E &&  	*3-T)	*s	   1 Ac                 z    U R                  U5      nU R                  U5      n[        X5        X R                  U'   g r   )r   r   putenvr   r  s      r   __setitem___Environ.__setitem__  s3    nnS!  's

3r   c                     U R                  U5      n[        U5         U R                  U	 g ! [         a    [        U5      S ef = fr   )r   unsetenvr   r   )r   r  
encodedkeys      r   __delitem___Environ.__delitem__  sD    ^^C(
	*

:& 	*3-T)	*s	   , Ac              #   n   #    [        U R                  5      nU H  nU R                  U5      v   M     g 7fr   )r   r   r   )r   keysr  s      r   __iter___Environ.__iter__  s,     DJJC..%% s   35c                 ,    [        U R                  5      $ r   )lenr   r   s    r   __len___Environ.__len__  s    4::r   c                 v   ^  SR                  U 4S jT R                  R                  5        5       5      nSU S3$ )Nz, c              3   v   >#    U  H.  u  pTR                  U5      < S TR                  U5      < 3v   M0     g7f)z: N)r   r   )r   r  r   r   s      r   r   $_Environ.__repr__.<locals>.<genexpr>  s;      $
0
 ~~c"%R(8(8(?'BC0s   69z	environ({z}))r   r   items)r   formatted_itemss   ` r   __repr___Environ.__repr__  s=    )) $
"jj..0$
 
 O,C00r   c                     [        U 5      $ r   )dictr  s    r   copy_Environ.copy  s    Dzr   c                     X;  a  X U'   X   $ r    r  s      r   
setdefault_Environ.setdefault  s    ?Iyr   c                 (    U R                  U5        U $ r   )update)r   others     r   __ior___Environ.__ior__  s    Er   c                 t    [        U[        5      (       d  [        $ [        U 5      nUR	                  U5        U$ r   rt   r   NotImplementedr#  r+  r   r,  r   s      r   __or___Environ.__or__  s/    %))!!4j

5
r   c                 t    [        U[        5      (       d  [        $ [        U5      nUR	                  U 5        U$ r   r0  r2  s      r   __ror___Environ.__ror__  s/    %))!!5k

4
r   )r   r   r   r   r   N)__name__
__module____qualname____firstlineno__r  r  r  r  r  r  r   r$  r(  r-  r3  r6  __static_attributes__r'  r   r   r   r     s>    ' *&1
r   r   c                     ^^ [         S:X  a;  S n U m[        nU4S jn0 n[        R                  5        H  u  pEXSU" U5      '   M     O)[        R
                  " 5       mU4S jmU4S jnTn[        n[        UX!TU5      $ )Nr*   c                 r    [        U [        5      (       d!  [        S[        U 5      R                  -  5      eU $ )Nstr expected, not %s)rt   r/   r   typer8  r   s    r   	check_str!_createenviron.<locals>.check_str  s/    eS)) 6e9M9M MNNLr   c                 0   > T" U 5      R                  5       $ r   )upper)r  encodes    r   r   !_createenviron.<locals>.encodekey  s    #;$$&&r   c                    > [        U [        5      (       d!  [        S[        U 5      R                  -  5      eU R                  TS5      $ )Nr?  surrogateescape)rt   r/   r   r@  r8  rF  r   encodings    r   rF  _createenviron.<locals>.encode  s=    eS)) 6e9M9M MNN<<*;<<r   c                 (   > U R                  TS5      $ )NrI  )decoderJ  s    r   rN  _createenviron.<locals>.decode  s    <<*;<<r   )r   r/   r   r  r   getfilesystemencodingr   )rB  rN  r   r  r  r   rF  rK  s         @@r   _createenvironrQ  	  s~    t|	 	'!--/JC#(3  * ,,.	=	=	D r   c                 ,    [         R                  X5      $ )zGet an environment variable, return None if it doesn't exist.
The optional second argument can specify an alternate default.
key, default and the result are str.)r   r   r  defaults     r   getenvrU  +  s     ;;s$$r   )rU  r   c                 r    [        U [        5      (       d!  [        S[        U 5      R                  -  5      eU $ )Nzbytes expected, not %s)rt   ru   r   r@  r8  rA  s    r   _check_bytesrW  5  s/    %''4tE{7K7KKLLr   c                 ,    [         R                  X5      $ )zGet an environment variable, return None if it doesn't exist.
The optional second argument can specify an alternate default.
key, default and the result are bytes.)environbr   rS  s     r   getenvbrZ  @  s     ||C))r   )rY  rZ  c                  |   ^^ [         R                  " 5       m[         R                  " 5       mUU4S jn UU4S jnX4$ )Nc                 l   > [        U 5      n [        U [        5      (       a  U R                  TT5      $ U $ )zEncode filename (an os.PathLike, bytes, or str) to the filesystem
encoding with 'surrogateescape' error handler, return bytes unchanged.
On Windows, use 'strict' error handler if the file system encoding is
'mbcs' (which is the default encoding).
)r   rt   r/   rF  filenamerK  errorss    r   r   _fscodec.<locals>.fsencodeL  s2     (#h$$??8V44Or   c                 l   > [        U 5      n [        U [        5      (       a  U R                  TT5      $ U $ )zDecode filename (an os.PathLike, bytes, or str) from the filesystem
encoding with 'surrogateescape' error handler, return str unchanged. On
Windows, use 'strict' error handler if the file system encoding is
'mbcs' (which is the default encoding).
)r   rt   ru   rN  r]  s    r   r   _fscodec.<locals>.fsdecodeX  s2     (#h&&??8V44Or   )r   rP  getfilesystemencodeerrors)r   r   rK  r_  s     @@r   _fscodecrd  H  s4    ((*H**,F

 r   forkspawnvr   )P_WAITP_NOWAIT	P_NOWAITOc                 j   [        U[        [        45      (       d  [        S5      eU(       a
  US   (       d  [	        S5      e[        5       nU(       d   Uc	  U" X5        g U" XU5        g U [        :X  a  U$  [        US5      u  pg[        U5      (       a  M!  [        U5      $ !   [        S5         g = f)Nzargv must be a tuple or a listr   z"argv first element cannot be empty   )rt   r   r   r   r   re  r(   rh  waitpid
WIFSTOPPEDwaitstatus_to_exitcode)rx   r   r   r   funcpidwpidstss           r   	_spawnvefrs  u  s    $..<==47ABBf;$S)
 x
#CO	c??-c22c
s   B# !	B# #B2c                 &    [        XUS[        5      $ )a  spawnv(mode, file, args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rs  r   rx   r   r   s      r   rf  rf    s     T477r   c                 $    [        XX#[        5      $ )a:  spawnve(mode, file, args, env) -> integer

Execute file with arguments from args in a subprocess with the
specified environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rs  r[   rx   r   r   r   s       r   spawnverx    s     T77r   c                 &    [        XUS[        5      $ )a8  spawnvp(mode, file, args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rs  r   ru  s      r   spawnvprz    s     T488r   c                 $    [        XX#[        5      $ )a\  spawnvpe(mode, file, args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rs  r   rw  s       r   spawnvper|    s     T88r   )rf  rx  rz  r|  c                     [        XU5      $ )a  spawnl(mode, file, *args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rf  ru  s      r   spawnlr~    s     d$''r   c                 ,    US   n[        XUSS U5      $ )a:  spawnle(mode, file, *args, env) -> integer

Execute file with arguments from args in a subprocess with the
supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r   N)rx  rw  s       r   spawnler    s"     2ht49c22r   r~  r  rz  c                     [        XU5      $ )aW  spawnlp(mode, file, *args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rz  ru  s      r   spawnlpr    s     t4((r   c                 ,    US   n[        XUSS U5      $ )a]  spawnlpe(mode, file, *args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r   N)r|  rw  s       r   spawnlper    s"     2hD"Is33r   r  r  vxworksc                    [        U [        5      (       d  [        S[        U 5      -  5      eUS;  a  [	        SU-  5      eUS:X  d  Uc  [	        S5      eSS KnUS:X  a3  UR                  U SSUR                  US9n[        UR                  U5      $ UR                  U SSUR                  US	9n[        UR                  U5      $ )
Nz&invalid cmd type (%s, expected string))rwzinvalid mode %rr   z+popen() does not support unbuffered streamsr  T)shelltextstdoutbufsize)r  r  stdinr  )rt   r/   r   r@  r   
subprocessPopenPIPE_wrap_closer  r  )cmdrx   	bufferingr  procs        r   popenr    s    #s##DtCyPQQz!.566>Y.JKK3;##C*.T+5??,5 $ 7D t{{D11##C*.T*4//,5 $ 7D tzz400r   c                   8    \ rS rSrS rS rS rS rS rS r	Sr
g	)
r  i  c                     Xl         X l        g r   )_stream_proc)r   streamr  s      r   r  _wrap_close.__init__  s    !LJr   c                     U R                   R                  5         U R                  R                  5       nUS:X  a  g [        S:X  a  U$ US-  $ )Nr   r*      )r  r   r  waitr   )r   
returncodes     r   r   _wrap_close.close  sC    LL *JQt|!!!Q&r   c                     U $ r   r'  r  s    r   	__enter___wrap_close.__enter__      Kr   c                 $    U R                  5         g r   r   r   r   s     r   __exit___wrap_close.__exit__      JJLr   c                 .    [        U R                  U5      $ r   )getattrr  )r   r   s     r   __getattr___wrap_close.__getattr__  s    4<<..r   c                 ,    [        U R                  5      $ r   )iterr  r  s    r   r  _wrap_close.__iter__!  s    %%r   )r  r  N)r8  r9  r:  r;  r  r   r  r  r  r  r<  r'  r   r   r  r    s     		'			/	&r   r  r  c                     [        U [        5      (       d  [        S[        U 5      -  5      eSS KnSU;  a  UR                  U5      nUR                  " XX#/UQ70 UD6$ )Nz&invalid fd type (%s, expected integer)r   b)rt   intr   r@  iotext_encodingrG   )fdrx   r  rK  r   kwargsr  s          r   r   r   '  sY    b#@48KLL
$##H-772YB4B6BBr   c                    [        U [        [        45      (       a  U $ [        U 5      n UR	                  U 5      n[        U[        [        45      (       a  U$ [        SR                  UR                  [        U5      R                  5      5      e! [
         a+    [        US5      (       a  e [        SUR                  -   5      e[         a(    UR                  c  [        SUR                  -   5      See f = f)aM  Return the path representation of a path-like object.

If str or bytes is passed in, it is returned unchanged. Otherwise the
os.PathLike interface is used to get the path representation. If the
path representation is not str or bytes, TypeError is raised. If the
provided path is not str, bytes, or os.PathLike, TypeError is raised.

__fspath__z/expected str, bytes or os.PathLike object, not Nz7expected {}.__fspath__() to return str or bytes, not {})
rt   r/   ru   r@  r  r    hasattrr   r8  format)r   	path_type	path_reprs      r   _fspathr  2  s    $e%% T
I((.	 )c5\** !!'	(:(:(,Y(@(@"BC 	C  99l++ #%.%7%78 9 9 ' #%.%7%78 9>BC s   B A%C5r   c                   `    \ rS rSrSrSr\R                  S 5       r\	S 5       r
\	" \5      rSrg)PathLikei\  zCAbstract base class for implementing the file system path protocol.r'  c                     [         e)z9Return the file system path representation of the object.)NotImplementedErrorr  s    r   r  PathLike.__fspath__b  s
     "!r   c                 8    U [         L a  [        US5      $ [        $ )Nr  )r  r   r1  )clssubclasss     r   __subclasshook__PathLike.__subclasshook__g  s    (?!(L99r   N)r8  r9  r:  r;  __doc__	__slots__abcabstractmethodr  classmethodr  GenericAlias__class_getitem__r<  r'  r   r   r  r  \  sC    MI" "  
 $L1r   r  c                   2    \ rS rSrS rS rS rS rS rSr	g)	_AddedDllDirectoryiq  c                 (    Xl         X l        X0l        g r   )r   _cookie_remove_dll_directory)r   r   cookieremove_dll_directorys       r   r  _AddedDllDirectory.__init__r  s    I!L)=&r   c                 H    U R                  U R                  5        S U l        g r   )r  r  r   r  s    r   r   _AddedDllDirectory.closev  s    &&t||4DIr   c                     U $ r   r'  r  s    r   r  _AddedDllDirectory.__enter__y  r  r   c                 $    U R                  5         g r   r  r  s     r   r  _AddedDllDirectory.__exit__{  r  r   c                 \    U R                   (       a  SR                  U R                   5      $ g)Nz<AddedDllDirectory({!r})>z<AddedDllDirectory()>)r   r  r  s    r   r   _AddedDllDirectory.__repr__}  s!    yy299$))DD*r   )r  r  r   N)
r8  r9  r:  r;  r  r   r  r  r   r<  r'  r   r   r  r  q  s    	>				+r   r  c                 \    SSK nUR                  " U 5      n[        U UUR                  5      $ )a  Add a path to the DLL search path.

This search path is used when resolving dependencies for imported
extension modules (the module itself is resolved through sys.path),
and also by ctypes.

Remove the directory by calling close() on the returned object or
using it in a with statement.
r   N)r*   _add_dll_directoryr  r  )r   r*   r  s      r   add_dll_directoryr    s3     	&&t,!$$
 	
r   sched_getaffinityc                  *    [        [        S5      5      $ )z
Get the number of CPUs of the current process.

Return the number of logical CPUs usable by the calling thread of the
current process. Return None if indeterminable.
r   )r  r  r'  r   r   process_cpu_countr    s     $Q'((r   )i  F)TNF).TNr   )r  r   )r  r   N)qr  r  r   r9   r   _collections_abcr   r@  r   r  r  builtin_module_names_namesr   r   r$   r   r	   r%   r(   r   ImportError	posixpathr   r)   r   r*   ntpathmodulesos.pathr   r   r   r   r
   r   r   r   r   r,   r1   setr-   supports_dir_fdsupports_effective_idsr.   supports_fdsupports_follow_symlinksr   r   r   rr   r}   r   objectr   r   rG   rY   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rQ  r   rU  r   rW  r   ru   rY  rZ  rd  r   r   rg  rh  ri  rs  rf  rx  rz  r|  r~  r  r  r  platformr  r  r   r  r   r8  ABCr  r  r  _get_cpu_count_configr  	cpu_countr'  r   r   <module>r     sg  0  
  +DI		!	!
7 fDGw ) NN$U+,	V^DGw NN$R()
&
 3
44I     yH# 5D	H%G$G$F#G$	G$F#G$H%G$F#	J'H%	I&H%G$	G$O5D	H%!5DG$G$G$G$	I&	I&H%HHTN	J'G$G$	J'ygj11_i(K5D	H%, 	G$F#I&G$G$x]G$F#G$F#F#	G$F## 
@&,4 4 5 !( X't v $<?"+'E-!eTX -!` KLLHCT NN7!" G H@)$Z 5G~ GR< 
% $,  3 4 eeH 	* NN*+< Z ( 6??78,,1A1AFHyNN67368899 NN?@ 8(	3 NNHi() 9)	4 NNIz*+ <<91,& &, NN7C!CJ xFFO2sww 2( 4<+ +"
& C$=$=$?!$C) "K#        sH   U* "U7 V V *U43U47V VVVVV