kgh[ ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddlmZddlmZddlmZmZmZddlmZddlmZmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-dd l.m/Z/dd l0m1Z1dd l2m3Z3m4Z4dd l5m6Z6ddl7m8Z8ddl9m:Z:ddl;me?Z@e)dZAe'e(eBeBefZCe'eDeDeDfZEe'eFe'e$eFe$eFffZGeeeeBgefZHeeeeCgefZIdZJdeFfdZKde'eDdfde'eDeDeDffdZLdeFddfdZMdeFfdZNe:dd dwd eFd!eOd"e$eHddfd#ZPd$eddfd%ZQd$eddfd&ZReRd'd(eded)e*eCeBfd"eHddf d*ZSdeFdeFfd+ZTdxd eFd-eFdeFfd.ZUd/eFd0e eFdeFfd1ZVd/eFddfd2ZWd/eFd0e eFdeFfd3ZXd/eFdeFfd4ZYd/eFdeFfd5ZZd6eFdeDfd7Z[d8e\deFfd9Z]d:e e ede'e"eFe"eDffd;Z^deFdeOfd<Z_eJfd=ed>eDdee`ddffd?ZadydeFdAeOdeFfdBZbdeFde'eFeFffdCZcdDeFdEeFddfdFZddeFdeOfdGZedHedIeddfdJZfGdKdLeZgdMedNede(efdOZhdPeFdQe$eDdeFfdRZidzdTeFdUeFdeFfdVZjdTeFde'e$eFe$eDffdWZkdTeFdeGfdXZldTeFdeFfdYZmdZeFd[eeFge'edffde'eFeGffd\ZndTeFdeGfd]ZodTeFde'eFfd^ZpdZeFde'eFeFe'e$eFe$eFfffd_ZqdZeFdeFfd`ZrdZeFdeFfdaZsdbe-deFfdcZte d@dGdedfZudgeFdeufdhZvdZeFdeufdiZwdjeOddfdkZxd{dlZydeOfdmZzd|deFdneDde'eeDffdoZ{dpe ede!e'eeffdqZ|dreeAgeOfdpe eAde'e eAe eAffdsZ}Gdtdue/Z~d{dvZdS)}N) dataclass)partial)StringIO) filterfalsetee zip_longest)Path) FunctionType TracebackType)AnyBinaryIOCallable GeneratorIterableIteratorListMappingOptionalSequenceTextIOTupleTypeTypeVarUnioncast) Requirement)BuildBackendHookCaller) __version__) CommandErrorExternallyManagedEnvironment)get_major_minor_version)WINDOWS)retry)running_under_virtualenv)rmtree display_path backup_dirasksplitext format_sizeis_installable_dirnormalize_pathrenamesget_prog ensure_dirremove_auth_from_urlcheck_externally_managed ConfiguredBuildBackendHookCallerTreturnctjtjtdd}tj|}dt d|dtdS)Nz..zpip z from z (python ))ospathjoindirname__file__abspathrr!) pip_pkg_dirs x/builddir/build/BUILD/imunify360-venv-2.6.0/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/utils/misc.pyget_pip_versionr@Lsb',,rwx88$EEK'//+..K W+ W W[ W W;R;T;T W W WWpy_version_info.ct|dkr|dt|z dzz }nt|dkr |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)rBs r?normalize_version_inforGSsf ?aAO 4 44<< _   ! !)"1"-   / //rAr9c tj|dS#t$r<}|jtjkr|jtjkrYd}~dSYd}~dSd}~wwxYw)z os.path.makedirs without EEXIST.N)r8makedirsOSErrorerrnoEEXIST ENOTEMPTY)r9es r?r/r/fs D  7el " "qw%/'A'A  # " " " " "'A'A'A'A'A'As A+AAc tjtjd}|dvrtjdS|S#t ttf$rYnwxYwdS)Nr)z __main__.pyz-cz -m pippip) r8r9basenamesysargv executableAttributeError TypeError IndexError)progs r?r.r.psp w ,, ( ( (n--- -K Iz 2     5sAAAA A rDg?)stop_after_delaywaitFdir ignore_errorsonexcc|rt}|t}tt|}tjdkrt j||dSt j||dS)Nr])rD )onerror)_onerror_ignore_onerror_reraiserrmtree_errorhandlerrR version_infoshutilr%)r[r\r]handlers r?r%r%}sr  } 0>>>G 7"" c)))))) c7++++++rA_argscdSNrhs r?rbrbsDrAcrjrkrls r?rcrcs rAr_funcexc_infocn tj|j}n#t$rYdSwxYw|tjzsQ tj||tjz ||dS#t$rYnwxYw#t$rYnwxYwt |ts|\}}}||||dS)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)r8statst_moderJS_IWRITEchmod isinstance BaseException)rnr9ror]rr_s r?rdrds '$--'  T] "   HT7T]2 3 3 3  T         D  h . ."!8Q E$hs/ **"A= A-- A:9A:= B  B cDtjtj|}|tjtjjzr+d|ttjdz}|S)zTGives the display value for a given path, making it relative to cwd if possible..N)r8r9normcaser= startswithgetcwdseprFr9s r?r&r&sr 7  BGOOD11 2 2D ry{{RW[011.T#bikk**,,-- KrA.bakextcd}|}tj||zr9|dz }|t|z}tj||z9||zS)z\Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc))r8r9existsstr)r[rn extensions r?r'r'sh AI '..y ) )! Q#a&&L  '..y ) )! ?rAmessageoptionsctjddD] }||vr|cS t ||S)NPIP_EXISTS_ACTION)r8environgetsplitr()rractions r?ask_path_existsrsW*..!4b99??AA W  MMM  w  rAchtjdrtd|dS)z&Raise an error if no input is allowed. PIP_NO_INPUTz5No input was expected ($PIP_NO_INPUT set); question: N)r8rr Exceptionrs r?_check_no_inputrs? z~~n%%  MG M M     rAc t|t|}|}||vr7t d|d|n|S)z@Ask the message interactively, with the given possible responsesrz>Your response ({!r}) was not one of the expected responses: {}z, )rinputstriplowerprintformatr:)rrresponses r?r(r(s    >>>>##))++ 7 " " VHdii&8&899     O rAc>t|t|S)zAsk for input interactively.)rrrs r? ask_inputrsG >>rAcHt|tj|S)z!Ask for a password interactively.)rgetpassrs r? ask_passwordrs G ?7 # ##rAvalcf|}|dvrdS|dvrdStd|)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? strtoboolrsJ ))++C 222q 5 5 5q777888rAbytesc|dkr |dz dz ddS|dkrt|dz dS|dkr |dz ddSt|dS) Ni@Bg@@iz.1fz MBi'z kBz bytes)int)rs r?r*r* s {&.4'00000   edl##(((( &.)))))e**$$$$rArowscld|D}dt|ddiDfd|D}|fS)zReturn a list of formatted rows and a list of column sizes. For example:: >>> tabulate([['foobar', 2000], [0xdeadbeef]]) (['foobar 2000', '3735928559'], [10, 4]) cRg|]$}ttt|%Srk)tuplemapr).0rows r? ztabulate..s( 1 1 1SE#c3-- 1 1 1rAcRg|]$}ttt|%Srk)maxrrF)rcols r?rztabulate.. s( L L LCSS#   L L LrA fillvaluerc g|]B}dttj|CS) )r:rrljustrstrip)rrsizess r?rztabulate..!s? K K KsSXXc#)S%00 1 1 8 8 : : K K KrA)r)rtablers @r?tabulaters[ 2 1D 1 1 1D L L;+K+K+K L L LE K K K Kd K K KE %<rAcDtj|sdStjtj|drdStjtj|drdSdS)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)r8r9isdirisfiler:r~s r?r+r+%s{ 7==  u w~~bgll4)9::;;t w~~bgll44455t 5rAfilesizec#DK ||}|sdS|V)z7Yield pieces of data from a file-like object until EOF.TN)read)rrchunks r? read_chunksr6s5 $  E rATresolve_symlinksctj|}|r tj|}ntj|}tj|S)zN Convert a path to its canonical, case-normalized, absolute version. )r8r9 expanduserrealpathr=rz)r9rs r?r,r,Asa 7  d # #D%w%%wt$$ 7  D ! !!rActj|\}}|dr|dd|z}|dd}||fS)z,Like os.path.splitext, but take off .tar tooz.tarN) posixpathr)rendswith)r9basers r?r)r)Ns\"4((ID# zz||V$$233i#oCRCy 9rAoldnewctj|\}}|r5|r3tj|stj|t j||tj|\}}|r*|r* tj|dS#t$rYdSwxYwdSdS)z7Like os.renames(), but handles renaming across devices.N) r8r9rrrIrfmove removedirsrJ)rrheadtails r?r-r-Wss##JD$ RW^^D11 D KSs##JD$   M$         DD sB,, B:9B:cztsdS|ttjS)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$r{r,rRprefixr~s r?is_localrhs3 $ % %t ??>#*55 6 66rAmsgargsc*tj|g|RdSrj)loggerinfo)rrs r? write_outputrvs  KdrAcVeZdZUeed<ededdfdZedefdZ dS) StreamWrapper orig_streamr5c(|}||_|Srj)r)clsrrets r? from_streamzStreamWrapper.from_stream}scee% rAc|jjSrj)rencodingselfs r?rzStreamWrapper.encodings((rAN) __name__ __module__ __qualname__r__annotations__ classmethodrpropertyrrrkrAr?rrzsuf[)#)))X)))rAr sequentialnamedc tt|tt|fi|}d|D}||d<t dd|S)Nci|]\}}|| Srkrk)rkeyvalues r? zenum..s:::jc5uc:::rAreverse_mappingEnumrk)dictziprangerFitemstype)rrenumsreverses r?enumr sg Zs:!7!788 B BE B BE::EKKMM:::G&E  E " ""rAhostportc,||Sd|vrd|d}|d|S)z. Build a netloc from a host-port pair N:[]rk)r r s r? build_netlocrs8 |  d{{4{{{  T  rAhttpsnetlocschemec^|ddkrd|vr d|vrd|d}|d|S)z) Build a full URL from a netloc. r@rrz://)count)rrs r?build_url_from_netlocrsP||CA#V"3"368I8IV ! ! ! !!rAczt|}tj|}|j|jfS)z2 Return the host-port pair from a netloc. )rurllibparseurlparsehostnamer )rurlparseds r? parse_netlocr!s5  ' 'C \ " "3 ' 'F ?FK ''rAcd|vr|dfS|dd\}}d}d|vr|dd\}}n|d}}tj|}|tj|}|||ffS)zp Parse out and remove the auth information from a netloc. Returns: (netloc, (username, password)). rNNrNr)rsplitrrrunquote)rauthpwusers r?split_auth_from_netlocr)s  &|## ==a((LD&B d{{::c1%%bbb <   % %D ~ \ ! !" % % D": rAct|\}\}}||S|d}d}n!tj|}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" N****rz:****r)r)rrquote)rr(passwords r? redact_netlocr.sj 6f==F T8 | |!!$'' 'H ' 'v ' ''rArtransform_netlocctj|}||j}|j|d|j|j|jf}tj|}|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) rrurlsplitrrr9queryfragment urlunsplitr)rr/purl netloc_tuple url_piecessurls r?_transform_urlr:sq <  % %D##DK00L+|A 4:t}UJ < " ": . .D m\22 22rAc t|Srj)r)rs r? _get_netlocr=s !& ) ))rAc"t|fSrj)r.r<s r?_redact_netlocr?s & ! ! ##rAcBt|t\}\}}|||fS)z Parse a url into separate netloc, auth, and url with no auth. Returns: (url_without_auth, netloc, (username, password)) r:r=)rurl_without_authrr&s r?split_auth_netloc_from_urlrCs*(6c;'G'G$nvt VT ))rAc8t|tdS)z7Return a copy of url with 'username:password@' removed.rrArs r?r0r0 s #{ + +A ..rAc8t|tdS)z.Replace the password in a given url with ****.r)r:r?rEs r?redact_auth_from_urlrGs #~ . .q 11rAreqc|jst|St||jt|jS)z:Replace the password in a given requirement url with ****.)rrreplacerG)rHs r?redact_auth_from_requirementrKs@ 73xx s88  CG%9#'%B%B C CCrA)frozencLeZdZUeed<eed<defdZdefdZdedefdZ dS) HiddenTextsecretredactedr5c(dt|dS)Nz )rrs r?__repr__zHiddenText.__repr__"s,c$ii,,,,rAc|jSrjrPrs r?__str__zHiddenText.__str__%s }rAothercbt|t|urdS|j|jkS)NF)rrO)rrWs r?__eq__zHiddenText.__eq__)s/ ::T%[[ ( (5{el**rAN) rrrrrrSrVr boolrYrkrAr?rNrNs KKKMMM-#----+C+D++++++rArNrc$t|dS)Nr+rU)rN)rs r? hide_valuer\2s ef - - --rAcBt|}t||S)NrU)rGrN)rrPs r?hide_urlr^6s"#C((H cH - - --rA modifying_pipcddtjjdtjjdtjjg}|o7to0t jtjd|v}|rYtj ddgtjddz}td d |dS) zProtection of pip.exe from modification on Windows On Windows, any operation modifying pip should be run as: python -m pip ... rPryrz-mrNz3To modify pip, please run the following command: {}r) rRremajorminorr"r8r9rQrSrTrrr:)r_ pip_namesshould_show_use_python_msg new_commands r?(protect_pip_from_modification_on_windowsrf;s &c$&&?c$??s'7'=??I P'Pbg&6&6sx{&C&Cy&P" ~tU3chqrrlB  B I I%%       rActrdStjt jdd}tj|sdStj|)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$r8r9r: sysconfigget_pathrr from_config)markers r?r1r1Usd !! W\\),X668L M MF 7>>& ! ! & 26 : ::rAcZtjduotjS)zIs this console interactive?N)rRstdinisattyrkrAr?is_console_interactiverpds" 9D 7SY%5%5%7%77rA blocksizectj}d}t|d5}t||D])}|t |z }||* dddn #1swxYwY||fS)z5Return (hash, length) for path using hashlib.sha256()rrb)rN)hashlibsha256openrrFupdate)r9rqhlengthrblocks r? hash_filer{is A F dD  Q 333  E c%jj F HHUOOOO  f9s (s0, s1), (s2, s3), (s4, s5), ... )iterr)r|s r?pairwiserusH~~H x * **rApredcft|\}}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)rr|t1t2s r? partitionrs2]]FB tR &r"2"2 22rAceZdZ ddedededeedeeddeef fd Z dd ed eeeefd eed effd Z dded eeeefd effd Z dd ed eeeefd eed effd Z dd eeeefd e effd Z dd eeeefd e effd Z dd eeeefd e effd Z dd ed eeeefded effd Z dd ed eeeefded eeffd ZxZS)r2N config_holder source_dir build_backend backend_pathrunner).Npython_executablec`t|||||||_dSrj)super__init__r)rrrrrrr __class__s r?rz)ConfiguredBuildBackendHookCaller.__init__s=   |V=N   +rAwheel_directoryconfig_settingsmetadata_directoryr5cd|jj}t|||SN)rr)rrr build_wheelrrrrcsrs r?rz,ConfiguredBuildBackendHookCaller.build_wheels9   /ww"" RDV#   rAsdist_directorycb|jj}t||SN)r)rrr build_sdist)rrrrrs r?rz,ConfiguredBuildBackendHookCaller.build_sdists-   /ww""?B"GGGrAcd|jj}t|||Sr)rrrbuild_editablers r?rz/ConfiguredBuildBackendHookCaller.build_editables9   /ww%% RDV&   rAc`|jj}t|Sr)rrrget_requires_for_build_wheelrrrrs r?rz=ConfiguredBuildBackendHookCaller.get_requires_for_build_wheel+  /ww33B3GGGrAc`|jj}t|Sr)rrrget_requires_for_build_sdistrs r?rz=ConfiguredBuildBackendHookCaller.get_requires_for_build_sdistrrAc`|jj}t|Sr)rrrget_requires_for_build_editablers r?rz@ConfiguredBuildBackendHookCaller.get_requires_for_build_editables+  /ww66r6JJJrAT_allow_fallbackcd|jj}t|||SN)rrr)rrr prepare_metadata_for_build_wheelrrrrrrs r?rzAConfiguredBuildBackendHookCaller.prepare_metadata_for_build_wheels:   /ww771+8   rAcd|jj}t|||Sr)rrr#prepare_metadata_for_build_editablers r?rzDConfiguredBuildBackendHookCaller.prepare_metadata_for_build_editables:   /ww::1+;   rA)NNNr#rj)NT)rrrr rrrrrrrrrrrrrZrr __classcell__)rs@r?r2r2sy '+04+/ + + + + + sm + ),- +$C= + + + + + +"8<,0     "'#s("34  %SM        8<HHH"'#s("34H HHHHHH8<,0     "'#s("34  %SM        >BHH'S(9:H #HHHHHH>BHH'S(9:H #HHHHHH>BKK'S(9:K #KKKKKK8< $     "'#s("34          8< $     "'#s("34    #           rAr2ctrdSttdsdStjdkstjdkrdStjdkrdSt ddS)zOutput a warning for sudo users on Unix. In a virtual environment, sudo pip still writes to virtualenv. On Windows, users may run pip as Administrator without issues. This warning only applies to Unix root users outside of virtualenv. Ngetuidwin32cygwinrabRunning pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.)r$hasattrr8rRplatformrrwarningrkrAr?warn_if_run_as_rootrs !! 2x   |w#,(":": y{{a NN )rA)FN)r)T)r)r5N)r4)rKrrtloggingr8rrfrqrRri urllib.parser dataclassesr functoolsrior itertoolsrrrpathlibr typesr r typingr r rrrrrrrrrrrrrr"pip._vendor.packaging.requirementsrpip._vendor.pyproject_hooksrrPrpip._internal.exceptionsrr pip._internal.locationsr!pip._internal.utils.compatr"pip._internal.utils.retryr#pip._internal.utils.virtualenvr$__all__ getLoggerrrr3rvExcInforrErr1OnExcOnErrFILE_CHUNK_SIZEr@rGr/r.rZr%rbrcrdr&r'rrr(rrrfloatr*rr+rrr,r)r-rrrr rrr!r)r.r:r=r?rCr0rGrKrNr\r^rfr1rpr{rrr2rrkrAr?rs~    !!!!!!3333333333--------&;:::::>>>>>>OOOOOOOO;;;;;;......++++++CCCCCC   "  8 $ $ GCLL ]#]MA BCcM" Cx}hsm;<<= ,m4c9:,g.34XXXXX0E#s(O0c3PSm@T0000&ST #    $$$DH , ,  ,! ,2:5/ ,  , , ,%$ , C D     S T    $ & & & & & G]*+&  &  & & & & RssCcs!S!8C=!S!!!! S T      x}     ss $#$#$$$$ 93 93 9 9 9 9 %u%%%%% 8HSM* uT#YS 5I/J    ST$!0 udD ! " " " " " " " "35c?34" 73 74 7 7 7 7c#$ ) ) ) ) )H ) ) )"#c#C#DI#### s (3- C    ""#"s"""""((x}hsm'C!D((((3;:(#(#(((((3 3 (#c3h)? @3 3 3333(** ****$3$5:$$$$ *  * 3U8C=(3-78 89 * * * */c/c////2c2c2222 DkDcDDDD $++++++++(.c.j.....#.*....  D T    4 ; ; ; ;88888  C C eCHo    +x}+%S/)B++++ 3 A39  3)1! 3 8A; #$ 3 3 3 3W W W W W '=W W W trA