+
    i'w                        R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^RIH	t	 ^RI
Ht ^RIHt ^RIHtHtHtHt ^RIHtHtHtHt ^R	IHtHtHtHt ^R
IHtHt ^RI H!t!H"t"H#t#H$t$ ^RI%H&t& ^RI'H(t( ^RI)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3 ]Ph                  R8X  d   ]Pj                  t6M]P                  t6]3R lt7]3R lt8 ! R R4      t9 ! R R]94      t:R t;R# )z
requests.sessions
~~~~~~~~~~~~~~~~~

This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
N)OrderedDict)	timedelta)to_native_string)HTTPAdapter)_basic_auth_str)Mapping	cookieliburljoinurlparse)RequestsCookieJarcookiejar_from_dictextract_cookies_to_jarmerge_cookies)ChunkedEncodingErrorContentDecodingErrorInvalidSchemaTooManyRedirects)default_hooksdispatch_hook)DEFAULT_REDIRECT_LIMITREDIRECT_STATIPreparedRequestRequest)codes)CaseInsensitiveDict)
DEFAULT_PORTSdefault_headersget_auth_from_urlget_environ_proxiesget_netrc_authrequote_uriresolve_proxiesrewind_bodyshould_bypass_proxiesto_key_val_listwin32c                D   Vf   V # V f   V# \        V\        4      '       d   \        V \        4      '       g   V # V! \        V4      4      pVP                  \        V 4      4       VP	                  4        UUu. uF  w  rEVe   K  VNK  	  pppV F  pW7 K  	  V# u uppi )zDetermines appropriate setting for a given request, taking into account
the explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class`
)
isinstancer   r$   updateitems)request_settingsession_setting
dict_classmerged_settingkv	none_keyskeys   &&&     W/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/requests/sessions.pymerge_settingr3   =   s      	?G,,OW1U1U @AN//:; "0!5!5!7E!7v1!7IE  	 Fs   9BBc                    Ve   VP                  R4      . 8X  d   V # V e   V P                  R4      . 8X  d   V# \        WV4      # )zProperly merges both requests and session hooks.

This is necessary because when request_hooks == {'response': []}, the
merge breaks Session hooks entirely.
response)getr3   )request_hookssession_hooksr,   s   &&&r2   merge_hooksr9   [   sM      1 1* = C 1 1* = CzBB    c                   H   a  ] tR t^jt o R tR tR	R ltR tR tR t	Rt
V tR# )
SessionRedirectMixinc                    VP                   '       d1   VP                  R,          pVP                  R4      p\        VR4      # R# )z7Receives a Response. Returns a redirect URI or ``None``locationlatin1utf8N)is_redirectheadersencoder   )selfrespr>   s   && r2   get_redirect_target(SessionRedirectMixin.get_redirect_targetk   s>     ||J/H  x0H#Hf55r:   c                   \        V4      p\        V4      pVP                  VP                  8w  d   R# VP                  R8X  d6   VP                  R9   d%   VP                  R8X  d   VP                  R9   d   R# VP                  VP                  8g  pVP                  VP                  8g  p\        P
                  ! VP                  R4      R3pV'       g%   VP                  V9   d   VP                  V9   d   R# T;'       g    T# )zFDecide whether Authorization header should be removed when redirectingThttpNhttpsF)P   N)i  N)r
   hostnameschemeportr   r6   )rD   old_urlnew_url
old_parsed
new_parsedchanged_portchanged_schemedefault_ports   &&&     r2   should_strip_auth&SessionRedirectMixin.should_strip_auth   s    g&
g&
*"5"55 ':-!!W,;. "*//9#**j.?.??%))**;*;TBDI</</ --~-r:   Nc	              +  l  "   . p
V P                  V4      p\        VP                  4      P                  pV'       Ed<   VP	                  4       pV
P                  V4       V
R,          Vn         VP                   \        VP                  4      V P                  8  d   \        RV P                   R2VR7      hVP!                  4        VP#                  R4      '       d<   \        VP                  4      pRP%                  \'        VP(                  4      V.4      p\        V4      pVP                  R	8X  d   V'       d   VP+                  VR
7      pMVP                  '       d   VP                  pVP-                  4       pVP.                  '       g!   \1        VP                  \3        V4      4      pM\3        V4      p\'        V4      Vn        V P5                  W4       VP6                  \8        P:                  \8        P<                  39  d/   RpV F  pVP>                  PA                  VR4       K!  	  RVn!        VP>                  pVPA                  RR4       \E        VPF                  W!P                  4       \I        VPF                  V PJ                  4       VPM                  VPF                  4       V PO                  W4      pV PQ                  W4       VPR                  RJ;'       d    RV9   ;'       g    RV9   pV'       d   \U        V4       TpV'       d   Vx  EK  V PV                  ! V3RVRVRVRVRVRR/V	B p\E        V PJ                  WP                  4       V P                  V4      pVx  EKD  R#   \        \        \        3 d!    TP                  P                  RR7        EL6i ; i5i)zBReceives a Response. Returns a generator of Responses or Requests.:   NNF)decode_contentz	Exceeded z redirects.)r5   z//: )fragmentContent-LengthTransfer-EncodingNCookiestreamtimeoutverifycertproxiesallow_redirects)r^   zContent-Typer_   ),rF   r
   urlr]   copyappendhistorycontentr   r   RuntimeErrorrawreadlenmax_redirectsr   close
startswithjoinr   rM   _replacegeturlnetlocr	   r    rebuild_methodstatus_coder   temporary_redirectpermanent_redirectrB   popbodyr   _cookiesr   cookiesprepare_cookiesrebuild_proxiesrebuild_auth_body_positionr"   send)rD   rE   reqra   rb   rc   rd   re   yield_requestsadapter_kwargshistrg   previous_fragmentprepared_requestparsed_rurlparsedpurged_headersheaderrB   
rewindables   &&&&&&&&&,          r2   resolve_redirects&SessionRedirectMixin.resolve_redirects   sR     &&t,$SWW-66c"xxz KK8DL4 4<< D$6$66& 2 23;?$ 
 JJL ~~d##&txx0hh 01C1C DcJK c]F"$):2CD$*OO!--/C
 ===dhhC(89!#&#3C#8  07 ((((( 
 "Y,F$,,00> -(, %&..GKK$'
 ##3#<#<c88L*33T\\B,,-=-F-FG **+;EG.5
 *88D   G+MM/Bg/M 
 ,- #C	yy	!	 $	 "		
 	 $	 %*	 %	 't||5ExxP ..t4
O  )*>M 4U34s\   ;N4/N4.M; :A%N4 AN4?$N4$-N4E%N48N4N4A N4;2N1-N40N11N4c                   VP                   pVP                  pRV9   d0   V P                  VP                  P                  V4      '       d   VR V P                  '       d   \        V4      MRpVe   VP                  V4       R# R# )zWhen being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss.
AuthorizationN)rB   rg   rV   request	trust_envr   prepare_auth)rD   r   r5   rB   rg   new_auths   &&&   r2   r   !SessionRedirectMixin.rebuild_auth  s~    
 #**""g%$*@*@  #+
 +

 ( +/...>#&d))(3  r:   c                V   VP                   p\        VP                  4      P                  p\	        WV P
                  4      pRV9   d   VR  \        WT,          4      w  rgVP                  R4      '       g   V'       d   V'       d   \        Wg4      VR&   V#   \         d    RRrv LGi ; i)ap  This method re-evaluates the proxy configuration by considering the
environment variables. If we are redirected to a URL covered by
NO_PROXY, we strip the proxy configuration. Otherwise, we set missing
proxy keys for this URL (in case they were stripped by a previous
redirect).

This method also replaces the Proxy-Authorization header where
necessary.

:rtype: dict
zProxy-AuthorizationNrJ   )
rB   r
   rg   rM   r!   r   r   KeyErrorrr   r   )rD   r   re   rB   rM   new_proxiesusernamepasswords   &&&     r2   r   $SessionRedirectMixin.rebuild_proxies.  s     #***../66%&6P G+-.	,!2;3F!GH   ))h8-<X-PG)*  	,!%th	,s   B B('B(c                   VP                   pVP                  \        P                  8X  d
   VR8w  d   RpVP                  \        P                  8X  d
   VR8w  d   RpVP                  \        P
                  8X  d
   VR8X  d   RpW1n         R# )zrWhen being redirected we may want to change the method of the request
based on certain specs or browser behavior.
HEADGETPOSTN)methodrx   r   	see_otherfoundmoved)rD   r   r5   r   s   &&& r2   rw   #SessionRedirectMixin.rebuild_methodM  su     "(( 5??2v7GF 5;;.6V3CF 5;;.6V3CF"(r:    )FNTNNF)__name__
__module____qualname____firstlineno__rF   rV   r   r   r   rw   __static_attributes____classdictcell____classdict__s   @r2   r<   r<   j   s+     (.@yv4(>) )r:   r<   c                      a  ] tR tRt o Rt. ROtR tR tR tR t	RR lt
R	 tR
 tR tRR ltRR ltRR ltR tR tR tR tR tR tR tR tRtV tR# )Sessionid  aT  A Requests session.

Provides cookie persistence, connection-pooling, and configuration.

Basic Usage::

  >>> import requests
  >>> s = requests.Session()
  >>> s.get('https://httpbin.org/get')
  <Response [200]>

Or as a context manager::

  >>> with requests.Session() as s:
  ...     s.get('https://httpbin.org/get')
  <Response [200]>
c                `   \        4       V n        R V n        / V n        \	        4       V n        / V n        RV n        RV n        R V n	        \        V n        RV n        \        / 4      V n        \        4       V n        V P#                  R\%        4       4       V P#                  R\%        4       4       R # )NFTzhttps://zhttp://)r   rB   authre   r   hooksparamsra   rc   rd   r   rp   r   r   r~   r   adaptersmountr   rD   s   &r2   __init__Session.__init__  s     '( 	
  #_

    	 4  +2. $

:{}-

9km,r:   c                    V # Nr   r   s   &r2   	__enter__Session.__enter__  s    r:   c                &    V P                  4        R # r   )rq   )rD   argss   &*r2   __exit__Session.__exit__  s    

r:   c                "   VP                   ;'       g    / p\        V\        P                  4      '       g   \	        V4      p\        \        \        4       V P                   4      V4      pVP                  pV P                  '       d0   V'       g(   V P                  '       g   \        VP                  4      p\        4       pVP                  VP                  P                  4       VP                  VP                  VP                   VP"                  \%        VP&                  V P&                  \(        R7      \%        VP*                  V P*                  4      \%        W@P                  4      V\-        VP.                  V P.                  4      R7
       V# )aS  Constructs a :class:`PreparedRequest <PreparedRequest>` for
transmission and returns it. The :class:`PreparedRequest` has settings
merged from the :class:`Request <Request>` instance and those of the
:class:`Session`.

:param request: :class:`Request` instance to prepare with this
    session's settings.
:rtype: requests.PreparedRequest
)r,   )
r   rg   filesdatajsonrB   r   r   r~   r   )r~   r'   r   	CookieJarr   r   r   r   r   r   rg   r   preparer   upperr   r   r   r3   rB   r   r   r9   r   )rD   r   r~   merged_cookiesr   ps   &&    r2   prepare_requestSession.prepare_request  s    //''R '9#6#677)'2G '+-t||<g

 ||>>>$tyyy!'++.D			>>'')--!:M !=tYY/"gmmTZZ8 	 	
 r:   Nc                <   \        VP                  4       TTTT;'       g    / TT;'       g    / VVVR7
      pV P                  V4      pT;'       g    / pV P                  VP                  WW4      pRV	RV
/pVP                  V4       V P                  ! V3/ VB pV# )a  Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object.

:param method: method for the new :class:`Request` object.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the query
    string for the :class:`Request`.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
    object to send in the body of the :class:`Request`.
:param json: (optional) json to send in the body of the
    :class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to send with the
    :class:`Request`.
:param cookies: (optional) Dict or CookieJar object to send with the
    :class:`Request`.
:param files: (optional) Dictionary of ``'filename': file-like-objects``
    for multipart encoding upload.
:param auth: (optional) Auth tuple or callable to enable
    Basic/Digest/Custom HTTP Auth.
:param timeout: (optional) How many seconds to wait for the server to send
    data before giving up, as a float, or a :ref:`(connect timeout,
    read timeout) <timeouts>` tuple.
:type timeout: float or tuple
:param allow_redirects: (optional) Set to True by default.
:type allow_redirects: bool
:param proxies: (optional) Dictionary mapping protocol or protocol and
    hostname to the URL of the proxy.
:param hooks: (optional) Dictionary mapping hook name to one event or
    list of events, event must be callable.
:param stream: (optional) whether to immediately download the response
    content. Defaults to ``False``.
:param verify: (optional) Either a boolean, in which case it controls whether we verify
    the server's TLS certificate, or a string, in which case it must be a path
    to a CA bundle to use. Defaults to ``True``. When set to
    ``False``, requests will accept any TLS certificate presented by
    the server, and will ignore hostname mismatches and/or expired
    certificates, which will make your application vulnerable to
    man-in-the-middle (MitM) attacks. Setting verify to ``False``
    may be useful during local development or testing.
:param cert: (optional) if String, path to ssl client cert file (.pem).
    If Tuple, ('cert', 'key') pair.
:rtype: requests.Response
)
r   rg   rB   r   r   r   r   r   r~   r   rb   rf   )r   r   r   merge_environment_settingsrg   r(   r   )rD   r   rg   r   r   rB   r~   r   r   rb   rf   re   r   ra   rc   rd   r   r   prepsettingssend_kwargsrE   s   &&&&&&&&&&&&&&&&&     r2   r   Session.request  s    ~ <<><<R
 ##C(--R22HHgv
 w
 	8$yy--r:   c                N    VP                  RR4       V P                  ! RV3/ VB # )zSends a GET request. Returns :class:`Response` object.

:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:rtype: requests.Response
rf   Tr   
setdefaultr   rD   rg   kwargss   &&,r2   r6   Session.getQ  s+     	+T2||E31&11r:   c                N    VP                  RR4       V P                  ! RV3/ VB # )zSends a OPTIONS request. Returns :class:`Response` object.

:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:rtype: requests.Response
rf   TOPTIONSr   r   s   &&,r2   optionsSession.options\  s+     	+T2||Is5f55r:   c                N    VP                  RR4       V P                  ! RV3/ VB # )zSends a HEAD request. Returns :class:`Response` object.

:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:rtype: requests.Response
rf   Fr   r   r   s   &&,r2   headSession.headg  s+     	+U3||FC2622r:   c                2    V P                   ! RV3RVRV/VB # )a  Sends a POST request. Returns :class:`Response` object.

:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
    object to send in the body of the :class:`Request`.
:param json: (optional) json to send in the body of the :class:`Request`.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:rtype: requests.Response
r   r   r   r   )rD   rg   r   r   r   s   &&&&,r2   postSession.postr  s$     ||FCHdHHHHr:   c                .    V P                   ! RV3RV/VB # )aE  Sends a PUT request. Returns :class:`Response` object.

:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
    object to send in the body of the :class:`Request`.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:rtype: requests.Response
PUTr   r   rD   rg   r   r   s   &&&,r2   putSession.put  s     ||E3<T<V<<r:   c                .    V P                   ! RV3RV/VB # )aG  Sends a PATCH request. Returns :class:`Response` object.

:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
    object to send in the body of the :class:`Request`.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:rtype: requests.Response
PATCHr   r   r   s   &&&,r2   patchSession.patch  s     ||GS>t>v>>r:   c                *    V P                   ! RV3/ VB # )zSends a DELETE request. Returns :class:`Response` object.

:param url: URL for the new :class:`Request` object.
:param \*\*kwargs: Optional arguments that ``request`` takes.
:rtype: requests.Response
DELETEr   r   s   &&,r2   deleteSession.delete  s     ||Hc4V44r:   c                   VP                  RV P                  4       VP                  RV P                  4       VP                  RV P                  4       RV9  d$   \	        WP
                  V P                  4      VR&   \        V\        4      '       d   \        R4      hVP                  RR4      pVP                  R4      pVP                  pV P                  VP                  R7      p\        4       pVP                   ! V3/ VB p\        4       V,
          p	\#        V	R	7      Vn        \'        R
WX3/ VB pVP(                  '       d?   VP(                   F.  p
\+        V P,                  V
P.                  V
P0                  4       K0  	  \+        V P,                  WP0                  4       V'       d%   V P2                  ! W3/ VB pV U
u. uF  qNK  	  pp
M. pV'       d)   VP5                  ^ V4       VP                  4       pWn        V'       g%    \7        V P2                  ! W3RR/VB 4      Vn        V'       g   VP<                   V# u up
i   \:         d     L(i ; i)z9Send a given PreparedRequest.

:rtype: requests.Response
ra   rc   rd   re   z#You can only send PreparedRequests.rf   T)rg   )secondsr5   r   )r   ra   rc   rd   r!   re   r   r'   r   
ValueErrorr{   r6   r   get_adapterrg   preferred_clockr   r   elapsedr   rj   r   r~   r   rm   r   insertnext_nextStopIterationrk   )rD   r   r   rf   ra   r   adapterstartrr   rE   genrj   s   &&,          r2   r   Session.send  s    	(DKK0(DKK0&$)),F" /t~~ VF9 gw''BCC !**%6=H% ""w{{"3  ! LL+F+ "#e+g.	 *e9&9 999		&t||T\\488L " 	t||Wee< ((>v>C(+,tG,GG NN1a AI **1UdUfU II1 -$ ! s   
I#I IIc                0   V P                   '       d   Ve   VP                  R4      MRp\        WR7      pVP                  4        F  w  rVP	                  W4       K  	  VRJ g   VfQ   \
        P                  P                  R4      ;'       g*    \
        P                  P                  R4      ;'       g    Tp\        W P                  4      p\        W0P                  4      p\        W@P                  4      p\        WPP                  4      pRVRVR	VR
V/# )zF
Check the environment and merge it with some settings.

:rtype: dict
Nno_proxy)r  TREQUESTS_CA_BUNDLECURL_CA_BUNDLEre   ra   rc   rd   )r   r6   r   r)   r   osenvironr3   re   ra   rc   rd   )
rD   rg   re   ra   rc   rd   r  env_proxiesr.   r/   s
   &&&&&&    r2   r   "Session.merge_environment_settings  s     >>>292Ew{{:.4H-cEK#))+""1( ,
 ~JJNN#78  zz~~&67    6v{{3v{{3T99-7HfhPTUUr:   c                    V P                   P                  4        F<  w  r#VP                  4       P                  VP                  4       4      '       g   K:  Vu # 	  \	        RV: 24      h)zf
Returns the appropriate connection adapter for the given URL.

:rtype: requests.adapters.BaseAdapter
z&No connection adapters were found for )r   r)   lowerrr   r   )rD   rg   prefixr   s   &&  r2   r   Session.get_adapter  sT      $}}224OFyy{%%flln55  5
 DSGLMMr:   c                h    V P                   P                  4        F  pVP                  4        K  	  R# )z+Closes all adapters and as such the sessionN)r   valuesrq   )rD   r/   s   & r2   rq   Session.close  s"    %%'AGGI (r:   c                    W P                   V&   V P                    Uu. uF   p\        V4      \        V4      8  g   K  VNK"  	  ppV F+  pV P                   P                  V4      V P                   V&   K-  	  R# u upi )zgRegisters a connection adapter to a prefix.

Adapters are sorted in descending order by prefix length.
N)r   ro   r{   )rD   r  r   r.   keys_to_mover1   s   &&&   r2   r   Session.mount  sf    
 !(f#'==I=aCFS[4H=IC!%!2!23!7DMM#   Js
   A8A8c           	     Z    V P                    Uu/ uF  q\        WR 4      bK  	  ppV# u upi r   )	__attrs__getattr)rD   attrstates   &  r2   __getstate__Session.__getstate__*  s/    =A^^L^Twt400^L Ms   (c                P    VP                  4        F  w  r#\        WV4       K  	  R # r   )r)   setattr)rD   r  r  values   &&  r2   __setstate__Session.__setstate__.  s     ;;=KDD& )r:   )r   r   rd   r~   rB   r   rp   r   re   ra   r   rc   )rB   r~   r   re   r   r   rc   rd   r   ra   r   rp   )NNNNNNNTNNNNNN)NNr   )r   r   r   r   __doc__r  r   r   r   r   r   r6   r   r   r   r   r   r   r   r   r   rq   r   r  r  r   r   r   s   @r2   r   r   d  s~     $I;-z)V[z	2	6	3I
=
?5KZV>N
	8' 'r:   r   c                     \        4       # )a>  
Returns a :class:`Session` for context-management.

.. deprecated:: 1.0.0

    This method has been deprecated since version 1.0.0 and is only kept for
    backwards compatibility. New code should use :class:`~requests.sessions.Session`
    to create a session. This may be removed at a future date.

:rtype: Session
)r   r   r:   r2   sessionr!  3  s     9r:   )<r  r  systimecollectionsr   datetimer   _internal_utilsr   r   r   r   r   compatr   r   r	   r
   r~   r   r   r   r   
exceptionsr   r   r   r   r   r   r   modelsr   r   r   r   status_codesr   
structuresr   utilsr   r   r   r   r   r    r!   r"   r#   r$   platformperf_counterr   r3   r9   r<   r   r!  r   r:   r2   <module>r/     s    
 
  #  - ! ! 9 9   0    +   <<7''OiiO @K < :E Cw) w)tL'" L'^r:   