VULN_CHECK_I913V6 j+ddlmZddlZddlZddlZ ddlZejddkrddlmZe fZ e Z ddl mZddlZddlZddlmZmZmZmZmZddlmZmZmZmZmZm Z m!Z!dZddl"Z"dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+erdd l"m,Z,ddl-Z-ddl.Z.ddl/Z0dd l1m1Z1ddl2Z2e3Z3dd l4m5Z6dd l4m7Z8nddl9mZe:fZ e:Z ddl9m;ZddlZddlZddlm$Z$mZm#Z#mZmZm'Z'm(Z(m)Z)m*Z*m+Z+erdd l>m,Z,ddl?m&Z&m%Z%m Z ddl@mAZ-ddl>mBZ"ddlCmAZ.ddl0Z0dd lDm1Z1ddlEmFZ2eGZ3ddl4m8Z8e6Z6 ddlmHZHmIZI ddl mLZM ddlZxYPwxYw#e$r? dd@lzm{Z|n#e$r dd@l}m{Z|YnwxYw ddAl~mZmZmZn #e$rYnwxYwGdBdCeZyYwxYw#e$rTejdEej ZdFZGdGdHeZdRdIZGdJdKeZGdLdMeZGdNdOeNZYywxYw)S)absolute_importN)StringIO)FileType)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecZt|tr|jd}t|S)Nutf-8) isinstanceunicodeencode_quote)ss ?/usr/lib/python3.12/site-packages/pip/_vendor/distlib/compat.pyr r s$ a !!Aay) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalse) TextIOWrapper)rrr r rr r r) rr rrrr r!r"r#r$)rrr) filterfalse)match_hostnameCertificateErrorc eZdZy)r,N)__name__ __module__ __qualname__rrr,r,_s rr,cg}|sy|jd}|d|dd}}|jd}||kDrtdt|z|s!|j |j k(S|dk(r|j dn{|j d s|j d r%|j tj|n4|j tj|jd d |D]&}|j tj|(tjd d j|zdztj} | j|S)zpMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F.rN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr,reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) dnhostname max_wildcardspatspartsleftmost remainder wildcardsfragpats r_dnsname_matchrMcsD  #Ahab )NN3' } $ #>bIK K88:!11 1 s? KK   (H,?,?,G KK (+ , KK (+33E7C DD KK $ (jjD!11E92==Iyy""rc |s tdg}|jdd}|D]*\}}|dk(s t||ry|j|,|sG|jddD]2}|D]+\}}|dk(s t||ry|j|-4t |dkDr.t d |d d j tt|t |dk(rt d |d |d t d)a=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDsubjectAltNamer1DNSNsubject commonNamer4z hostname z doesn't match either of , z doesn't match rz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrMr:lenr,r@mapr8)certrDdnsnamessankeyvaluesubs rr+r+s>? ?hh',JCe|!%2&  xx 2."%JCl*)%:" . #&/ x=1 "TYYs4':;$=> >]a "Xa[$*+ +#$34 4r)SimpleNamespaceceZdZdZdZy) ContainerzR A generic container for when multiple values need to be returned c :|jj|yN__dict__update)selfkwargss r__init__zContainer.__init__s MM  (rN)r.r/r0__doc__rhr1rrr`r`s   )rr`)whichchd}tjjr ||rSy|.tjj dtj }|sy|j tj}tjdk(rtj|vr |jdtjtjj ddj tj}tfd|Drg}n|Dcgc]}|z }}ng}t}|D]m}tjj|} | |vs'|j| |D]1} tjj!|| } || |s-| ccSoycc}w) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. ctjj|xr8tj||xr tjj | Srb)ospathexistsaccessisdir)fnmodes r _access_checkzwhich.._access_checksAGGNN2&.299R+>.GGMM"-- /rNPATHwin32rPATHEXTc3xK|]1}jj|j3ywrb)r9endswith).0extcmds r zwhich..s)H399;'' 4s7:)rmrndirnameenvironrUdefpathr6pathsepsysplatformcurdirinsertanysetnormcaseaddr@) r}rsrnrtpathextfilesr|seendirnormdirthefilenames ` rrjrjsW / 77??3 S$'  <::>>&"**5Dzz"**% <<7 "99$ Aryy)jjnnY399"**EG HHH.56gssg6EEuCgg&&s+Gd?!$G77<<W5D$T40#  % 7s F/)ZipFile __enter__) ZipExtFileceZdZdZdZdZy)rcN|jj|jyrbrc)rfbases rrhzZipExtFile.__init__s MM  /rc|Srbr1rfs rrzZipExtFile.__enter__Krc$|jyrbcloserfexc_infos r__exit__zZipExtFile.__exit__ JJLrN)r.r/r0rhrrr1rrrrs 0  rrceZdZdZdZdZy)rc|Srbr1rs rrzZipFile.__enter__#rrc$|jyrbrrs rrzZipFile.__exit__&rrcJtj|g|i|}t|Srb) BaseZipFileopenr)rfargsrgrs rrz ZipFile.open*s'##D:4:6:Dd# #rN)r.r/r0rrrr1rrrr"s   $rr)python_implementationcdtjvrytjdk(rytjj dryy)z6Return a string identifying the Python implementation.PyPyjavaJython IronPythonCPython)rversionrmrr;r1rrrr1s8 S[[  77f  ;; ! !, /r)Callablec"t|tSrb)rr)objs rcallablerCs#x((rrmbcsstrictsurrogateescapect|tr|St|tr|jtt St dt|jzNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper.filenames rfsencoderWsN h &O ) ,??; : :9 N3345 5rct|tr|St|tr|jtt St dt|jzr) rrrdecoderrrrr.rs rfsdecoder`sN h *O % (??; : :9 N3345 5r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)c|ddjjdd}|dk(s|jdry|dvs|jdry |S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r9r>r;)orig_encencs r_get_normal_namerqsXsm!!#++C5 '>S^^H5 : : >>E Frc6 jjdd}d}fd}fd}|}|jtr d|dd}d}|s|gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS#t$rdY|wxYw) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrc2 S#t$rYywxYw)Nr) StopIteration)readlinesr read_or_stopz%detect_encoding..read_or_stops" z!   s  c |jd}tj |}|syt |d} t|}r?|jdk7r+ d}t|dj}t||d z }|S#t$r"d}dj|}t|wxYw#t$r0d|z}t|dj|}t|wxYw) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr)line line_stringmsgmatchesencodingcodec bom_foundrs r find_cookiez$detect_encoding..find_cookies+ '#kk'2  '' 4G' 3H 'x(::('7&c**AGGQ%c**F"O=& '?''..sH=C!#&&  ' '#.9C"#&&:@@$&C!#&& 'sB B7 +B479C0Trz utf-8-sig)__self__rAttributeErrorr;r) rrdefaultrrfirstsecondrrs ` @@rrr|s" ((--H   $ L   H %I!"IE!GB; u% eW$ $UG# #v& eV_, ,''K H sB BB)r=)r)unescape)ChainMap)MutableMapping)recursive_reprcfd}|S)zm Decorator to make a repr function return fillvalue for a recursive call ctfd}td|_td|_td|_tdi|_|S)Nct|tf}|vrSj| |}j||S#j|wxYwrb)id get_identrdiscard)rfr[result fillvalue repr_running user_functions rwrapperz=_recursive_repr..decorating_function..wrapperscT(IK/Cl*(( $$S)2!.t!4$,,S1!M%,,S1s A Ar/rir.__annotations__)rgetattrr/rir.r)rrrrs` @rdecorating_functionz,_recursive_repr..decorating_functionsU"u  "&-]L%I"")-"C#*=*#E *1-ARTV*W'rr1)rrs` r_recursive_reprrs  *' &rceZdZdZdZdZdZddZdZdZ d Z d Z e d Z ed Zd ZeZdZedZdZdZdZdZdZy)ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. c.t|xsig|_y)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rfrs rrhzChainMap.__init__s T *rdDIrct|rb)KeyErrorrfr[s r __missing__zChainMap.__missing__s 3- rcr|jD] } ||cS|j|S#t$rY(wxYwrb)rrr)rfr[mappings r __getitem__zChainMap.__getitem__sF99"3<'% ##C( ( s * 66Nc||vr||S|Srbr1rfr[rs rrUz ChainMap.get$s #t 49 8 8rcVttj|jSrb)rVrunionrrs r__len__zChainMap.__len__'s{su{{DII./ /rcVttj|jSrb)iterrr rrs r__iter__zChainMap.__iter__*s  TYY/0 0rc@tfd|jDS)Nc3&K|]}|v ywrbr1)r{mr[s rr~z(ChainMap.__contains__...s3Asaxsrrrs `r __contains__zChainMap.__contains__-s333 3rc,t|jSrbrrs r__bool__zChainMap.__bool__0styy> !rc tdj|djtt|jS)Nz{0.__class__.__name__}({1})rS)rr@rWr8rrs r__repr__zChainMap.__repr__3s.077diiD$)) 457 7rc:|tj|g|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablers rrzChainMap.fromkeys8st}}X556 6rcx|j|jdjg|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rr4N) __class__rcopyrs rr"z ChainMap.copy=s3!4>>$))A,"3"3"5F !" F Frc<|jig|jS)z;New ChainMap with a new dict followed by all previous maps.r!rrs r new_childzChainMap.new_childCs!4>>"1tyy1 1rc:|j|jddS)zNew ChainMap from maps[1:].r4Nr$rs rparentszChainMap.parentsGs"4>>499QR=1 1rc(||jd|<y)Nr)r)rfr[r\s r __setitem__zChainMap.__setitem__Ls %DIIaL rct |jd|=y#t$rtdj|wxYw)Nr(Key not found in the first mapping: {!r})rrrrs r __delitem__zChainMap.__delitem__OsA WIIaL% WIPPQTUVV Ws$7cn |jdjS#t$r tdwxYw)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.)rpopitemrrs rr.zChainMap.popitemUs< Fyy|++-- FDEE Fs4c |jdj|g|S#t$rtdj|wxYw)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rr+)rpoprr)rfr[rs rr0z ChainMap.pop\sQ W'tyy|''3d33 WIPPQTUVV Ws "$Ac>|jdjy)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrs rr2zChainMap.clearcs IIaL   rrb)r.r/r0rirhrr rUrrrrrr classmethodrr"__copy__r%propertyr'r)r,r.r0r2r1rrrrs  +  ) 9 0 1 4 "   7  7  7  7 G 2  2  2 & W  F W !rr)cache_from_sourcec*|d}|rd}||zSd}||zS)NFcor1)rndebug_overridesuffixs rr6r6js2  !&N Ff}Ff}r) OrderedDict)r)KeysView ValuesView ItemsViewceZdZdZdZej fdZejfdZdZdZ dZ ddZ d Z d Z d Zd Zd ZdZdZeZeZefdZddZddZdZdZeddZdZdZdZdZ dZ!y)r<z)Dictionary that remembers insertion orderct|dkDrtdt|z |j|j |i|y#t$rgx|_}||dg|ddi|_Y6wxYw)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. r4z$expected at most 1 arguments, got %dN)rVr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rfrkwdsroots rrhzOrderedDict.__init__sy 4y1} FT RSS  DMM4 (4 ( " %'' dt,Q  s A!A*)A*cz||vr-|j}|d}|||gx|d<x|d<|j|<||||y)z!od.__setitem__(i, y) <==> od[i]=yrr4N)rBrC)rfr[r\ dict_setitemrFlasts rr)zOrderedDict.__setitem__sO${{Aw7;T36GGQG$q'DJJsO sE *rch||||jj|\}}}||d<||d<y)z od.__delitem__(y) <==> del od[y]r4rN)rCr0)rfr[ dict_delitem link_prev link_nexts rr,zOrderedDict.__delitem__s9 s #(, s(; %Iy#$IaL$IaLrc#ZK|j}|d}||ur|d|d}||uryyw)zod.__iter__() <==> iter(od)r4rNrBrfrFcurrs rrzOrderedDict.__iter__<;;D7Dd"1g Awd"&++c#ZK|j}|d}||ur|d|d}||uryyw)z#od.__reversed__() <==> reversed(od)rrNrOrPs r __reversed__zOrderedDict.__reversed__rRrSc |jjD]}|dd= |j}||dg|dd|jjt j|y#t$rY!wxYw)z.od.clear() -> None. Remove all items from od.N)rC itervaluesrBr2rr)rfnoderFs rr2zOrderedDict.clearsp  JJ113DQ4{{t,Q   " JJt "  sAA** A65A6c|s td|j}|r|d}|d}||d<||d<n|d}|d}||d<||d<|d}|j|=tj ||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrr4r)rrBrCrr0)rfrIrFlinkrLrMr[r\s rr.zOrderedDict.popitems 455;;DAw G # ! #QAw G #Q# ! q'C 3HHT3'E: rct|S)zod.keys() -> list of keys in od)rrs rkeyszOrderedDict.keys : rc2|Dcgc]}|| c}Scc}w)z#od.values() -> list of values in odr1rs rvalueszOrderedDict.valuess)-.#DI. ..s c6|Dcgc] }|||f c}Scc}w)z.od.items() -> list of (key, value) pairs in odr1rs ritemszOrderedDict.itemss#045S$s)$5 55sct|S)z0od.iterkeys() -> an iterator over the keys in od)rrs riterkeyszOrderedDict.iterkeysr]rc#(K|D] }|| yw)z2od.itervalues -> an iterator over the values in odNr1rfks rrWzOrderedDict.itervaluess1g sc#,K|D] }|||f yw)z=od.iteritems -> an iterator over the (key, value) items in odNr1res r iteritemszOrderedDict.iteritemss$q'l"sct|dkDrtdt|fz|s td|d}d}t|dk(r|d}t|tr|D] }||||< n9t |dr|j D] }||||< n|D] \}}|||< |j D] \}}|||< y) aod.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v rz8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rr1r4r\N)rVrrrhasattrr\ra)rrErfotherr[r\s rrezOrderedDict.updates4y1}!7:=d)!FGG NOO7DE4yA~Q%& C %c DI!' :: v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)rfr[rrs rr0zOrderedDict.pop&s; d{cI $--'sm#NrNc"||vr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr1r s r setdefaultzOrderedDict.setdefault3s!d{Cy DINrc|si}t|tf}||vryd||< |s|jjd||=S|jjd|j d||=S#||=wxYw)zod.__repr__() <==> repr(od)...r4()())r _get_identr!r.ra)rf _repr_runningcall_keys rrzOrderedDict.__repr__:s{ "-$x-H=(&'M( # ,%)^^%<%<>"(+$(>>#:#:DJJLI!(+M(+sA0)A00A5c|Dcgc] }|||g }}t|j}ttD]}|j|d|r|j|f|fS|j|ffScc}w)z%Return state information for picklingN)varsr"r<r0r!)rfrfra inst_dicts r __reduce__zOrderedDict.__reduce__Hsy+/04aaa\4E0T )I+-( a&))<<>>E8+ + 1sA9c$|j|S)z!od.copy() -> a shallow copy of od)r!rs rr"zOrderedDict.copyRs>>$' 'rc,|}|D]}|||< |S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r1)rrr\dr[s rrzOrderedDict.fromkeysVs# A# Hrct|tr:t|t|k(xr!|j|jk(Stj ||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rr<rVrar__eq__rfrks rrzOrderedDict.__eq__asH %-4y#e*,N1NN;;tU+ +rc||k( Srbr1rs r__ne__zOrderedDict.__ne__jsu}$ $rct|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r=rs rviewkeyszOrderedDict.viewkeysos D> !rct|S)z an object providing a view on od's values)r>rs r viewvalueszOrderedDict.viewvaluesss d# #rct|S)zBod.viewitems() -> a set-like object providing a view on od's items)r?rs r viewitemszOrderedDict.viewitemsws T? "r)Trb)"r.r/r0rirhrr)r,rrUr2r.r\r_rarcrWrhrerDobjectrmr0rorr{r"r3rrrrrrr1rrr<r<s3 ) 8<7G7G +150@0@ %    2  / 6    #  ">8#+   , , (     , %  " $ #rr<)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cNtj|}|std|zy)Nz!Not a valid Python identifier: %rT) IDENTIFIERrBrT)rrs rrrs)   Q @1DE ErceZdZdZdZddZy)ConvertingDictz A converting dictionary wrapper.ctj||}|jj|}||ur/|||<t |t t tfvr||_||_ |Srb) rr  configuratorconvertrrConvertingListConvertingTupleparentr[rfr[r\rs rr zConvertingDict.__getitem__f$$T3/E&&..u5FF""S [a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)r|cfgcFt||_||j_yrb)rconfigr)rfrs rrhzBaseConfigurator.__init__s(0DK'+DKK $rc|jd}|jd} |j|}|D]}|d|zz } t||}|S#t$r |j|t||}YDwxYw#t $r=t jdd\}}td|d|}||c|_ |_ |wxYw)zl Resolve strings to objects using standard import and attribute syntax. r3rr4NzCannot resolve z: ) r6r0importerrr ImportErrorrrrT __cause__ __traceback__) rfrrusedfoundrKetbvs rresolvezBaseConfigurator.resolves 773D!!''-Ay !7%!?@@AEEGH~KK 1 .((..t4Aahhjm, ..44T:"#((*Q-C#'#5#5#;#;C#@$%cF!/(+CA()!A#AEEGH~(76LMF[[F#(;;=KD%FD%0$1M Ms B Bc<t|tr t|}|S)z0Utility function which converts lists to tuples.)rrrrs ras_tuplezBaseConfigurator.as_tupleXs%&e LrN)r.r/r0rir<r?rrrrrr staticmethod __import__rrhrrrrrrr1rrrrs %"**%MN!rzz/2  bjj!23 " #9: " 8, "!   + , . ' D 8  rr)r4)rqrb) __future__rrmr<rsslr version_infor basestringrrrtypesr file_type __builtin__builtins ConfigParser configparserrrr r r urllibr r rrrrrrurllib2rrrrr r!r"r#r$r%httplib xmlrpclibQueuequeuer&htmlentitydefs raw_input itertoolsr'filterr(r*iostrr)shutil urllib.parseurllib.request urllib.error http.clientclientrequest xmlrpc.client html.parser html.entitiesentitiesinputr+r,rTrMr^r`rrjF_OKX_OKzipfilerrrjrBaseZipExtFilerr sysconfigr NameErrorcollections.abcrrrrgetfilesystemencodingrrtokenizercodecsrrr?rrhtmlr=cgir collectionsrrreprlibrrimportlib.utilr6r<threadrru dummy_thread_abcollr=r>r?rlogging.configrrIrrr0rrrrr1rrrs;' A!;LI+"'LLGGG ''' (%I+5 4LI-HHH...  /FF!$%&*I% Fa44F)2@H+ ; $G4^ $+ $ .)H 5{{H{{H@k((ZBQ& |$$HE!$L 0E#'La<<[ C^_4 : /#d(4o_4H))F))>"'')<>F   )())5,#++-8Kf % 55-5Bi('  45I X(#i(\C!*'= ' ''<`!>`!GC!N  C#92 989 ;;    t#dt#C#N_0"$$7J 6. % C6Cy_sVG;5H >H&H<:I% I3 J%J8,K(K:$L.+L>2N;HH H#"H#&H98H9<"I"!I"%I0/I03JJ*J54J58)K%$K%( K76K7: L+L  L+ LL+LL+*L+. L;:L;>NM  N MNMN M('N(M0-N/M00NNAOO