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ringIO) filterfalsetee zip_longest)Path) FunctionType TracebackType)AnyBinaryIOCallableContextManagerDict GeneratorIterableIteratorListOptionalTextIOTupleTypeTypeVarUnioncast) Requirement)BuildBackendHookCaller)retrystop_after_delay wait_fixed) __version__) CommandErrorExternallyManagedEnvironment)get_major_minor_version)WINDOWS)running_under_virtualenv)rmtree display_path backup_dirasksplitext format_sizeis_installable_dirnormalize_pathrenamesget_progcaptured_stdout ensure_dirremove_auth_from_urlcheck_externally_managed ConfiguredBuildBackendHookCallerTreturnctjjtjjtdd}tjj |}dt d|dtdS)Nz..zpip z from z (python ))ospathjoindirname__file__abspathr r#) pip_pkg_dirs a/mnt/ssd/data/python-lab/ChefSystem/venv/lib/python3.12/site-packages/pip/_internal/utils/misc.pyget_pip_versionrALsX'',,rwwx8$EK''//+.K +f[M;R;T:UUV WWpy_version_info.ct|dkr|dt|z dzz }nt|dkDr|dd}td|S)ax Convert a tuple of ints representing a Python version to one of length three. :param py_version_info: a tuple of ints representing a Python version, or None to specify no version. The tuple can have any length. :return: a tuple of length three if `py_version_info` is non-None. Otherwise, return `py_version_info` unchanged (i.e. None). )rN VersionInfo)lenr)rCs r@normalize_version_inforHSsP ?aAO 44<< _  !)"1-   //rBr:c tj|y#t$rJ}|jtjk7r#|jtj k7rYd}~yYd}~yd}~wwxYw)z os.path.makedirs without EEXIST.N)r9makedirsOSErrorerrnoEEXIST ENOTEMPTY)r:es r@r1r1fsN D  77ell "qww%//'A (B "s A+;A&&A+c tjjtjd}|dvrtj dS|S#t ttf$rYywxYw)Nr)z __main__.pyz-cz -m pippip) r9r:basenamesysargv executableAttributeError TypeError IndexError)progs r@r/r/ps_ ww , ( (nn%W- -K Iz 2   sAA A A"!A"TrEg?)reraisestopwaitdir ignore_errorsonexcc|rt}|t}tttt t ft|}tjdk\rtj||ytj||y)Nr_)rE )onerror) _onerror_ignore_onerror_reraiserrrOnExcOnErrrmtree_errorhandlerrS version_infoshutilr&)r]r^r_handlers r@r&r&~se  }  U5%< "56 G  7" c) c7+rB_argscyNrls r@rdrdsrBcrnrorps r@reres rBrafuncexc_infoch tj|j}|tjzs2 tj ||tjz ||yt |ts|\}}}||||y#t$rYywxYw#t$rY;wxYw#t$rYJwxYw)a1 `rmtree` error handler to 'force' a file remove (i.e. like `rm -f`). * If a file is readonly then it's write flag is set and operation is retried. * `onerror` is the original callback from `rmtree(... onerror=onerror)` that is chained at the end if the "rm -f" still fails. N)r9statst_moderKS_IWRITEchmod isinstance BaseException)rrr:rsr_rv_s r@rhrhs ''$-'' T]] "  HHT7T]]2 3  T  h .!8Q $h)      s4B'B%B BB B"!B"% B10B1c@tjjtjj|}|j tj tjj zr#d|ttj dz}|S)zTGives the display value for a given path, making it relative to cwd if possible..N)r9r:normcaser> startswithgetcwdseprGr:s r@r'r'sf 77  BGGOOD1 2D ryy{RWW[[01T#biik*,-- KrBextcd}|}tjj||zr6|dz }|t|z}tjj||zr6||zS)z\Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc))r9r:existsstr)r]rn extensions r@r(r(sZ AI ''..y ) Q#a&L  ''..y ) ?rBmessageoptionsctjjddjD] }||vs|cSt ||S)NPIP_EXISTS_ACTION)r9environgetsplitr))rractions r@ask_path_existsrsF**..!4b9??A W M w  rBc^tjjdrtd|y)z&Raise an error if no input is allowed. PIP_NO_INPUTz5No input was expected ($PIP_NO_INPUT set); question: N)r9rr Exceptionrs r@_check_no_inputrs. zz~~n%CG9 M  &rBc t|t|}|jj}||vr+t dj |dj |n|Sf)z@Ask the message interactively, with the given possible responsesz>Your response ({!r}) was not one of the expected responses: {}z, )rinputstriplowerprintformatr;)rrresponses r@r)r)sa  >>>#))+ 7 " VHdii&89  O rBc.t|t|S)zAsk for input interactively.)rrrs r@ ask_inputrsG >rBcBt|tj|S)z!Ask for a password interactively.)rgetpassrs r@ ask_passwordrsG ??7 ##rBvalcR|j}|dvry|dvrytd|)zConvert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if 'val' is anything else. )yyesttrueon1r)rnoffalseoff0rzinvalid truth value )r ValueError)rs r@ strtoboolrs: ))+C 22 5 5/w788rBbytesc|dkDr |dz dz ddS|dkDrt|dz dS|dkDr |dz ddSt|dS) Ni@Bg@@iz.1fz MBi'z kBz bytes)int)rs r@r+r+sn {&.4',C00  edl#$C(( &.%S))e*V$$rBrowsc \|Dcgc]}ttt|}}t|ddiDcgc]}t tt |}}|Dcgc]:}dj ttj||j<}}||fScc}wcc}wcc}w)zReturn a list of formatted rows and a list of column sizes. For example:: >>> tabulate([['foobar', 2000], [0xdeadbeef]]) (['foobar 2000', '3735928559'], [10, 4]) fillvaluer ) tuplemaprrmaxrGr;ljustrstrip)rrowcolsizestables r@tabulaters-1 1SE#c3- 1D 1+6+K+K LCSS#  LE LFJ KsSXXc#))S%0 1 8 8 : KE K %< 2 L Ks B B$?B)c<tjj|sytjjtjj |drytjjtjj |dryy)atIs path is a directory containing pyproject.toml or setup.py? If pyproject.toml exists, this is a PEP 517 project. Otherwise we look for a legacy setuptools layout by identifying setup.py. We don't check for the setup.cfg because using it without setup.py is only available for PEP 517 projects, which are already covered by the pyproject.toml check. Fzpyproject.tomlTzsetup.py)r9r:isdirisfiler;rs r@r,r,-s_ 77==  ww~~bggll4)9:; ww~~bggll445 rBfilesizec#>K |j|}|sy|w)z7Yield pieces of data from a file-like object until EOF.N)read)rrchunks r@ read_chunksr>s(  $  sresolve_symlinksctjj|}|r tjj|}ntjj |}tjj |S)zN Convert a path to its canonical, case-normalized, absolute version. )r9r: expanduserrealpathr>r~)r:rs r@r-r-IsV 77  d #Dww%wwt$ 77  D !!rBctj|\}}|jjdr |dd|z}|dd}||fS)z,Like os.path.splitext, but take off .tar tooz.tarN) posixpathr*rendswith)r:basers r@r*r*VsN""4(ID# zz|V$23i#oCRy 9rBoldnewc~tjj|\}}|r6|r4tjj|stj|t j ||tjj|\}}|r|r tj|yyy#t$rYywxYw)z7Like os.renames(), but handles renaming across devices.N) r9r:rrrJrjmove removedirsrK)rrheadtails r@r.r._ss#JD$ RWW^^D1 D KKSs#JD$   MM$ t   sB00 B<;B<chtsy|jttjS)z Return True if path is within sys.prefix, if we're running in a virtualenv. If we're not in a virtualenv, all paths are considered "local." Caution: this function assumes the head of path has been normalized with normalize_path. T)r%rr-rSprefixrs r@is_localrps% $ % ??>#**5 66rBmsgargsc0tj|g|yrn)loggerinfo)rrs r@ write_outputr~s KKdrBcHeZdZUeed<ededdfdZedefdZ y) StreamWrapper orig_streamr6c"|}||_|Srn)r)clsrrets r@ from_streamzStreamWrapper.from_streamse% rBc.|jjSrn)rencodingselfs r@rzStreamWrapper.encodings(((rBN) __name__ __module__ __qualname__r__annotations__ classmethodrpropertyrrrorBr@rrsCf)#))rBr stream_namec#Ktt|}tt|tj | tt|tt||y#tt||wxYww)zReturn a context manager used by captured_stdout/stdin/stderr that temporarily replaces the sys stream *stream_name* with a StringIO. Taken from Lib/support/__init__.py in the CPython repo. N)getattrrSsetattrrr)r orig_stdouts r@captured_outputrsU#{+K Cm77 DE/c;''[+.[+.s5A2A A2A//A2ctdS)zCapture the output of sys.stdout: with captured_stdout() as stdout: print('hello') self.assertEqual(stdout.getvalue(), 'hello ') Taken from Lib/support/__init__.py in the CPython repo. stdoutrrorBr@r0r0s 8 $$rBctdS)z See captured_stdout(). stderrrrorBr@captured_stderrrs 8 $$rB sequentialnamedc tt|tt|fi|}|j Dcic]\}}|| }}}||d<t dd|Scc}}w)Nreverse_mappingEnumro)dictziprangerGitemstype)rrenumskeyvaluereverses r@enumrsa Zs:!78 BE BE,1KKM:jc5ucz:G:&E  E "";s Ahostportc,||Sd|vrd|d}|d|S)z. Build a netloc from a host-port pair :[]ro)rrs r@ build_netlocrs3 |  d{4&{V1TF rBnetlocschemecT|jddk\rd|vr d|vrd|d}|d|S)z) Build a full URL from a netloc. r@rrz://)count)rrs r@build_url_from_netlocr sA||CA#V"368IVHAXS !!rBct|}tjj|}|j|j fS)z2 Return the host-port pair from a netloc. )r urllibparseurlparsehostnamer)rurlparseds r@ parse_netlocr(s5  'C \\ " "3 'F ??FKK ''rBcd|vr|dfS|jdd\}}d}d|vr|jdd\}}n|d}}tjj |}|tjj |}|||ffS)zp Parse out and remove the auth information from a netloc. Returns: (netloc, (username, password)). rNNrNr)rsplitrr"r#unquote)rauthpwusers r@split_auth_from_netlocr0s  &|## ==a(LD&B d{::c1%bb <<   %D ~ \\ ! !" % D": rBct|\}\}}||S|d}d}n!tjj|}d}||d|S)z Replace the sensitive data in a netloc with "****", if it exists. For example: - "user:pass@example.com" returns "user:****@example.com" - "accesstoken@example.com" returns "****@example.com" ****rz:****r)r0r"r#quote)rr/passwords r@ redact_netlocr5s` 6f=F T8 | ||!!$'VH:Qvh ''rBr&transform_netlocc"tjj|}||j}|j|d|j |j |jf}tjj|}|td|fS)aRTransform and replace netloc in a url. transform_netloc is a function taking the netloc and returning a tuple. The first element of this tuple is the new netloc. The entire tuple is returned. Returns a tuple containing the transformed url as item 0 and the original tuple returned by transform_netloc as item 1. r NetlocTuple) r"r#urlsplitrrr:queryfragment urlunsplitr)r&r6purl netloc_tuple url_piecessurls r@_transform_urlrA sp <<  %D#DKK0L++|A 4::t}}UJ << " ": .D m\2 22rBct|Srn)r0rs r@ _get_netlocrD s !& ))rBct|fSrn)r5rCs r@_redact_netlocrF$s & ! ##rBc8t|t\}\}}|||fS)z Parse a url into separate netloc, auth, and url with no auth. Returns: (url_without_auth, netloc, (username, password)) rArD)r&url_without_authrr-s r@split_auth_netloc_from_urlrJ(s'(6c;'G$nvt VT ))rBc(t|tdS)z7Return a copy of url with 'username:password@' removed.rrHr&s r@r2r24s #{ +A ..rBc(t|tdS)z.Replace the password in a given url with ****.r)rArFrLs r@redact_auth_from_urlrN;s #~ .q 11rBreqc|js t|St|j|jt|jS)z:Replace the password in a given requirement url with ****.)r&rreplacerN)rOs r@redact_auth_from_requirementrR@s7 773x s8  CGG%9#''%B CCrBcHeZdZdededdfdZdefdZdefdZdedefd Z y) HiddenTextsecretredactedr6Nc ||_||_yrn)rUrV)rrUrVs r@__init__zHiddenText.__init__Hs   rBc dt|dS)Nz )rrs r@__repr__zHiddenText.__repr__Lsc$i]!,,rBc|jSrnrVrs r@__str__zHiddenText.__str__Os }}rBothercdt|t|k7ry|j|jk(S)NF)r rU)rr_s r@__eq__zHiddenText.__eq__Ss* :e ${{ell**rB) rrrrrXr[r^r boolrarorBr@rTrTGsG!s!c!d!-#-+C+D+rBrTrct|dS)Nr2r])rT)rs r@ hide_valuerd\s ef --rBc2t|}t||S)Nr])rNrT)r&rVs r@hide_urlrf`s#C(H cH --rB modifying_pipcddtjjdtjjdtjjg}|xr:txr2t j jtjd|v}|rPtjddgtjddz}tdjdj|y) zProtection of pip.exe from modification on Windows On Windows, any operation modifying pip should be run as: python -m pip ... rQr}rz-mrNz3To modify pip, please run the following command: {}r) rSrimajorminorr$r9r:rRrTrUr!rr;)rg pip_namesshould_show_use_python_msg new_commands r@(protect_pip_from_modification_on_windowsrnes  c$$ %& c$$ %Qs'7'7'='=&>?I P'Pbgg&6&6sxx{&Cy&P"~~tU3chhqrlB  B I I%   "rBctrytjjt j dd}tjj |sytj|)zCheck whether the current environment is externally managed. If the ``EXTERNALLY-MANAGED`` config file is found, the current environment is considered externally managed, and an ExternallyManagedEnvironment is raised. NstdlibzEXTERNALLY-MANAGED) r%r9r:r; sysconfigget_pathrr" from_config)markers r@r3r3sQ ! WW\\),,X68L MF 77>>& ! & 2 26 ::rBcftjduxrtjjS)zIs this console interactive?N)rSstdinisattyrorBr@is_console_interactiverxs# 99D 7SYY%5%5%77rB blocksizectj}d}t|d5}t||D]!}|t |z }|j |# ddd||fS#1swY||fSxYw)z5Return (hash, length) for path using hashlib.sha256()rrb)rN)hashlibsha256openrrGupdate)r:ryhlengthrblocks r@ hash_filersx A F dD Q 3 E c%j F HHUO  f9  f9s 2A""A.iterablec0t|}t||S)zb Return paired elements. For example: s -> (s0, s1), (s2, s3), (s4, s5), ... )iterr)rs r@pairwisersH~H x **rBpredcNt|\}}t||t||fS)z Use a predicate to partition entries into false entries and true entries, like partition(is_odd, range(10)) --> 0 2 4 6 8 and 1 3 5 7 9 )rrfilter)rrt1t2s r@ partitionrs*]FB tR &r"2 22rBcbeZdZ ddedededeedeeddeef fd Z dd ed eeee ee effd eed effd Z dded eeee ee effd effd Z dd ed eeee ee effd eed effd Z dd eeee ee effd e effd Z dd eeee ee effd e effd Z dd eeee ee effd e effd Z dd ed eeee ee effded effd Z dd ed eeee ee effded effd ZxZS)r4 config_holder source_dir build_backend backend_pathrunner).Npython_executablec:t||||||||_yrn)superrXr)rrrrrrr __class__s r@rXz)ConfiguredBuildBackendHookCaller.__init__s(   |V=N +rBwheel_directoryconfig_settingsmetadata_directoryr6cT|jj}t| |||SN)rr)rrr build_wheelrrrrcsrs r@rz,ConfiguredBuildBackendHookCaller.build_wheels5    / /w" RDV#  rBsdist_directorycR|jj}t| ||SN)r)rrr build_sdist)rrrrrs r@rz,ConfiguredBuildBackendHookCaller.build_sdists+    / /w"?B"GGrBcT|jj}t| |||Sr)rrrbuild_editablers r@rz/ConfiguredBuildBackendHookCaller.build_editables5    / /w% RDV&  rBcP|jj}t| |Sr)rrrget_requires_for_build_wheelrrrrs r@rz=ConfiguredBuildBackendHookCaller.get_requires_for_build_wheel)   / /w3B3GGrBcP|jj}t| |Sr)rrrget_requires_for_build_sdistrs r@rz=ConfiguredBuildBackendHookCaller.get_requires_for_build_sdistrrBcP|jj}t| |Sr)rrrget_requires_for_build_editablers r@rz@ConfiguredBuildBackendHookCaller.get_requires_for_build_editables)   / /w6r6JJrB_allow_fallbackcT|jj}t| |||SN)rrr)rrr prepare_metadata_for_build_wheelrrrrrrs r@rzAConfiguredBuildBackendHookCaller.prepare_metadata_for_build_wheels6    / /w71+8  rBcT|jj}t| |||Sr)rrr#prepare_metadata_for_build_editablers r@rzDConfiguredBuildBackendHookCaller.prepare_metadata_for_build_editables6    / /w:1+;  rB)NNNr*rn)NT)rrrr rrr rXrrrrrrrrrrbrr __classcell__)rs@r@r4r4s '+04+/ + + + + sm + ),- +$C= +"GK,0    "$sE#tCy.,A'A"BC  %SM   GKHH"$sE#tCy.,A'A"BCH HGK,0    "$sE#tCy.,A'A"BC  %SM   MQH'S%T#Y2G-G(HIH cHMQH'S%T#Y2G-G(HIH cHMQK'S%T#Y2G-G(HIK cKGK $    "$sE#tCy.,A'A"BC     GK $    "$sE#tCy.,A'A"BC      rBr4)FN)z.bak)T)https)r6N)i) contextlibrLrr|iologgingr9rrjrurSrq urllib.parser" functoolsrr itertoolsrrrpathlibrtypesr r typingr r r rrrrrrrrrrrrr"pip._vendor.packaging.requirementsrpip._vendor.pyproject_hooksrpip._vendor.tenacityrrrrQr pip._internal.exceptionsr!r"pip._internal.locationsr#pip._internal.utils.compatr$pip._internal.utils.virtualenvr%__all__ getLoggerrrr5rzExcInforrFrr8rfrgrArHr1r/rbr&rdrerhr'r(rrr)rrrfloatr+rr,DEFAULT_BUFFER_SIZErrr-r*r.rrrcontextmanagerrr0rrrr r(r0r5rArDrFrJr2rNrRrTrdrfrnr3rxrrrr4rorBr@rs    33-&;>DDO;.C $   8 $ CL ]#]MA BCcM" Cx}hsm;<<= ,m4c9:,g.34XX0E#s(O0c3PSm@T0&ST # t*1-JsOD !, ,, E?, ,E,, C D  S T $ & & & G]*+&  &  & RssCcs!S!8C=!S! S T   x}  ss $#$#$ 93 93 9 %u%% 8HSM* uT#YS 5I/J ST$!# 6 6 udD ! " " " "35c?34" 73 74 7c#$ )H )   / /=$3L)M / / % 6 %% 6%#c#C#DI# s (3- C "#"s""((x}hsm'C!D(3;:(#(#((3 3 (#c3h)? @3 3 3(** *$3$5:$ *  * 3U8C=(3-78 89 */c/c/2c2c2 DkDcD++*.c.j..#.*.  D T 4 ;88 C C eCHo +x}+%S/)B+ 3 A39  3qk 3 8A; #$ 3W '=W rB