/usr/lib/python3.9/site-packages/requests/__pycache__
NameSizeModeActions
adapters.cpython-39.opt-1.pyc225890644editdlrm
adapters.cpython-39.pyc225890644editdlrm
api.cpython-39.opt-1.pyc67110644editdlrm
api.cpython-39.pyc67110644editdlrm
auth.cpython-39.opt-1.pyc82830644editdlrm
auth.cpython-39.pyc82830644editdlrm
certs.cpython-39.opt-1.pyc8320644editdlrm
certs.cpython-39.pyc8320644editdlrm
compat.cpython-39.opt-1.pyc16050644editdlrm
compat.cpython-39.pyc16050644editdlrm
cookies.cpython-39.opt-1.pyc187740644editdlrm
cookies.cpython-39.pyc187740644editdlrm
exceptions.cpython-39.opt-1.pyc51850644editdlrm
exceptions.cpython-39.pyc51850644editdlrm
help.cpython-39.opt-1.pyc26100644editdlrm
help.cpython-39.pyc26100644editdlrm
hooks.cpython-39.opt-1.pyc9420644editdlrm
hooks.cpython-39.pyc9420644editdlrm
models.cpython-39.opt-1.pyc238190644editdlrm
models.cpython-39.pyc238190644editdlrm
packages.cpython-39.opt-1.pyc3610644editdlrm
packages.cpython-39.pyc3610644editdlrm
sessions.cpython-39.opt-1.pyc198160644editdlrm
sessions.cpython-39.pyc198160644editdlrm
status_codes.cpython-39.opt-1.pyc41910644editdlrm
status_codes.cpython-39.pyc41910644editdlrm
structures.cpython-39.opt-1.pyc44120644editdlrm
structures.cpython-39.pyc44120644editdlrm
utils.cpython-39.opt-1.pyc237500644editdlrm
utils.cpython-39.pyc237500644editdlrm
_internal_utils.cpython-39.opt-1.pyc12280644editdlrm
_internal_utils.cpython-39.pyc12540644editdlrm
__init__.cpython-39.opt-1.pyc32890644editdlrm
__init__.cpython-39.pyc34330644editdlrm
__version__.cpython-39.opt-1.pyc5070644editdlrm
__version__.cpython-39.pyc5070644editdlrm
Edit: /usr/lib/python3.9/site-packages/requests/__pycache__/cookies.cpython-39.pyc (18774B)
a ¥/�hþGã@sødZddlZddlZddlZddlmZddlmZmZm Z m Z m Z z ddl Z Wne yjddlZ Yn0Gdd„deƒZGdd „d eƒZd d „Zd d „Zddd„ZGdd„deƒZGdd„deje ƒZdd„Zdd„Zdd„Zd dd„Zdd„ZdS)!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)Ú cookielibÚurlparseÚ urlunparseÚMorselÚMutableMappingc@sŽeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z ddd„Z dd„Z dd„Z dd„Zedd„ƒZedd„ƒZedd„ƒZdS) Ú MockRequestaòWraps 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. cCs ||_i|_t|jjƒj|_dS©N)Ú_rÚ _new_headersrÚurlÚschemeÚtype)ÚselfÚrequest©rú4/usr/lib/python3.9/site-packages/requests/cookies.pyÚ__init__%szMockRequest.__init__cCs|jSr )r©rrrrÚget_type*szMockRequest.get_typecCst|jjƒjSr )rr r ÚnetlocrrrrÚget_host-szMockRequest.get_hostcCs| ¡Sr ©rrrrrÚget_origin_req_host0szMockRequest.get_origin_req_hostcCsT|jj d¡s|jjSt|jjddd�}t|jjƒ}t|j||j|j |j |j gƒS)NZHostzutf-8)Úencoding) r ÚheadersÚgetr rrrrÚpathÚparamsÚqueryÚfragment)rÚhostÚparsedrrrÚ get_full_url3s þzMockRequest.get_full_urlcCsdS©NTrrrrrÚis_unverifiableAszMockRequest.is_unverifiablecCs||jjvp||jvSr )r rr ©rÚnamerrrÚ has_headerDszMockRequest.has_headerNcCs|jj ||j ||¡¡Sr )r rrr )rr(ÚdefaultrrrÚ get_headerGszMockRequest.get_headercCs tdƒ‚dS)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()N)ÚNotImplementedError)rÚkeyÚvalrrrÚ add_headerJszMockRequest.add_headercCs||j|<dSr ©r ©rr(ÚvaluerrrÚadd_unredirected_headerNsz#MockRequest.add_unredirected_headercCs|jSr r0rrrrÚget_new_headersQszMockRequest.get_new_headerscCs| ¡Sr )r&rrrrÚ unverifiableTszMockRequest.unverifiablecCs| ¡Sr )rrrrrÚorigin_req_hostXszMockRequest.origin_req_hostcCs| ¡Sr rrrrrr"\szMockRequest.host)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrr$r&r)r+r/r3r4Úpropertyr5r6r"rrrrr s$    r c@s(eZdZdZdd„Zdd„Zdd„ZdS) Ú MockResponsezÀWraps 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. cCs ||_dS)z†Make a MockResponse for `cookielib` to read. :param headers: a httplib.HTTPMessage or analogous carrying the headers N©Ú_headers)rrrrrrhszMockResponse.__init__cCs|jSr r=rrrrÚinfooszMockResponse.infocCs|j |¡dSr )r>Ú getheadersr'rrrr@rszMockResponse.getheadersN)r7r8r9r:rr?r@rrrrr<asr<cCs8t|dƒr|jsdSt|ƒ}t|jjƒ}| ||¡dS)zìExtract 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)ÚhasattrrAr r<ÚmsgZextract_cookies)ÚjarrZresponseZreqÚresrrrÚextract_cookies_to_jarvs ÿ rFcCs t|ƒ}| |¡| ¡ d¡S)zj Produce an appropriate Cookie header string to be sent with `request`, or None. :rtype: str ÚCookie)r Zadd_cookie_headerr4r)rDrÚrrrrÚget_cookie_header‡s rIcCszg}|D]N}|j|krq|dur,||jkr,q|dur@||jkr@q| |j|j|jf¡q|D]\}}}| |||¡q\dS)zkUnsets a cookie by name, by default over all domains and paths. Wraps CookieJar.clear(), is O(n). N)r(ÚdomainrÚappendÚclear)Ú cookiejarr(rJrZ clearablesÚcookierrrÚremove_cookie_by_name’s rOc@seZdZdZdS)ÚCookieConflictErrorz£There 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. N)r7r8r9r:rrrrrP¥srPcsèeZdZdZd3dd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zd4dd„Z‡fdd„Zdd„Zdd „Zd!d"„Z‡fd#d$„Z‡fd%d&„Zd5d'd(„Zd6d)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Z‡ZS)7ÚRequestsCookieJara±Compatibility 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). NcCs,z| |||¡WSty&|YS0dS)zãDict-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). N)Ú_find_no_duplicatesÚKeyError)rr(r*rJrrrrr½s zRequestsCookieJar.getcKs\|dur(t||| d¡| d¡d�dSt|tƒr|j|kr |durRtd|ƒ‚|j}q |rb|Std|||fƒ‚dS)aùBoth ``__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, %rr|)r[r(rJrrPr2rS)rr(rJrZtoReturnrNrrrrRxs    z%RequestsCookieJar._find_no_duplicatescCs|j ¡}| d¡|S)ú4Unlike a normal CookieJar, this class is pickleable.Ú _cookies_lock)Ú__dict__ryÚpop©rÚstaterrrÚ __getstate__‘s  zRequestsCookieJar.__getstate__cCs$|j |¡d|jvr t ¡|_dS)r~rN)r€rzÚ threadingÚRLockrr‚rrrÚ __setstate__˜s  zRequestsCookieJar.__setstate__cCs"tƒ}| | ¡¡| |¡|S)z(Return a copy of this RequestsCookieJar.)rQZ set_policyÚ get_policyrz)rZnew_cjrrrryžs zRequestsCookieJar.copycCs|jS)z&Return the CookiePolicy instance used.)Z_policyrrrrrˆ¥szRequestsCookieJar.get_policy)NNN)NN)NN)NN)r7r8r9r:rrZr]r_r`rarbrcrfrhrirjrlrorprqrWrzr}rRr„r‡ryrˆÚ __classcell__rrrmrrQ«s2            rQcCsN|dur dSt|dƒr| ¡St |¡}| ¡|D]}| t |¡¡q4|S)Nry)rBryrLrW)rDZnew_jarrNrrrÚ_copy_cookie_jarªs  rŠcKs¨d||ddddddddddiddœ }t|ƒt|ƒ}|rLd }t|t|ƒƒ‚| |¡t|d ƒ|d <t|d ƒ|d <|d  d¡|d<t|dƒ|d<tjfi|¤ŽS)zÊMake 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"). rNrtú/FTÚHttpOnly) Úversionr(r2ÚportrJrÚsecureÚexpiresÚdiscardÚcommentÚ comment_urlÚrestÚrfc2109z4create_cookie() got unexpected keyword arguments: %srŽZport_specifiedrJZdomain_specifiedÚ.Zdomain_initial_dotrZpath_specified)rZÚ TypeErrorr^rzÚboolrrrrG)r(r2rXÚresultZbadargsÚerrrrrrV¹s0ó rVcCsÂd}|drNztt ¡t|dƒƒ}WqptyJtd|dƒ‚Yqp0n"|drpd}t t |d|¡¡}t|dt|dƒd|d||j |d dd |d idt|d ƒ|j |d p¼dd� S)zBConvert a Morsel object into a Cookie containing the one k/v pair.Nzmax-agezmax-age: %s must be integerr�z%a, %d-%b-%Y %H:%M:%S GMTr’FrJrrŒZhttponlyr�r�r) r’r“r‘rJr�r(rrŽr”r•r�r2r�) ÚintÚtimeÚ ValueErrorr—ÚcalendarZtimegmÚstrptimerVr˜r-r2)Zmorselr�Z time_templaterrrrUÝs4 ÿ    órUTcCsR|durtƒ}|durNdd„|Dƒ}|D]$}|s8||vr(| t|||ƒ¡q(|S)aCReturns 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 NcSsg|] }|j‘qSr)r()Ú.0rNrrrÚ óz'cookiejar_from_dict..)rQrWrV)Z cookie_dictrMÚ overwriteZnames_from_jarr(rrrÚcookiejar_from_dictüs  r¤cCstt|tjƒstdƒ‚t|tƒr.t||dd�}nBt|tjƒrpz| |¡Wn&tyn|D]}| |¡qZYn0|S)zÒAdd 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)rMr£) rTrrxr�Údictr¤rzÚAttributeErrorrW)rMZcookiesZ cookie_in_jarrrrÚ merge_cookiess  ÿ  r§)NN)NT)r:ryrœržZ_internal_utilsrÚcompatrrrrrr…Ú ImportErrorZdummy_threadingÚobjectr r<rFrIrOÚ RuntimeErrorrPrxrQrŠrVrUr¤r§rrrrÚs.    H $