8fddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZ ddlZn #e$rdZYnwxYwddlZddlZddlZddlZddlZ ddlZn#e$rddlZYnwxYwddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/e j0e1Z2e j3dZ4e j3dZ5e j3d Z6e j3d Z7e j3d Z8e j3d Z9e j3d Z:e j3dZ;dZdZ?dZ@dkdZAdZBdZCdZDejEdZFejEdZGejEdldZHGddeIZJdZKGdd eIZLd!ZMGd"d#eIZNe j3d$e jOZPd%ZQdmd&ZRd'ZSd(ZTd)ZUd*ZVd+ZWe j3d,e jXZYe j3d-ZZdmd.Z[e j3d/Z\d0Z]d1Z^d2Z_d3Z`d4Zad5ZbGd6d7eIZcGd8d9eIZdGd:d;eIZedZgd?Zhd@ZiGdAdBeIZje j3dCZke j3dDZle j3dEZmdFZdGZner:ddHlmoZpmqZqmrZrGdIdJe$jsZsGdKdLepZoGdMdNeoe&ZtGdOdPe%juZuerGdQdRe%jvZvGdSdTe%jwZwdUZxGdVdWeIZyGdXdYeyZzGdZd[eyZ{Gd\d]e'Z|Gd^d_eIZ}d`Z~GdadbeIZdcZddZdeZdfdgdhdiZdjZdS)oN)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cFdfdfdfd|S)ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). ct|}|r8|d}||d}ns|st d|d}|dvrt d|zd|d}|dd}|g}|r|d|krn|d|kr |||dd}nwt|}|st d|z||d||d}|d|}t d|z||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqoqpartsss x/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/distlib/util.py marker_varz parse_marker..marker_varBs   Y ' '  /XXZZ]F!!%%''((+II /788 8! A~~!":Y"FGGGq"%%B!!"" ICE AQ<1$$q\R''LL$$$ )!"" II$**955A5)*G*3+4555LLA/// )!%%''(( 3I AGGENN!";a"?@@@ LLOOOWWU^^F!!"" ,,..Iy  c|ro|ddkrc|dd\}}|ddkrtd|z|dd}n{|\}}|rit|}|snL|d}||d}|\}}|||d}|i|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r'r" MARKER_OPrr r!)r(r*r8r)r7r9markerr0s r/ marker_exprz!parse_marker..marker_exprgs  1,, &y}';';'='= > > FI|s""!"@9"LMMM!!"" ,,..II'Z 22NC 9OOI..XXZZ]%aeegghh/ !+I!6!6YC88 9Fy  r1c|\}}|rOt|}|sn2||d}|\}}d||d}|O||fS)Nandr6)ANDrr!)r(r8r)r9r<s r/ marker_andz parse_marker..marker_andzs$Y//Y 8 )$$A !!%%''((+I([33NCs377C  8I~r1c|\}}|rOt|}|sn2||d}|\}}d||d}|O||fS)Norr6)ORrr!)r(r8r)r9r@s r/r;zparse_marker..markers#I..Y 7##A !!%%''((+I'Z 22NCc#66C  7I~r1) marker_stringr;r@r<r0s @@@@r/ parse_markerrF8sx#!#!#!J!!!!!!&           6-  r1c|}|r|drdSt|}|st d|z|d}||d}dx}x}x}}|r"|ddkr|dd}|dkrt d|z|d|} ||dzd}g}| rt| }|st d | z| |d| |d} | sn<| dd krt d | z| dd} | |sd}|r|dd kr|dd}t|}|st d |z|d}t|} | j r| j st d|z||d}n.d} |ddkr| |\}}n|dd}|dkrt d|z|d|} ||dzd}t| r| | \}} nt| }|st d| z|d} | |d} | rt d| zd| fg}|rL|ddkrt d|z|dd}t!|\}}|r|ddkrt d|z|s|}n$|ddd|D}t%||||||S)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %sctt|}d}|rg} |d}||d}t|}|st d|z|d}|||f||d}|r |ddkrnO|dd}|sn0t|}|st d|z|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. NTrzinvalid version: %srKrinvalid constraint: %s) COMPARE_OPrr r!VERSION_IDENTIFIERr"r$r') ver_remainingr)versionsr7vs r/ get_versionsz'parse_requirement..get_versionssb $$]33(!H=XXZZ](5aeegghh(? .44]CC ="-.C.;/<#=#==HHJJqM Q000(5aeegghh(? ," a0@C0G0G!(5abb(9(@(@(B(B  -"!&,,];; ="-.F.;/<#=#=='=*$(#'..r1r3r4r5rNz~=;zinvalid requirement: %szunexpected trailing data: %s , cg|]}d|zS)z%s %srD).0cons r/ z%parse_requirement..s / / /sWs] / / /r1)nameextras constraintsr;url requirement)strip startswithrrr"r r!findr'r$ NON_SPACErschemenetlocrOrPrFr&r)reqr(r)distnamer] mark_exprrRuriir.trT_rSrss r/parse_requirementros  I  ,,S11t##A ;- 9:::xxzz!}H!%%''((#I*..F.Y.CYq\S(( NN3 " " q556BCC C acNa!eff%,,..    ##A =!"7!";<<< MM!((**Q- ( ( (!%%''(( A ts{{!"@1"DEEE!"" A  FJ+ Q<3  !!"" ,,..I **A A!"3i"?@@@((**Q-C A H ; ;!"3c"9:::!!%%''((+2244II / / /D|s""&2l9&=&=#))NN3**q55%&D&/'0111acN%a!eff-4466 ##A&& +".,q//KHaa*0033AH)*BQ*FGGG 1 A!%%''(( **,,AH)*BQ*FGGG!%q {H7 Q<3  7)CDD DabbM((** +I66 9FYq\S((89DEEE 2  $)) / /h / / /#1#1#12 ("!)%!#  % % %%r1cd}i}|D]\}}}tj||}t|D]}tj||} t| D]v} ||| } ||| d'||| } |tjjdd} | dz| z|| <w|S)z%Find destinations for resources filesc|tjjd}|tjjd}||sJ|t |ddSN/)r#ospathseprblenr')rootrus r/ get_rel_pathz)get_resources_dests..get_rel_pathsk||BGK--||BGK--t$$$$$CIIJJ&&s+++r1Nrs)rtrur&rpopr#rvrstrip)resources_rootrulesry destinationsbasesuffixdestprefixabs_baseabs_globabs_path resource_filerel_pathrel_dests r/get_resources_destsrs,,,L# L Lfdnd33f L LHw||Hf55H!(OO L L , ^X F F < $$]D9999+|Hh??H#||BGK==DDSIIH2:S.82KL// L L r1cttdrd}n.tjttdtjk}|S)N real_prefixT base_prefix)hasattrsysrgetattrr*s r/in_venvr2s=sM""GwsM3:FFF Mr1cftj}t|tst |}|SN)r executable isinstancerrrs r/get_executabler<s/^F fi ( ("&!! Mr1c|} t|}|}|s|r|}|r)|d}||vrn |rd|||fz}C|S)NTrz %c: %s %s)r lower)prompt allowed_chars error_promptdefaultpr.cs r/proceedrNs|A = aLL  W A  =! AM!! = A|V#<< = Hr1ct|tr|}i}|D]}||vr ||||<|Sr)rrsplit)dkeysr*keys r/extract_by_keyr^sQ$ %%zz|| F!! !88C&F3K Mr1ctjddkrtjd|}|}t |} t j|}|ddd}|D]>\}}|D]$\}}|d|}t|} | J| ||<%?|S#t$r| ddYnwxYwd} tj } | | |nX#tj$rF|t!j|}t |}| | |YnwxYwi}| D]C} ix|| <}| | D]$\} }| d|}t|} | J| || <%D|S) Nrutf-8 extensionszpython.exportsexports = c~t|dr||dS||dS)N read_file)rrreadfp)cpstreams r/ read_streamz!read_exports..read_stream|sD 2{ # #  LL IIf     r1)r version_infocodecs getreaderreadr jsonloaditemsget_export_entry Exceptionseekr ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)rdatajdatar*groupentrieskrSr.entryrrrr\values r/ read_exportsrhs: a*!'**622 ;;==D d^^F  &!!|$%56yA$llnn # #NE7  # #1!"AA&(++((("  #   Aq  " $ $B  B  1    t$$$ B  F{{}}"" ""s g88C== " "KD%!TT55)A$Q''E$$$!GDMM  " Ms&A>'**?+g5CCW^^G,,?RW^^G5L5L?4w>C F 'D!DEEE OFG , , , w'''''r1Nctj|rJ|tj|t d|||jsn|t|d}ntj|d|} tj ||| n#| wxYw| |dS)NzCopying stream %s to %swbwencoding)rtruisdirrrrrropenrr copyfileobjrr )rinstreamrr% outstreams r/ copy_streamzFileOperator.copy_stream's7==))))) 00111 -xAAA| " $// "KxHHH  ""8Y777!!!! !!!! w'''''s "C C"c|tj||jsptj|rtj|t|d5}||dddn #1swxYwY| |dS)Nr") rrtrurrr rr'rr )rrurfs r/write_binary_filezFileOperator.write_binary_file6s --...| w~~d##  $dD!! Q                 t$$$$$s=BB#&B#cX||||dSr)r.encode)rrurr%s r/write_text_filezFileOperator.write_text_file?s* tT[[%:%:;;;;;r1c^tjdks tjdkrtjdkrz|D]y}|jrtd|%tj|j|z|z}td||tj||vdSdSdS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rtr\_namerrrrst_modechmod)rbitsmaskfilesr-modes r/set_modezFileOperator.set_modeBs 7g  "'V"3"3G8K8K & &<&KK 5q9999GAJJ.5=DKK ;QEEEHQ%%%%#4"38K8K & &r1c0|dd|S)Nimi)r<)r.r-s r/zFileOperator.Nsqzz%'C'Cr1ctj|}||jvrtj|s|j|tj|\}}||t d|z|j stj ||j r |j |dSdSdSdS)Nz Creating %s)rtrurrr r rrrrrmkdirrr)rrurr-s r/rzFileOperator.ensure_dirPswt$$ t| # #BGNN4,@,@ # L  T " " "7==&&DAq OOA    KK , - - -< { ,!%%d+++++ $ # # # , ,r1ct|| }td|||js|s|||r3|sd}n.||sJ|t |d}i}|r)ttdrtj j |d<tj |||dfi|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT) r rrrrrbrwr py_compilerB CHECKED_HASHcompiler ) rruoptimizeforcerhashed_invalidationdpathdiagpathcompile_kwargss r/ byte_compilezFileOperator.byte_compile\s "$H 55 -tU;;;| 1 2 4// 22#HH??622222#CKKLL1HN" Wwz/D(F(F W,6+I+V')  tUHd 1 1!/ 1 1 1 u%%% r1ctj|r+tj|rtj|sft d||jstj ||j r%||j vr|j |dSdSdStj|rd}nd}t d|||jstj ||j r'||j vr |j |dSdSdSdS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rtrur r&rrdebugrr rrrrr)rrur.s r/ensure_removedzFileOperator.ensure_removedusX 7>>$   8w}}T"" 827>>$+?+? 8 >$''AAA -q$777|$IdOOO;8t111*11$77777% 8 8 8811r1cd}|sitj|r tj|tj}n*tj|}||krn|}|i|Sr)rtrur accessW_OKr)rrur*parents r/ is_writablezFileOperator.is_writablesp w~~d## 411W__T**F~~D  r1c\|jsJ|j|jf}||S)zV Commit recorded changes, turn off recording, return changes. )rrrr)rr*s r/commitzFileOperator.commits8 {{#T%66  r1c|jst|jD]5}tj|rtj|6t|jd}|D]o}tj |}|rC|dgksJtj ||d}tj |tj |p| dS)NT)reverse __pycache__r) rlistrrtrur rsortedrlistdirr&rmdirr)rr-dirsrflistsds r/rollbackzFileOperator.rollbacks| $,-- ! !7>>!$$!IaLLL$+T:::D   1 ! ]O3333aq22BHRLLL  r1FTr)FFNF)rrrrrr rr r+r.r1r<set_executable_moderrMrRrWrYrdrDr1r/rrs& """ )))CCC(((((" ( ( ( (%%%<<< & & &DC , , ,$  ). 2888*   r1rc |tjvrtj|}nt|}||}nM|d}t ||d}|D]}t ||}|S)N.r)rmodules __import__rrrz) module_name dotted_pathmodr*r-rs r/resolverosck!!k+&%%!!#&&eiill++ ( (AVQ''FF Mr1cDeZdZdZedZdZdZej Z dS) ExportEntryc>||_||_||_||_dSrr\rrr)rr\rrrs r/rzExportEntry.__init__s"    r1c6t|j|jSr)rorrrs r/rzExportEntry.valuest{DK000r1c Hd|jd|jd|jd|jd S)Nz rsrs r/__repr__zExportEntry.__repr__s204 4;;;04 TZZZI Ir1ct|tsd}n@|j|jko/|j|jko|j|jko|j|jk}|Sr)rrqr\rrr)rotherr*s r/__eq__zExportEntry.__eq__se%-- 5FFi5:-4$+2M4+54* 3  r1N) rrrrrrrwrzr__hash__rDr1r/rqrqsb 11_1IIIHHHr1rqz(?P([^\[]\S*)) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? ct|}|sd}d|vsd|vrtd|zn|}|d}|d}|d}|dkr|d}}n0|dkrtd|z|d\}}|d } | d|vsd|vrtd|zg} nd | d D} t |||| }|S) NrIrJzInvalid specification '%s'r\callablerrrrc6g|]}|SrDra)rYr-s r/r[z$get_export_entry..s 9991QWWYY999r1rK)ENTRY_REsearchr groupdictcountrrq) specificationr)r*rr\rucolonsrrrs r/rrsX &&A : -  3-#7#7"$*,9$:;; ;$8 KKMMy}C Q;;!4FFF{{&(.0=(>???!ZZ__NFF'  =m##sm';';&(.0=(>???EE99 C(8(8999ET66599 Mr1c|d}tjdkr.dtjvr tjd}ntjd}tj|r=tj|tj}|st d|nG tj |d}n/#t$r"t d |d d }YnwxYw|s.tj}t d |tj||S) a Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. Nz.distlibnt LOCALAPPDATAz $localappdata~z(Directory exists but is not writable: %sTzUnable to create %s)exc_infoFz#Default location unusable, using %s)rtr\environru expandvars expanduserr&rTrUrwarningmakedirsOSErrorrrr&)rr*usables r/get_cache_basers:~ w$>RZ77##O44##C(( w}}V 627++ O NNEv N N N  K   FF    NN0&4N H H HFFF  F!##s" ::c??3w Hr1cdx}}d|vr9|dd\}}d|vr|}n|dd\}}|rt|}|rt|}|||fS)NrLrr)rsplitrr)rfusernamepasswordrs r/parse_credentialsrDsHx f}}sA.. f  HH!'c1!5!5 Hh%8$$%8$$ Xv %%r1cVtjd}tj||S)N)rtumaskrs r/get_process_umaskrSs$ Xd^^FHV Mr1crd}d}t|D]\}}t|tsd}n|J|S)NTF) enumeraterr)seqr*rkr.s r/is_string_sequencerYsV F A#1!\** F E  === Mr1z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)czd}d}t|dd}t|}|r1|d}|d|}|r{t |t |dzkrXtjtj |dz|}|r,| }|d|||dzd|f}|Gt|}|r+|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None NrV-rz\br) rr#PYTHON_VERSIONrrstartrwrerescaper!PROJECT_NAME_AND_VERSION)filename project_namer*pyverr)ns r/split_filenamerjs+ F Ex  ((c22Hh''A( JQWWYYJ';H L(9(9A(=== HRY|,,u4h ? ?  ;Abqb\8AEFF#3U:F ~ $ * *8 4 4  3WWQZZU2F Mr1z-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$ct|}|std|z|}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'r\ver)NAME_VERSION_RErrrrar)rr)rs r/parse_name_and_versionrsj a  A MG!KLLL A V9??   " " $ $ah ..r1ct}t|pg}t|pg}d|vr|d||z}|D]}|dkr|||drE|dd}||vrtd|z||vr||x||vrtd|z|||S)N*rrzundeclared extra: %s)rrr rbrr) requested availabler*runwanteds r/ get_extrasrs UUFIO$$IIO$$I i)    88 JJqMMMM \\#   uHy((5@AAA6!! h''' !!59::: JJqMMMM Mr1ci} t|}|}|d}|dstd|n1t jd|}tj |}n3#t$r&}t d||Yd}~nd}~wwxYw|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetrbrrQrrrrr exception)r_r*respheadersctreaderes r/_get_external_datars FKs||))++ [[ ( (}}/00 ' LLCR H H H H.V%g..t44FYv&&F KKKA3JJJJJJJJK MsBB C)C  Cz'https://www.red-dove.com/pypi/projects/c|dd|d}tt|}t|}|S)Nrrsz /project.jsonupperr_external_data_base_urlr)r\r_r*s r/get_project_datarsB"&q'--////444 8C )3 / /C  $ $F Mr1c|dd|d|d}tt|}t|S)Nrrsz /package-z.jsonr)r\versionr_s r/get_package_datarsD%)!W]]____dddGGG DC )3 / /C c " ""r1c$eZdZdZdZdZdZdS)Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cdtj|stj|tj|jdzdkrt d|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rtrur&rrr6rrrnormpathr)rrs r/rzCache.__init__sw}}T""  K    GDMM !D (Q . . NN>"%%&););&IbMMMMW]]2&&&M"%%% ' ' '""2&&&&& 'sBC  C-,C-N)rrr__doc__rrrrDr1r/rrsK < < <))) r1rc2eZdZdZdZd dZdZdZdZdS) EventMixinz1 A very simple publish/subscribe system. ci|_dSr) _subscribersrs r/rzEventMixin.__init__ sr1Tc|j}||vrt|g||<dS||}|r||dS||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rrr$ appendleft)revent subscriberr$subssqs r/r zEventMixin.add so     --DKKKeB * *%%%%% j)))))r1cv|j}||vrtd|z|||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rrr)rrrrs r/rzEventMixin.remove!sI    1E9:: : U :&&&&&r1cRt|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. rD)iterrr)rrs r/get_subscriberszEventMixin.get_subscribers-s% D%))%44555r1cg}||D]Q} ||g|Ri|}n,#t$rtdd}YnwxYw||Rtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)rrrrr$rQ)rrargskwargsr*rrs r/publishzEventMixin.publish4s..u55 ! !J " 5:4:::6::     !EFFF  MM%  F66 + + + s (&AANrf) rrrrrr rrrrDr1r/rrsn****( ' ' '666r1rcfeZdZdZdZd dZdZdZdZdZ e d Z e d Z d S) SequencercHi|_i|_t|_dSr)_preds_succsr_nodesrs r/rzSequencer.__init__Qs  ee r1c:|j|dSr)rr )rnodes r/add_nodezSequencer.add_nodeVs r1Fc0||jvr|j||rt|j|dD]}|||t|j|dD]}|||t |jD]\}}|s|j|=t |jD]\}}|s|j|=dSdS)NrD)rrrrrrr]r)rredgesrr.rrSs r/ remove_nodezSequencer.remove_nodeYs3 4;   K  t $ $ $  'r2233 % % At$$$$r2233 % % D!$$$$T[..0011 ' '1' AT[..0011 ' '1' A ' ' ' 'r1c||ksJ|j|t||j|t|dSr)r setdefaultrr r)rpredsuccs r/r z Sequencer.addisit|||| tSUU++//555 tSUU++//55555r1c(||ksJ |j|}|j|}n #t$rtd|zwxYw ||||dS#t$rt|d|wxYw)Nz%r not a successor of anythingz not a successor of )rrKeyErrorrr)rrrpredssuccss r/rzSequencer.removenst|||| FK%EK%EE F F F=DEE E F H LL    LL      H H H444FGG G Hs%A*A22Bc8||jvp||jvp||jvSr)rrr)rsteps r/is_stepzSequencer.is_step{s. #'tt{':'4;& (r1c ||std|zg}g}t}|||r|d}||vr1||kr*||||nZ|||||j|d}| ||t|S)Nz Unknown: %rrrD) rrrr$rzrr rrextendreversed)rfinalr*todoseenrrs r/ get_stepszSequencer.get_stepss||E"" 4]U233 3uu E #88A;;Dt|| 5==MM$'''MM$''' d### b11 E""" # r1cvdggiig|jfdD]}|vr |S)Nrc<d|<d|<dxxdz cc< | |}n#t$rg}YnwxYw|D]T}|vr+ |t|||<1| vrt|||<U||krZg} }||||krn1t |} |dSdSNrr)r$rminrztuple) r successors successorconnected_component componentgraphindex index_counterlowlinksr*stack strongconnects r/rz3Sequencer.strong_connections..strongconnectsy'*E$K*1-HTN !    !    LL    "4[      ' K K H,,!M),,,%($)9L%M%MHTNN%''&)$y9I%J%JHTN~t,,&(# % I'..y999 D((  ""566  i(((((-,sA AA)r) rrrrrrr*rrs @@@@@@@r/strong_connectionszSequencer.strong_connectionss  ! )! )! )! )! )! )! )! )! )! )! )F $ $D8## d### r1c dg}|jD]0}|j|}|D]}|d|d|d1|jD]}|d|z|dd|S)Nz digraph G {z z -> rUz %s;} )rr$rr&)rr*rrrrs r/dotz Sequencer.dotsK < .check_paths$ ** (;;w''D GOOBGLL488 9 9||H%% A4BF):):;a?@@ @*;):r1)r"r%zip)rr#tgzzr:gz)r r$tbzzr:bz2r!tarrzUnknown format for %rrrrc tj||S#tj$r!}tt |d}~wwxYw)z9Run tarfile.tar_filter, but raise the expected ValueErrorN)tarfile tar_filter FilterErrorrstr)memberruexcs r/extraction_filterz$unarchive..extraction_filtersP +)&$777& + + + S*** +sAAA)rtrurrwrrrnamelistr1r'getnamesrr getmembersrr\rr(r7 extractallr) archive_filenamer)formatrr+archiver;namesr\tarinfor7r*s ` @r/ unarchiverAspAAAAAAwx((H x==DG ~  $ $%5 6 6 IFF  & &': ; ; IFDD  & &'; < < IFDD  & &v . . IFDD47GGHH H' U??.44G %((**!%%DJt$$$$l#3T::G %((**!%%DJt$$$$ U??s/2Q66 #--// @ @!', ::@#*<#6#6w#?#?GL  + + +%6!8$$$   MMOOOOO  7  MMOOOO s 4DGG*ctj}t|}t|d5}t j|D]k\}}}|D]b}tj||}||d} tj| |} ||| cl dddn #1swxYwY|S)z*zip a directory tree into a BytesIO objectr#N) ioBytesIOrwrrtwalkrur&r) directoryr*dlenzfrxrar:r\fullrelrs r/zip_dirrK%s Z\\F y>>D   %!#!3!3 % % D$ % %w||D$//455kw||C..t$$$$  % %%%%%%%%%%%%%%%% MsBCCC)rKMGTPceZdZdZddZdZdZdZdZe d Z e d Z d Z e d Z e d ZdS)ProgressUNKNOWNrdcn|||ksJ|x|_|_||_d|_d|_d|_dS)NrF)r curmaxstartedelapseddone)rminvalmaxvals r/rzProgress.__init__=sE~6!1!1!11$$48   r1c|j|ksJ|j ||jksJ||_tj}|j ||_dS||jz |_dSr)r rWrVtimerXrY)rcurvalnows r/updatezProgress.updateEsfx6!!!!x6TX#5#5#55ikk < DLLL-DLLLr1cP|dksJ||j|zdS)Nr)rarV)rincrs r/ incrementzProgress.incrementOs-qyyyy DHtO$$$$$r1c:||j|Sr)rar rs r/rzProgress.startSs DH r1cV|j||jd|_dSNT)rWrarZrs r/stopz Progress.stopWs) 8  KK ! ! ! r1c,|j|jn|jSr)rWunknownrs r/maximumzProgress.maximum\s#x/t||TX=r1c||jrd}n1|jd}n'd|j|jz z|j|jz z }d|z}|S)Nz100 %z ?? %gY@z%3d %%)rZrWrVr )rr*rSs r/ percentagezProgress.percentage`sQ 9 "FF X FFDH,-DH1DEA\F r1c|dkr|j|j|jkrd}n'tjdtj|}|S)Nrz??:??:??z%H:%M:%S)rWrVr r^strftimegmtime)rdurationr*s r/format_durationzProgress.format_durationksI MMtx/48tx3G3GFF]:t{8/D/DEEF r1c"|jr d}|j}ned}|jd}nY|jdks|j|jkrd}n;t |j|jz }||j|jz z}|dz |jz}|d||S)NDonezETA rrrz: )rZrYrWrVr floatrr)rrrls r/ETAz Progress.ETAts 9 +F AAFx""tx48';';$(TX-..TX((Udl*!664#7#7#:#:#:;;r1c|jdkrd}n|j|jz |jz }tD]}|dkrn|dz}d||fzS)Nrgig@@z%d %sB/s)rYrVr UNITS)rr*units r/speedzProgress.speedsc <1  FFh)T\9F  D}} f FFVTN**r1N)rrT)rrrrjrrardrrhrrkrmrrrvrzrDr1r/rRrR:sG...%%% >>X>X<<X<$ + +X + + +r1rRz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$ct|rd}t||zt|rd}t||zt |S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrr_CHECK_MISMATCH_SET_iglob) path_globrs r/rrsj##I..*Ky)))!!),,*Fy))) )  r1c#Kt|d}t|dkrit|dks J||\}}}|dD].}td|||fD]}|V/dSd|vrt |D]}|VdS|dd\}}|dkrd}|dkrd}n*|d}|d }tj|D]Y\}}} tj |}ttj ||D]} | VZdS) NrrrKrz**rirrs\) RICH_GLOBrrwr~r& std_iglobr'rtrErur) rrich_path_globrrritemruradicaldirr:rs r/r~r~s__Y22N >Q>""a'''''',VIIcNN  Drwwf'=>>??       y !),,     (oodA66OFG||"}}"..--!....$&GFOO   c5w''-- dG!#>#>"$D #W%;A%>%>>D ""r1NrrrrrrrDr1r/rr$s79999#####r1rceZdZddZdZdS) SafeTransportrcT||_tj||dSr)rrrrrs r/rzSafeTransport.__init__6s("DL  # , ,T< @ @ @ @ @r1c||\}}}|si}|j|d<|jr||jdkr!||_|t j|dfi|f|_|jdS)Nrrr)rrrrrr)rrrrrs r/rzSafeTransport.make_connection:s ..t44MAr6  $ F9 # 'tt/?/B'B'B&(##')@t*'*'%*'*'$' #A& &r1NrrrDr1r/rr4s; A A A A ' ' ' ' 'r1rceZdZdZdS) ServerProxyc &|ddx|_}|Yt|d}|dd}|dkrt}nt }|||x|d<}||_tjj ||fi|dS)Nrrrhttps)r transport) rzrrrrrrrrr)rrjrrrertclsrls r/rzServerProxy.__init__Hs!'It!> >> r1c|SrrDrs r/__iter__zCSVReader.__iter__rr1ct|j}tjddkrBt |D]2\}}t |t s|d||<3|SNrrr)nextrrrrrrr()rr*rkrs r/rzCSVReader.nextsldk""  A  " "$V,, 5 54!$ 225 $ G 4 4F1I r1N)rrrrrr__next__rDr1r/rrxsB ? ? ?HHHr1rceZdZdZdZdS) CSVWriterc rt|d|_tj|jfi|j|_dS)Nr#)rrrwriterr)rrrs r/rzCSVWriter.__init__s4C(( j>> >> r1ctjddkrHg}|D]A}t|tr|d}||B|}|j|dSr)rrrrr0r$rwriterow)rrowrrs r/rzCSVWriter.writerows~  A  " "A  dI..0;;w//DC S!!!!!r1N)rrrrrrDr1r/rrs2???"""""r1rc\eZdZeejZded<dfd ZdZdZdZ xZ S) Configurator inc_convertincNctt|||ptj|_dSr)superrrrtrr)rconfigr __class__s r/rzConfigurator.__init__s7 lD!!**6222'BIKK r1c fd d}t|s|}dd}dd}|rt fd|D} fdD}t |}||i|}|r4|D]\}} t || |  |S)NcJt|ttfr%t|fd|D}n`t|tr6d|vr|}n1i}|D]}||||<n|}|S)Nc&g|] }|SrDrD)rYrkconverts r/r[zBConfigurator.configure_custom..convert..s!!8!8!8''!**!8!8!8r1())rr]rtypedictconfigure_customr)or*rrrs r/rz.Configurator.configure_custom..converts!dE]++ ) a!8!8!8!8a!8!8!899At$$ )199!22155FFF22$+GAaDMMq 2aMr1rriz[]rDc&g|] }|SrDrD)rYrrs r/r[z1Configurator.configure_custom..s!333''!**333r1cTg|]$}t|||f%SrD)r)rYrrrs r/r[z1Configurator.configure_custom..s7KKKQKNNK!WWVAY''(KKKr1)rzr}rorrrsetattr) rrrpropsrrrr*rrSrs `` @r/rzConfigurator.configure_customs#       JJt  {{  QA 3%%zz$##  53333d33344DKKKKK&KKKeD#F##  /  / /1771::.... r1c|j|}t|tr#d|vr||x|j|<}|S)Nr)rrrr)rrr*s r/ __getitem__zConfigurator.__getitem__sMS! fd # # F(,(=(=f(E(E EDK v r1ctj|s%tj|j|}t j|dd5}tj|}dddn #1swxYwY|S)z*Default converter for the inc:// protocol.rrr$N) rtruisabsr&rrr'rr)rrr-r*s r/rzConfigurator.inc_convertsw}}U## 3GLLE22E [g 6 6 6 "!Yq\\F " " " " " " " " " " " " " " " sA==BBr) rrrrrvalue_convertersrrr r __classcell__)rs@r/rrst,=>>+U((((((@ r1rc&eZdZdZddZdZdZdS)SubprocessMixinzC Mixin for running subprocesses and capturing their output FNc"||_||_dSr)verboseprogress)rrrs r/rzSubprocessMixin.__init__s   r1c~|j}|j} |}|sn| |||nr|s tjdn2tj|dtj|dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. TNrir) rrreadlinerstderrrr(flushr)rrrrrr.s r/rzSubprocessMixin.readers =, #!!A #G$$$$8J$$S))))J$$QXXg%6%6777   """ #  r1c 0tj|ftjtjd|}tj|j|jdf}|tj|j|jdf}|| | | |j | ddn&|j rtjd|S)N)stdoutrr)rrrzdone.mainzdone. ) subprocessPopenPIPE threadingThreadrrrrwaitr&rrrr)rcmdrrt1t2s r/ run_commandzSubprocessMixin.run_commands  S '$.O$.O ' ' & ' ' T[(7K L L L   T[(7K L L L       = $ MM'6 * * * * \ ( J  Y ' ' 'r1)FN)rrrrrrr#rDr1r/rrsP!!!!*r1rcRtjdd|S)z,Normalize a python package name a la PEP 503z[-_.]+r)rsubr)r\s r/normalize_namer&s$ 6(C & & , , . ..r1c*eZdZdZdZddZdZdZdS) PyPIRCFilezhttps://upload.pypi.org/legacy/pypiNc|=tjtjdd}||_||_dS)Nrz.pypirc)rtrur&rrr_)rrr_s r/rzPyPIRCFile.__init__(s> :bg0055yAAB r1ci}tj|jr|jp|j}t j}||j| }d|vr| dd}d| dD}|gkr d|vrdg}n|D]}d|i}| |d|d<d|jfd |j fd fD]:\}} | ||r| ||||<5| ||<;|dkr||jdfvr |j|d<|d|kr|d|kri}nod |vrkd }| |dr| |d}n|j}| |d| |d |||j d }|S)N distutilsz index-serverscfg|].}|dk|/S)rr)rYservers r/r[z#PyPIRCFile.read..:s='-||~~++LLNN+++r1rr)r.r repositoryrealm)rNz server-loginr)rrr/r.r0)rtrur rr_DEFAULT_REPOSITORYrRawConfigParserrrrr DEFAULT_REALM has_option) rr*r/rr index_servers_serversr.rrs r/rzPyPIRCFile.read.sT 7>>$- ( (6 1D1DT1J1Jr>>))$*8"*(("*F!3-3ZZ -K-Kz*/;.2.E.G.5t7I-J-?-A66LC &00==6.4jj.E.Es .5s #f,,$($;V#D2E2E373JF<00$X.*<<"("6*"D"D%'F-(. 8++'$$V\::9!'FL!A!AJJ!%!8J & 6: > > & 6: > >",$!/  r1ctj}|j}|||ds|d|dd||dd|t|d5}||ddddS#1swxYwYdS)Nr)rrr#) rr2rr has_sectionrrr'r)rrrrrr-s r/razPyPIRCFile.updatejs-// ] B!!&)) '   v & & & 6:x000 6:x000 "c]] a LLOOO                  sB;;B?B?NN)rrrr1r3rrrarDr1r/r(r(#sR:M :::x     r1r(cPt|jS)zG Read the PyPI access configuration as supported by distutils. )r_)r(r_rrs r/ _load_pypircr<ws# %) $ $ $ ) ) + ++r1c^t|j|jdSr)r(rarrr;s r/ _store_pypircr>~s&LL77777r1c$tjdkrrdtjvrdSdtjvrdSdtjvrdStjSdtjvrtjdStjd ksttd s tjStj\}}}}}| d d }| d d d d}|dddkr|d|S|dddkrQ|ddkrDd}dt|ddz |ddfz}ddd}|d|tj zz }n|dddkrddl m }|S|dd d!krMd!}tjd"tj}||}|r|}n\|dd d#krNddl} dd$lm} n#t,$rddl} YnwxYw| | |||\}}}|d|d|S)%aReturn a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. on Linux, the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. ramd64 win-amd64z(arm) win-arm32z(arm64)z win-arm64_PYTHON_HOST_PLATFORMr3unamersrrVrmrNlinuxsunosr5solarisz%d.%sr32bit64bit)ilz.%saix) aix_platformcygwinz[\d.]+darwin) sysconfig)rtr\rrrplatformrrrDr#intmaxsize _aix_supportrNrrFASCIIrr _osx_supportr,rR ImportErrorget_platform_osxget_config_vars) osnamerreleasermachinebitnessrNrel_rer)rXrRs r/get_host_platformras( w$ ck'')) ) ); ck'')) ) );  ))++ + +;|"*,,z122 w'W!5!5|13 -VT7GW\\^^ # #C , ,Fooc3''//S99G bqbzW!&&''** w   1:  FWQZ1!4gabbk BBG$+IIG uws{33 3G u  ------|~~ x  Irx00 LL ! !  ggiiG x    + + + + + + +          #/#@#@  % % ' ''$C$C  '' 22s?IIIwin32rArB)x86x64armctjdkrtStjd}|t vrtSt |S)NrVSCMD_ARG_TGT_ARCH)rtr\rarr_TARGET_TO_PLAT)cross_compilation_targets r/ get_platformrjsQ w$ """!z~~.BCC66 """ 3 44r1r9)rrrg)r collectionsr contextlibrglobrrrCrloggingrtrDrrrrYrrr1rrrdummy_threadingr^rrcompatrrr r r r r rrrrrrrrrrrrr getLoggerrrrFrrPrOr:rCr?rdr%rFrorrrrrrrcontextmanagerrrrrrrrrorqVERBOSErrrrrrrrIrrrrrrrrrrrrrARCHIVE_EXTENSIONSrArKrxrRrr|r}r~rrrrrrrrrrrrrrrr&r(r<r>rarhrjrDr1r/rvs    ######   JJJJ CCC ((((''''''( ((((((((((((((((((((((((((((((((((((((((((((  8 $ $ RZ) * * RZ 344 RZ5 6 6 BJD E E RZ bj BJ{ # # rzEFF X!X!X!vB%B%B%J4$     ,,,^&   &&&&     f       6~~~~~6~~~B   &8 2::  ' '>&(&(&(&(R"   & & & &2:t,--4"*9:: / / / 8*D### )))))F)))XDDDDDDDDTG!G!G!G!G!G!G!G!\AAAAH   $ &W+W+W+W+W+vW+W+W+| BJ~ & & " #?@@ bj!5668Z(++++++++++     '1   D     '   V(((((<((( # # # # # # # # #'''''' /'''$<<<<<)'<<<2$$$     f   6"""""""",55555#555p.....f...b///"QQQQQQQQh,,,888Q3Q3Q3j   55555s!;AAA"" A.-A.