2biHSrSSKrSSKrSSKrSSKJr SSKJrJrJ r J r J r SSK r "SS5r"SS 5rS rS rSS jr"S S\5r"SS\ R,\5rSrSrSrSSjrSrg!\ a SSKr N^f=f)z requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. N)to_native_string)MorselMutableMapping cookieliburlparse urlunparsec\rSrSrSrSrSrSrSrSr Sr S r SS jr S r S rSr\S5r\S5r\S5rSrg ) MockRequestaWraps a `requests.Request` to mimic a `urllib2.Request`. The code in `cookielib.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. czXl0Ul[URR5RUlgN)_r _new_headersrurlschemetype)selfrequests ڎ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/requests/cookies.py__init__MockRequest.__init__#s)TWW[[)00 cUR$r)rrs rget_typeMockRequest.get_type(s yyrcT[URR5R$r)rrrnetlocrs rget_hostMockRequest.get_host+s $+++rc"UR5$rr rs rget_origin_req_hostMockRequest.get_origin_req_host.s}}rcURRRS5(dURR$[ URRSSS9n[ URR5n[ URUURURURUR/5$)NHostzutf-8)encoding) rheadersgetrrrr rpathparamsqueryfragment)rhostparseds r get_full_urlMockRequest.get_full_url1sww""6**77;;  7'J$''++&        rcgNTrs ris_unverifiableMockRequest.is_unverifiableEsrc\XRR;=(d XR;$r)rr)rrnames r has_headerMockRequest.has_headerHs!ww&C$2C2C*CCrNc~URRRXRRX55$r)rr)r*r)rr:defaults r get_headerMockRequest.get_headerKs,ww""4):):)>)>t)MNNrc[S5e)zMcookielib has no legitimate use for this method; add it back if you find one.z=Cookie headers should be added with add_unredirected_header())NotImplementedError)rkeyvals r add_headerMockRequest.add_headerNs! K  rc X RU'grrrr:values radd_unredirected_header#MockRequest.add_unredirected_headerTs"'$rcUR$rrHrs rget_new_headersMockRequest.get_new_headersWs   rc"UR5$r)r6rs r unverifiableMockRequest.unverifiableZs##%%rc"UR5$r)r$rs rorigin_req_hostMockRequest.origin_req_host^s''))rc"UR5$rr#rs rr/MockRequest.hostbs}}r)rrrr)__name__ __module__ __qualname____firstlineno____doc__rrr r$r1r6r;r?rErKrNpropertyrQrTr/__static_attributes__r5rrr r s| 1 , (DO (!&&**rr c*\rSrSrSrSrSrSrSrg) MockResponsegzWraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. ...what? Basically, expose the parsed HTTP headers from the server response the way `cookielib` expects to see them. cXlg)zvMake a MockResponse for `cookielib` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers N_headers)rr)s rrMockResponse.__init__ns  rcUR$rrcrs rinfoMockResponse.infous }}rc:URRU5 gr)rd getheadersr9s rrjMockResponse.getheadersxs   &rrcN) rXrYrZr[r\rrgrjr^r5rrr`r`gs  'rr`c[US5(aUR(dg[U5n[URR5nUR XC5 g)zExtract the cookies from the response into a CookieJar. :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar) :param request: our own requests.Request object :param response: urllib3.HTTPResponse object _original_responseN)hasattrrmr r`msgextract_cookies)jarrresponsereqress rextract_cookies_to_jarru|sK H2 3 38S8S g C x2266 7C!rcx[U5nURU5 UR5RS5$)z^ Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str Cookie)r add_cookie_headerrNr*)rqrrs rget_cookie_headerrzs6 GA!    " "8 ,,rc./nUHonURU:waMUbX%R:waM)UbX5R:waM=URURURUR45 Mq UHup#nUR X#U5 M g)zcUnsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). N)r:domainr+appendclear) cookiejarr:r|r+ clearablescookies rremove_cookie_by_namers J ;;$    &MM"9    3 6==&++v{{CD)dd+)rc\rSrSrSrSrg)CookieConflictErrorzThere are two cookies that meet the criteria specified in the cookie jar. Use .get and .set and include domain and path args in order to be more specific. r5N)rXrYrZr[r\r^r5rrrrsrrc^\rSrSrSrSSjrSrSrSrSr Sr S r S r S r S rS rSSjrU4SjrSrSrSrU4SjrU4SjrSSjrSSjrSrSrSrSrSrU=r$)RequestsCookieJaraCompatibility class; is a cookielib.CookieJar, but exposes a dict interface. This is the CookieJar we create by default for requests and sessions that don't specify one, since some clients may expect response.cookies and session.cookies to support dict operations. Requests does not use the dict interface internally; it's just for compatibility with external client code. All requests code should work out of the box with externally provided instances of ``CookieJar``, e.g. ``LWPCookieJar`` and ``FileCookieJar``. Unlike a regular CookieJar, this class is pickleable. .. warning:: dictionary operations that are normally O(1) may be O(n). cLURXU5$![a Us$f=f)zDict-like get() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. .. warning:: operation is O(n), not O(1). )_find_no_duplicatesKeyError)rr:r>r|r+s rr*RequestsCookieJar.gets. ++D$? ? N s  ##c Uc*[XURS5URS5S9 g[U[5(a [ U5nO [ X40UD6nUR U5 U$)zDict-like set() that also supports optional domain and path args in order to resolve naming collisions from using one cookie jar over multiple domains. Nr|r+)r|r+)rr* isinstancermorsel_to_cookie create_cookie set_cookie)rr:rJkwargscs rsetRequestsCookieJar.setsf = !6::h#7fjj>P   eV $ $ 'Ad4V4A rc#L# [U5HnURv M g7f)z|Dict-like iterkeys() that returns an iterator of names of cookies from the jar. .. seealso:: itervalues() and iteritems(). N)iterr:rrs riterkeysRequestsCookieJar.iterkeyss 4jF++ !"$c4[UR55$)zkDict-like keys() that returns a list of names of cookies from the jar. .. seealso:: values() and items(). )listrrs rkeysRequestsCookieJar.keyss DMMO$$rc#L# [U5HnURv M g7f)z}Dict-like itervalues() that returns an iterator of values of cookies from the jar. .. seealso:: iterkeys() and iteritems(). N)rrJrs r itervaluesRequestsCookieJar.itervaluess 4jF,, !rc4[UR55$)zlDict-like values() that returns a list of values of cookies from the jar. .. seealso:: keys() and items(). )rrrs rvaluesRequestsCookieJar.valuess DOO%&&rc#d# [U5HnURUR4v M g7f)z}Dict-like iteritems() that returns an iterator of name-value tuples from the jar. .. seealso:: iterkeys() and itervalues(). N)rr:rJrs r iteritemsRequestsCookieJar.iteritemss( 4jF++v||+ +!s.0c4[UR55$)zDict-like items() that returns a list of name-value tuples from the jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a vanilla python dict of key value pairs. .. seealso:: keys() and values(). )rrrs ritemsRequestsCookieJar.items sDNN$%%rc/n[U5H0nURU;dMURUR5 M2 U$)z2Utility method to list all the domains in the jar.rr|r}rdomainsrs r list_domainsRequestsCookieJar.list_domainss84jF}}G+v}}-!rc/n[U5H0nURU;dMURUR5 M2 U$)z0Utility method to list all the paths in the jar.)rr+r})rpathsrs r list_pathsRequestsCookieJar.list_pathss84jF{{%' V[[)! rc/n[U5H=nURbURU;a gURUR5 M? g)z^Returns True if there are multiple domains in the jar. Returns False otherwise. :rtype: bool TFrrs rmultiple_domains"RequestsCookieJar.multiple_domains%sD 4jF}}(V]]g-E NN6== )!rc0n[U5HEnUbURU:XdMUbURU:XdM-URX4R'MG U$)zTakes as an argument an optional domain and path and returns a plain old Python dict of name-value pairs of cookies that meet the requirements. :rtype: dict )rr|r+rJr:)rr|r+ dictionaryrs rget_dictRequestsCookieJar.get_dict2sO 4jF&--6"9  t 3*0,, ;;' ! rcD>[TU]U5$![a gf=fr4)super __contains__r)rr: __class__s rrRequestsCookieJar.__contains__As* 7'- -"  s  c$URU5$)zDict-like __getitem__() for compatibility with client code. Throws exception if there are more than one cookie with name. In that case, use the more explicit get() method instead. .. warning:: operation is O(n), not O(1). )rr9s r __getitem__RequestsCookieJar.__getitem__Gs''--rc&URX5 g)zDict-like __setitem__ for compatibility with client code. Throws exception if there is already a cookie of that name in the jar. In that case, use the more explicit set() method instead. N)rrIs r __setitem__RequestsCookieJar.__setitem__Ps rc[X5 g)z\Deletes a cookie given a name. Wraps ``cookielib.CookieJar``'s ``remove_cookie_by_name()``. N)rr9s r __delitem__RequestsCookieJar.__delitem__Ws  d)rc$>[URS5(aaURRS5(aAURRS5(a!URR SS5Ul[ TU]"U/UQ70UD6$)N startswith"z\")rnrJrendswithreplacerr)rrargsrrs rrRequestsCookieJar.set_cookie]sp FLL, / / '',, %%c**!<<//r:FLw!&:4:6::rc>[U[R5(a/UH(nUR[R"U55 M* g[ TU]U5 g)zAUpdates this jar with cookies from another CookieJar or dict-likeN)rr CookieJarrcopyrupdate)rotherrrs rrRequestsCookieJar.updatefsC eY00 1 1 & 12  GN5 !rc[U5HKnURU:XdMUbURU:XdM*UbURU:XdM?URs $ [ SU<SU<SU<35e)aRequests uses this method internally to get cookie values. If there are conflicting cookies, _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown if there are conflicting cookies. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :return: cookie.value name= , domain=, path=)rr:r|r+rJr)rr:r|r+rs r_findRequestsCookieJar._findnsh4jF{{d">V]]f%<|v{{d':%||+ ! thizIJJrcSn[U5H]nURU:XdMUbURU:XdM*UbURU:XdM?Ub[ SU<35eUR nM_ U(aU$[ SU<SU<SU<35e)aBoth ``__get_item__`` and ``get`` call this function: it's never used elsewhere in Requests. :param name: a string containing name of cookie :param domain: (optional) string containing domain of cookie :param path: (optional) string containing path of cookie :raises KeyError: if cookie is not found :raises CookieConflictError: if there are multiple cookies that match name and optionally domain and path :return: cookie.value Nz&There are multiple cookies with name, rrr)rr:r|r+rrJr)rr:r|r+toReturnrs rr%RequestsCookieJar._find_no_duplicatess4jF{{d">V]]f%<|v{{d':#/"5"H Q#$*<<! OthizIJJrc\URR5nURS5 U$)4Unlike a normal CookieJar, this class is pickleable. _cookies_lock)__dict__rpoprstates r __getstate__RequestsCookieJar.__getstate__s% ""$ /" rcURRU5 SUR;a[R"5Ulgg)rrN)rr threadingRLockrrs r __setstate__RequestsCookieJar.__setstate__s4 U# $-- /!*!2D  0rcz[5nURUR55 URU5 U$)z(Return a copy of this RequestsCookieJar.)r set_policy get_policyr)rnew_cjs rrRequestsCookieJar.copys0"$$//+, d rcUR$)z&Return the CookiePolicy instance used.)_policyrs rrRequestsCookieJar.get_policys ||r)r)NNNNN)rXrYrZr[r\r*rrrrrrrrrrrrrrrrrrrrrrrr^ __classcell__)rs@rrrs" &%',&   .* ;"K(K:3 rrcUcg[US5(aUR5$[R"U5nUR5 UH(nUR[R"U55 M* U$)Nr)rnrr~r)rqnew_jarrs r_copy_cookie_jarrs_ {sFxxziinG MMO499V,- Nrc rSUUSSSSSSSSSS0SS. n[U5[U5- nU(a[S [U535eURU5 [ US 5US '[ US 5US 'US R S5US'[ US5US'[ R"S0UD6$)zMake a cookie from underspecified parameters. By default, the pair of `name` and `value` will be set for the domain '' and sent on every request (this is sometimes called a "supercookie"). rNr/FTHttpOnly) versionr:rJportr|r+secureexpiresdiscardcomment comment_urlrestrfc2109z2create_cookie() got unexpected keyword arguments: rport_specifiedr|domain_specified.domain_initial_dotr+path_specifiedr5)r TypeErrorrrboolrrrw)r:rJrresultbadargss rrrsT"F &kCK'G@g P   MM&#F6N3F !%fX&6!7F #)(#3#>#>s#CF  #F6N3F     %f %%rcSnUS(a/[[R"5[US5-5nO:US(a0Sn[R "[R "USU55n[US[US5SUS UURUS SS US 0S[US 5URUS=(d SS9 $![a [SUSS35ef=f)zBConvert a Morsel object into a Cookie containing the one k/v pair.Nzmax-agez max-age: z must be integerrz%a, %d-%b-%Y %H:%M:%S GMTrFr|r+rhttponlyrrr) rrrr|rr:r+rrrrrJr) inttime ValueErrorrcalendartimegmstrptimerrrCrJ)morselr time_templates rrrsG i M$))+F9,=(>>?G  3 //$--y0A="QR y! *+h ZZ F^ &, -F8$%lly!&Q   Miy(9'::JKL L Ms -CC.cUc [5nUbOUVs/sHo3RPM nnUH.nU(dXT;dMUR[XPU55 M0 U$s snf)a+Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. :rtype: CookieJar )rr:rr) cookie_dictr overwriternames_from_jarr:s rcookiejar_from_dictr  se%' 4=>I&++I>DT7$$]4T9J%KL   ?sA"cX[U[R5(d [S5e[U[5(a [ XSS9nU$[U[R5(aUR U5 U$U$![a UHnURU5 M U$f=f)zAdd cookies to cookiejar and returns a merged CookieJar. :param cookiejar: CookieJar object to add the cookies to. :param cookies: Dictionary or CookieJar object to be added. :rtype: CookieJar z!You can only merge into CookieJarF)rr) rrrrdictr rAttributeErrorr)rcookies cookie_in_jars r merge_cookiesr&s i!4!4 5 5<=='4  'PUV   GY00 1 1 4   W % 9  4!( $$]3")   4s,B$B)(B)rr4)r\rrr_internal_utilsrcompatrrrrr r ImportErrordummy_threadingr r`rurzr RuntimeErrorrrrrrrr r&r5rrr,s -KK( MM`''* " -,&, E ++^EP "&J:*W('(sA:: BB