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parse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr |d}t|S)Nutf-8) isinstanceunicodeencode_quote)sr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/distlib/compat.pyrs  r) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalse) TextIOWrapper)rr r rrr r r) rr rrrr r!r"r#r$)rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r,N)__name__ __module__ __qualname__rrrrr,`sr,c Csg}|sdS|d}|d|dd}}|d}||kr'tdt||s1||kS|dkr;|dn|d sE|d rN|t|n |t| d d |D] }|t|q\t d d |dtj } | |S)zpMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr,reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) dnhostname max_wildcardspatspartsleftmost remainder wildcardsfragpatrrr_dnsname_matchds*     rIcCs|stdg}|dd}|D]\}}|dkr%t||r dS||q|sJ|ddD]}|D]\}}|dkrHt||rCdS||q2q.t|dkr^td |d tt|ft|dkrntd ||d ftd )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_REQUIREDsubjectAltNamerDNSNsubject commonNamerz&hostname %r doesn't match either of %s, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrIr6lenr,r<mapr4)certr@dnsnamessankeyvaluesubrrrr+s8          r+)SimpleNamespacec@eZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|j|dSN__dict__update)selfkwargsrrr__init__szContainer.__init__N)r-r.r/__doc__rbrrrrr[s r[)whichc s"dd}tjr||rSdS|durtjdtj}|s#dS|tj}tj dkr^tj |vr:| dtj tjddtj}t fd d |DrTg}n fd d |D}ng}t }|D](}tj|}||vr|||D]} tj|| } || |r| SqyqfdS) 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. cSs&tj|ot||otj| Sr\)ospathexistsaccessisdir)fnmoderrr _access_checks zwhich.._access_checkNPATHwin32rPATHEXTc3s"|] }|VqdSr\)r5endswith.0extcmdrr s zwhich..csg|]}|qSrrrrrurr zwhich..)rerfdirnameenvironrPdefpathr2pathsepsysplatformcurdirinsertanysetnormcaseaddr<) rvrkrfrlpathextfilesseendirnormdirthefilenamerrurrds<         rd)ZipFile __enter__) ZipExtFilec@$eZdZddZddZddZdS)rcCs|j|jdSr\r])r`baserrrrbzZipExtFile.__init__cC|Sr\rr`rrrrzZipExtFile.__enter__cG |dSr\closer`exc_inforrr__exit__ zZipExtFile.__exit__N)r-r.r/rbrrrrrrrs rc@r)rcCrr\rrrrrr$rzZipFile.__enter__cGrr\rrrrrr'rzZipFile.__exit__cOs tj|g|Ri|}t|Sr\) BaseZipFileopenr)r`argsrarrrrr+sz ZipFile.openN)r-r.r/rrrrrrrr#s r)python_implementationcCs0dtjvrdStjdkrdStjdrdSdS)z6Return a string identifying the Python implementation.PyPyjavaJython IronPythonCPython)r~versionrerr7rrrrr2s   r) sysconfig)CallablecCs t|tSr\)rr)objrrrcallableF rrmbcsstrictsurrogateescapecC6t|tr|St|tr|ttStdt|jNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper-filenamerrrfsencodeZ   rcCrr) rrrdecoderrrrr-rrrrfsdecodecrr)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|dddd}|dks|drdS|dvs |dr"d S|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)r5r:r7)orig_encencrrr_get_normal_nametsrcszjjWn tydYnwdd}d}fdd}fdd}|}|tr7d|d d}d }|s=|gfS||}|rH||gfS|}|sR||gfS||}|r^|||gfS|||gfS) 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. NFrcszWStyYdSw)N) StopIterationr)readlinerr read_or_stops  z%detect_encoding..read_or_stopcsz|d}Wntyd}durd|}t|wt|}|s(dSt|d}zt|}WntyQdurGd|}t|d|}t|wrp|j dkrldurcd}t|d}t||d 7}|S) 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_foundrrr find_cookies@        z$detect_encoding..find_cookieTrz utf-8-sig)__self__rAttributeErrorr7r)rrdefaultrrfirstsecondr)rrrrrs6   &      r)r9)r)unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sJt|tf}|vr S|z |}W||S|wr\)id get_identrdiscard)r`rVresult) fillvalue repr_running user_functionrrwrappers    z=_recursive_repr..decorating_function..wrapperr.rcr-__annotations__)rgetattrr.rcr-r)rrr)rrrdecorating_functions  z,_recursive_repr..decorating_functionr)rrrrr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(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. cGst|pig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)r`rrrrrbszChainMap.__init__cCst|r\)KeyErrorr`rVrrr __missing__szChainMap.__missing__c Cs6|jD]}z||WStyYqw||Sr\)rrr)r`rVmappingrrr __getitem__s   zChainMap.__getitem__NcCs||vr||S|Sr\rr`rVrrrrrP'sz ChainMap.getcCttj|jSr\)rQrunionrrrrr__len__*rzChainMap.__len__cCrr\)iterrrrrrrr__iter__-rzChainMap.__iter__cstfdd|jDS)Nc3s|]}|vVqdSr\r)rsmrVrrrw1sz(ChainMap.__contains__..rrrrrr __contains__0szChainMap.__contains__cCs t|jSr\rrrrr__bool__3rzChainMap.__bool__cCsd|dtt|jS)Nz{0.__class__.__name__}({1})rN)rr<rRr4rrrrr__repr__6szChainMap.__repr__cGs|tj|g|RS)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr;szChainMap.fromkeyscCs&|j|jdg|jddRS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopyrrrrr @s&z ChainMap.copycCs|jig|jRS)z;New ChainMap with a new dict followed by all previous maps.r rrrrr new_childFszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rNr rrrrparentsJszChainMap.parentscCs||jd|<dS)Nr)r)r`rVrWrrr __setitem__OrzChainMap.__setitem__cCs0z |jd|=WdStytd|w)Nr(Key not found in the first mapping: {!r})rrrrrrr __delitem__Rs  zChainMap.__delitem__cCs(z|jdWStytdw)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.)rpopitemrrrrrrXs  zChainMap.popitemcGs8z |jdj|g|RWStytd|w)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rr)rpoprr)r`rVrrrrr_s  z ChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrrrrrfzChainMap.clearr\)r-r.r/rcrbrrrPrrrrrr classmethodrr __copy__r propertyr rrrrrrrrrrs0      r)cache_from_sourcecCs6|dsJ|dur d}|rd}||Sd}||S)Nz.pyTco)rq)rfdebug_overridesuffixrrrrpsr) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd7d$d%Zd&d'Zd(d)Zed7d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S)8rz)Dictionary that remembers insertion ordercOspt|dkrtdt|z|jWnty-g|_}||dg|dd<i|_Ynw|j|i|dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rQr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)r`rkwdsrootrrrrbs     zOrderedDict.__init__cCsF||vr|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)r!r")r`rVrWZ dict_setitemr%lastrrrrs  zOrderedDict.__setitem__cCs0||||j|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)r"r)r`rVZ dict_delitem link_prev link_nextrrrrs  zOrderedDict.__delitem__cc:|j}|d}||ur|dV|d}||us dSdS)zod.__iter__() <==> iter(od)rrNr!r`r%currrrrr zOrderedDict.__iter__ccr))z#od.__reversed__() <==> reversed(od)rrNr*r+rrr __reversed__r-zOrderedDict.__reversed__cCsbz |jD]}|dd=q|j}||dg|dd<|jWn ty)Ynwt|dS)z.od.clear() -> None. Remove all items from od.N)r" itervaluesr!rrr)r`noder%rrrrs  zOrderedDict.clearTcCs||std|j}|r|d}|d}||d<||d<n|d}|d}||d<||d<|d}|j|=t||}||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 emptyrrr)rr!r"rr)r`r&r%linkr'r(rVrWrrrrs   zOrderedDict.popitemcCt|S)zod.keys() -> list of keys in od)rrrrrkeyszOrderedDict.keyscfddDS)z#od.values() -> list of values in odcsg|]}|qSrrrsrVrrrrxryz&OrderedDict.values..rrrrrvaluesrzOrderedDict.valuescr5)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrrr6rrrrxz%OrderedDict.items..rrrrritemsrzOrderedDict.itemscCr2)z0od.iterkeys() -> an iterator over the keys in od)rrrrriterkeysr4zOrderedDict.iterkeysccs|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNrr`krrrr/s zOrderedDict.itervaluesccs|D] }|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrr;rrr iteritemsszOrderedDict.iteritemscOst|dkrtdt|f|std|d}d}t|dkr%|d}t|tr6|D]}||||<q,nt|drI|D]}||||<q?n |D]\}}|||<qK|D]\}}|||<qXdS) 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)rrrr3N)rQrrrhasattrr3r9)rr$r`otherrVrWrrrr_ s.        zOrderedDict.updatecCs0||vr ||}||=|S||jurt||S)zod.pop(k[,d]) -> 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)r`rVrrrrrr,s zOrderedDict.popNcCs||vr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odrrrrr setdefault9szOrderedDict.setdefaultcCsj|si}t|tf}||vrdSd||<z|s#d|jjfW||=Sd|jj|fW||=S||=w)zod.__repr__() <==> repr(od)rrz%s()z%s(%r))r _get_identr r-r9)r` _repr_runningZcall_keyrrrr@szOrderedDict.__repr__csXfddD}t}ttD]}||dq|r&j|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrrrsr<rrrrxPr8z*OrderedDict.__reduce__..N)varsr rrr )r`r9 inst_dictr<rrr __reduce__Ns  zOrderedDict.__reduce__cCs ||S)z!od.copy() -> a shallow copy of od)r rrrrr X zOrderedDict.copycCs|}|D]}|||<q|S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrWdrVrrrr\s zOrderedDict.fromkeyscCs6t|trt|t|ko||kSt||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrQr9r__eq__r`r?rrrrJgs   zOrderedDict.__eq__cCs ||k Sr\rrKrrr__ne__przOrderedDict.__ne__cCr2)z@od.viewkeys() -> a set-like object providing a view on od's keys)rrrrrviewkeysur4zOrderedDict.viewkeyscCr2)z an object providing a view on od's values)rrrrr viewvaluesyr4zOrderedDict.viewvaluescCr2)zBod.viewitems() -> a set-like object providing a view on od's items)r rrrr viewitems}r4zOrderedDict.viewitems)Tr\)"r-r.r/rcrbrrrrr.rrr3r7r9r:r/r=r_r#objectr@rrArrGr rrrJrLrMrNrOrrrrrs<           r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCst|}|s td|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr>rO)rrrrrrRs  rRc@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCJt||}|j|}||ur#|||<t|tttfvr#||_||_ |Sr\) rr configuratorconvertrrTConvertingListConvertingTupleparentrVr`rVrWrrrrr   zConvertingDict.__getitem__NcCsLt|||}|j|}||ur$|||<t|tttfvr$||_||_ |Sr\) rrPrVrWrrTrXrYrZrVr`rVrrWrrrrrPs  zConvertingDict.getr\)r-r.r/rcrrPrrrrrTs rTcCsDt|||}|j|}||ur t|tttfvr ||_||_ |Sr\) rrrVrWrrTrXrYrZrVr]rrrrs  rc@s"eZdZdZddZdddZdS) rXzA converting list wrapper.cCrUr\) rrrVrWrrTrXrYrZrVr[rrrrr\zConvertingList.__getitem__cCs<t||}|j|}||urt|tttfvr||_|Sr\) rrrVrWrrTrXrYrZ)r`idxrWrrrrrs   zConvertingList.popN)r^)r-r.r/rcrrrrrrrXs rXc@rZ)rYzA converting tuple wrapper.cCsBt||}|j|}||urt|tttfvr||_||_ |Sr\) tuplerrVrWrrTrXrYrZrVr[rrrrs   zConvertingTuple.__getitem__N)r-r.r/rcrrrrrrYs rYc@seZdZdZedZedZedZedZ edZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)rQzQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rtcfgcCst||_||j_dSr\)rTconfigrV)r`rdrrrrbs  zBaseConfigurator.__init__c Cs|d}|d}z-||}|D]"}|d|7}zt||}Wqty4||t||}Yqw|WStyYtdd\}}td||f}|||_ |_ |w)zl Resolve strings to objects using standard import and attribute syntax. r0rrNzCannot resolve %r: %s) r2rimporterrr ImportErrorr~rrO __cause__ __traceback__) r`rrusedfoundrGetbvrrrresolves&       zBaseConfigurator.resolvecCs ||S)z*Default converter for the ext:// protocol.)rnr`rWrrrrarHzBaseConfigurator.ext_convertcCs|}|j|}|durtd|||d}|j|d}|r||j|}|r6||d}n1|j|}|rg|d}|j|sO||}nz t |}||}Wn t yf||}Ynw|rr||d}ntd||f|s%|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr>rOendrdgroups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)r`rWrestrrIr_nrrrrbs8          zBaseConfigurator.cfg_convertcCst|tst|trt|}||_|St|ts&t|tr&t|}||_|St|ts9t|tr9t|}||_|St|trd|j |}|rd| }|d}|j |d}|rd|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rrTrrVrXrrYr` string_typesCONVERT_PATTERNr> groupdictvalue_convertersrPr)r`rWrrIry converterrrrrrW4s2   zBaseConfigurator.convertcsrd}t|s||}dd}tfddD}|di|}|r7|D] \}}t|||q,|S)z1Configure an object with a user-supplied factory.z()r0Ncs g|] }t|r||fqSr)rRrDrdrrrxWs z5BaseConfigurator.configure_custom..r)rrrnrr9setattr)r`rdrpropsrarrrWrrrconfigure_customPs   z!BaseConfigurator.configure_customcCst|tr t|}|S)z0Utility function which converts lists to tuples.)rrr`rorrras_tuple^s zBaseConfigurator.as_tupleN)r-r.r/rcr8r;r{rprsrtrur} staticmethod __import__rerbrnrarbrWrrrrrrrQs$     " rQ)r)rr\) __future__rrer8r~sslrf version_infor basestringrzrrtypesr file_type __builtin__builtins ConfigParser configparserZ _backportrrr r r r urllibr rrrrrrrurllib2rrrrr r!r"r#r$r%httplib xmlrpclibQueuequeuer&htmlentitydefs raw_input itertoolsr'filterr(r*iostrr) urllib.parseurllib.request urllib.error http.clientclientrequest xmlrpc.client html.parser html.entitiesentitiesinputr+r,rOrIrYr[rPrdF_OKX_OKzipfilerrr>rZBaseZipExtFilerrrr NameErrorcollections.abcrrrrgetfilesystemencodingrrtokenizercodecsrrr;rrhtmlr9cgir collectionsrrreprlibrrimportlib.utilrimprthreadrrB dummy_thread_abcollrrr rlogging.configrQrRIrSrTrrrXr`rYrrrrsT      $,     (0         2b  C             l