K i ddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZddlmZddlmZddlmZe j,rddlmZ ddlZdd lmZdd lmZdd lm Z dd l!m"Z"m#Z#m$Z$dd l%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ddl0m1Z1m2Z2ddl3m4Z4e j,rddl5m6Z6ejne8Z9GddZ:Gdde:Z;GddZ<Gdde:Z=e Gdde:Z> ddl?m@Z@dZAGdde:ZBGd$d%e:ZMd-d&ZNGd'd(ZOGd)d*ejZQGd+d,eQZy#e$rddlZYwxYw#e$rdZYwxYw#e$rl ddlCZ@eDeEeFejde@jjZJeJd kred! dZAGd"de:ZBn#eKeeLf$rd#ZAYnwxYwYwxYw).) annotationsN)contextmanager) HTTPMessage) HTTPResponse)timeout)BaseHTTPConnection)util) _TYPE_BODY)HTTPHeaderDict) BaseSSLErrorHTTPConnection HTTPException) BodyNotHttplibCompatible DecodeError HTTPErrorIncompleteReadInvalidChunkLength InvalidHeader ProtocolErrorReadTimeoutErrorResponseNotChunkedSSLError) is_fp_closedis_response_to_head)Retry)HTTPConnectionPoolceZdZddZddZy)ContentDecoderctNNotImplementedErrorselfdatas V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/urllib3/response.py decompresszContentDecoder.decompress7 !##ctr!r"r%s r'flushzContentDecoder.flush:r)r*Nr&bytesreturnr/r0r/)__name__ __module__ __qualname__r(r-r*r'rr6s $$r*rc$eZdZddZddZddZy)DeflateDecodercRd|_d|_tj|_y)NTr*) _first_try_datazlib decompressobj_objr,s r'__init__zDeflateDecoder.__init__?s  &&( r*c|s|S|js|jj|S|xj|z c_ |jj|}|rd|_d|_|S#tj $rbd|_t j tj |_ |j|jd|_cYS#d|_wxYwwxYw)NF)r9r=r(r:r;errorr< MAX_WBITS)r%r& decompresseds r'r(zDeflateDecoder.decompressDsK99''- - d  "99//5L"'!  zz "#DO**DNN?;DI "tzz2! T  "s%,A//AC$3C C$ C  C$c6|jjSr!r=r-r,s r'r-zDeflateDecoder.flushZyy  r*Nr0Noner.r1r2r3r4r>r(r-r5r*r'r7r7>s) ",!r*r7ceZdZdZdZdZy)GzipDecoderStaterrN)r2r3r4 FIRST_MEMBER OTHER_MEMBERS SWALLOW_DATAr5r*r'rJrJ^sLMLr*rJc$eZdZddZddZddZy) GzipDecoderctjdtjz|_tj |_yN)r;r<rAr=rJrL_stater,s r'r>zGzipDecoder.__init__es*&&rDNN':; &33 r*c$t}|jtjk(s|s t |S ||j j |z }|j j}|s t |Stj|_tjdtjz|_#tj$rC|j}tj|_|tjk(r t |cYSwxYwrR) bytearrayrTrJrNr/r=r(r;r@rM unused_datar<rA)r%r&retprevious_states r'r(zGzipDecoder.decompressisk ;;*77 7t:  tyy++D1199((DSz!*88DK**2+>?DI:: !%.;; !%5%C%CC :% sB99AD Dc6|jjSr!rDr,s r'r-zGzipDecoder.flush~rEr*NrFr.r1rHr5r*r'rPrPds4@*!r*rPceZdZddZddZy) BrotliDecoderctj|_t|jdr"t |d|jj yt |d|jj y)Nr()brotli Decompressorr=hasattrsetattrr(processr,s r'r>zBrotliDecoder.__init__sL++-DItyy,/lDII,@,@AlDII,=,=>r*cdt|jdr|jjSy)Nr-r*)r`r=r-r,s r'r-zBrotliDecoder.flushs$tyy'*yy((r*NrFr1)r2r3r4r>r-r5r*r'r\r\s  ? r*r\)zstdTc$eZdZddZddZddZy) ZstdDecoderc6tj|_yr!)rdZstdDecompressorr=r,s r'r>zZstdDecoder.__init__s--/DIr*c|sy|jj|g}|jjr|jjr|jj}t j |_|j |jj||jjr|jjrdj|SNr*)r=r(eofrWrdrhappendjoinr%r& data_partsrWs r'r(zZstdDecoder.decompresss))..t45J))--DII$9$9"ii33  113 !!$))"6"6{"CD))--DII$9$988J' 'r*cF|jjs tdy)NZstandard data is incompleter*)r=rkrr,s r'r-zZstdDecoder.flushs99==!"@AAr*NrFr.r1rHr5r*r'rfrfs 0 ( r*rfz^([0-9]+)\.([0-9]+))rz!zstandard module doesn't have eofc$eZdZddZddZddZy)rfcRtjj|_yr!)rdrhr<r=r,s r'r>zZstdDecoder.__init__s 113AAC r*c|sy|jj|g}|jjr|jjr|jj}t j j |_|j|jj||jjr|jjrdj|Srj) r=r(rkrWrdrhr<rlrmrns r'r(zZstdDecoder.decompresss"ii22489 iimm (=(="&))"7"7K $ 5 5 7 E E GDI%%dii&:&:;&GHiimm (=(=xx ++r*c||jj}|jjs td|S)Nrq)r=r-rkr)r%rXs r'r-zZstdDecoder.flushs.iioo'yy}}%&DEE r*NrFr.r1rHr5r*r'rfrfs D , r*Fc(eZdZdZddZddZddZy) MultiDecodera From RFC7231: If one or more encodings have been applied to a representation, the sender that applied the encodings MUST generate a Content-Encoding header field that lists the content codings in the order in which they were applied. c|jdDcgc]}t|jc}|_ycc}w)N,)split _get_decoderstrip _decoders)r%modesms r'r>zMultiDecoder.__init__s+;@;;s;KLa,qwwy1LLs =c<|jdjSNr)r~r-r,s r'r-zMultiDecoder.flushs~~a &&((r*c\t|jD]}|j|}|Sr!)reversedr~r()r%r&ds r'r(zMultiDecoder.decompresss-$..) &A<<%D & r*N)rstrr0rGr1r.)r2r3r4__doc__r>r-r(r5r*r'rxrxsM)r*rxcd|vr t|S|dvr tSt|dk(r tStr|dk(r t St S)Nrz)gzipx-gzipbrrd)rxrPr^r\HAS_ZSTDrfr7)modes r'r|r|sU d{D!! !!} ddlDFN}  r*c8eZdZdZddZd dZd dZd dZd dZy) BytesQueueBuffera Memory-efficient bytes buffer To return decoded data in read() and still follow the BufferedIOBase API, we need a buffer to always return the correct amount of bytes. This buffer should be filled using calls to put() Our maximum memory usage is determined by the sum of the size of: * self.buffer, which contains the full data * the largest chunk that we will copy in get() The worst case scenario is a single chunk, in which case we'll make a full copy of the data inside get(). cDtj|_d|_yr) collectionsdequebuffer_sizer,s r'r>zBytesQueueBuffer.__init__s+6+<+<+>  r*c|jSr!)rr,s r'__len__zBytesQueueBuffer.__len__s zzr*cv|jj||xjt|z c_yr!)rrlrlenr$s r'putzBytesQueueBuffer.puts& 4  c$i r*cd|dk(ry|js td|dkr tdd}tj}||kr||z }|jj }t |}||kr\|d|||d}}|j||jj||xj|zc_ |jS|j||xj|zc_ ||z }|js |jS||kr|jS)Nrr*zbuffer is emptyzn should be > 0) r RuntimeError ValueErrorioBytesIOpopleftrwrite appendleftrgetvalue) r%nfetchedrX remainingchunk chunk_length left_chunk right_chunks r'getzBytesQueueBuffer.gets 601 1 U./ /jjlkG IKK'')Eu:L<'*/ *;U9:=NK  *% &&{3 i' ||~ %  l* | #G;;||~%k$||~r*c4|js|jdk(sJytdk(rj}nPt j }|j fdttD|j}d|_|S)Nrr*rc3>K|]}jywr!)r).0_rs r' z+BytesQueueBuffer.get_all..@sH6>>+Hs) rrrpoprr writelinesranger)r%resultrXrs @r'get_allzBytesQueueBuffer.get_all7sv::? "? v;! ZZ\F**,C NNHU3v;5GH H\\^F  r*NrFr0int)r&r/r0rG)rrr0r/r1) r2r3r4rr>rrrrr5r*r'rrs   < r*rcXeZdZUgdZeedgz Zeredgz ZgdZeejfZ de d<ee ejfz Z ere e jfz Z ddd d"d Zd#d Zed$d Zd%d Zed&d Zej(d'dZed(dZed)dZej(d*dZ d+ d,dZ d- d.dZ d/ d0dZ d/ d,dZd1dZd1dZd1dZd1dZd1dZ d2dZ d$dZ!d3dZ"d4dZ#d5d6dZ$d4d Z%d&d!Z&y)7BaseHTTPResponse)rrdeflateNrrd)i-i.i/i3i4ztuple[type[Exception], ...]DECODER_ERROR_CLASSES)headersretriesc~t|tr||_nt||_||_||_||_||_||_d|_||_ ||_ d|_ |jjddj} d| jdD} d| vrd|_ d|_|y)NFztransfer-encodingc3<K|]}|jywr!)r})rencs r'rz,BaseHTTPResponse.__init__..qs>SSYY[>srzchunkedT) isinstancer rstatusversionversion_stringreasondecode_content_has_decoded_content _request_urlrrrlowerr{_decoder) r%rrrrrr request_urlrtr_enc encodingss r'r>zBaseHTTPResponse.__init__Us g~ ."DL)'2DL  , ,$)!(3  !!"5r:@@B>FLL,=>  !DL/3  r*cj|j|jvr|jjdSy)a Should we redirect and where to? :returns: Truthy redirect location string if we got a redirect status code and valid location. ``None`` if redirect status and no location. ``False`` if not a redirect status code. locationF)rREDIRECT_STATUSESrrr,s r'get_redirect_locationz&BaseHTTPResponse.get_redirect_locationxs. ;;$00 0<<##J/ /r*ctr!r"r,s r'r&zBaseHTTPResponse.data !##r*cb|jjd}tj|S)a Deserializes the body of the HTTP response as a Python object. The body of the HTTP response must be encoded using UTF-8, as per `RFC 8529 Section 8.1 `_. To use a custom JSON decoder pass the result of :attr:`HTTPResponse.data` to your custom decoder instead. If the body of the HTTP response is not decodable to UTF-8, a `UnicodeDecodeError` will be raised. If the body of the HTTP response is not a valid JSON document, a `json.JSONDecodeError` will be raised. Read more :ref:`here `. :returns: The body of the HTTP response as a Python object. zutf-8)r&decode_jsonloadsr$s r'jsonzBaseHTTPResponse.jsons'$yy({{4  r*ctr!r"r,s r'urlzBaseHTTPResponse.urlrr*ctr!r"r%rs r'rzBaseHTTPResponse.urlrr*ctr!r"r,s r' connectionzBaseHTTPResponse.connectionrr*c|jSr!)_retriesr,s r'rzBaseHTTPResponse.retriess }}r*cj|*|jr|jdj|_||_y)N)historyredirect_locationrr)r%rs r'rzBaseHTTPResponse.retriess-  7??r*<CIIK == 4#8#88 ,-= > ((.33C8wwyD$9$99GGI  $01A$BDM ) !s-3B8cf|s|jr td|S |jr"|jj|}d|_|r||jz }|S#|j$r?}|j j ddj}td|z||d}~wwxYw)zN Decode the data passed in and potentially flush the decoder. _Calling read(decode_content=False) is not supported after read(decode_content=True) was called.TrrzEReceived response with content-encoding: %s, but failed to decode it.N) rrrr(rrrrr_flush_decoder)r%r&r flush_decoderrrs r'_decodezBaseHTTPResponse._decodes (("<K }}}}//5,0)  D'') )D )) #||//0BBGMMO ')9:   s.A""B01:B++B0c|jr6|jjd|jjzSy)zk Flushes the decoder. Should only be called if the decoder is actually being used. r*)rr(r-r,s r'rzBaseHTTPResponse._flush_decoder s5 ====++C04==3F3F3HH Hr*c|jt|}t|dk(ry||dt|t|Sr)rr)r%btemps r'readintozBaseHTTPResponse.readintos;yyQ  t9>!AkD Nt9 r*cRtjdtd|jS)Nz|HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.6.0. Instead access HTTPResponse.headers directly.rKcategory stacklevel)warningswarnDeprecationWarningrr,s r' getheaderszBaseHTTPResponse.getheaderss&  O'  ||r*crtjdtd|jj ||S)NzHTTPResponse.getheader() is deprecated and will be removed in urllib3 v2.6.0. Instead use HTTPResponse.headers.get(name, default).rKr )rrrrr)r%namedefaults r' getheaderzBaseHTTPResponse.getheader(s3  V'  ||g..r*c|jSr!)rr,s r'infozBaseHTTPResponse.info2s ||r*c|jSr!)rr,s r'geturlzBaseHTTPResponse.geturl5s xxr*)r>typing.Mapping[str, str] | typing.Mapping[bytes, bytes] | Nonerrrrrrr str | Nonerboolrrr Retry | Noner0rG)r0z"str | None | typing.Literal[False]r1)r0z typing.Anyr0r)rrr0rG)r0zBaseHTTPConnection | None)r0r)rrr0rGiN)r int | Noner bool | Noner0typing.Iterator[bytes]NNFrr rr!rrr0r/NNrr rr!r0r/rF)r&r/rr!rrr0r/)rrVr0r)r0r r!)rrrrr0r)'r2r3r4rr^rrIOErrorr;r@r__annotations__rd ZstdErrorr>rpropertyr&rrsetterrrrrrrrrrrrrrr rrrrr5r*r'rrFsr4 TF"VH$1:A4::9N6N &,,0$..!22 SW!%!*P!* !*  !*  !*!*!* !*!* !*F $$!*$$ ZZ$$$$ ^^  FJ$$7B$ $&*# $ $$$ $  $&*$ $$$  $&*$ $$$ $$$$$C&+6GK </r*rceZdZdZ d d fd Zd!dZd!dZed"dZed#dZ d$dZ d%dZ d&d Z e d'd Z d(d d  d)d Z d(d d  d)dZ d* d+dZ d, d-dZ d. d/dZd$dZd!dZd!dZed$dZd%dZd!dZd$dZd!dZd0dZ d, d/dZed1dZej>d2dZd3dZ xZ!S)4ra HTTP Response container. Backwards-compatible with :class:`http.client.HTTPResponse` but the response ``body`` is loaded and decoded on-demand when the ``data`` property is accessed. This class is also compatible with the Python standard library's :mod:`io` module, and can hence be treated as a readable object in the context of that framework. Extra parameters for behaviour not present in :class:`http.client.HTTPResponse`: :param preload_content: If True, the response's body will be preloaded during construction. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param original_response: When this HTTPResponse wrapper is generated from an :class:`http.client.HTTPResponse` object, it's convenient to include the original for debug purposes. It's otherwise unused. :param retries: The retries contains the last :class:`~urllib3.util.retry.Retry` that was used during the request. :param enforce_content_length: Enforce content length checking. Body returned by server must match value of Content-Length header, if present. Otherwise, raise error. c t||||||||| ||_||_d|_d|_| |_d|_| |_|rt|ttfr||_| |_ | |_ t|dr||_||_d|_|j#||_t'|_|r%|js|j+||_yyy)N)rrrrrrrrrrr)superr>enforce_content_length auto_close_body_fp_original_response_fp_bytes_readmsgrrr/_pool _connectionr`_sock_shutdown chunk_left _init_lengthlength_remainingr_decoded_bufferr)r%bodyrrrrrpreload_contentroriginal_responsepoolrr6rr0request_methodrr1 sock_shutdown __class__s r'r>zHTTPResponse.__init__Zs* ))#  '=#$ 04"3 Jtc5\2DJ % 4 DH+'+!% 1 1. A 01 4::.ADJ$.?r*c|jr |jsy|jj|jd|_yr!)r7r8 _put_connr,s r'rzHTTPResponse.release_conns4zz!1!1 T--.r*cd |jy#ttttf$rYywxYw)z Read and discard any remaining HTTP response data in the response connection. Unread data in the HTTPResponse connection blocks the connection from being released back to the pool. N)rrOSErrorr rr,s r'rzHTTPResponse.drain_conns+   IIK7L-@   s //cp|jr |jS|jr|jdSy)NT)r)r2r3rr,s r'r&zHTTPResponse.datas0 ::::  8899490 0r*c|jSr!)r8r,s r'rzHTTPResponse.connectionsr*c,t|jSr!)rr3r,s r'isclosedzHTTPResponse.isclosedsDHH%%r*c|jS)z Obtain the number of bytes pulled over the wire so far. May differ from the amount of content returned by :meth:``urllib3.response.HTTPResponse.read`` if bytes are encoded on the wire (e.g, compressed). )r5r,s r'tellzHTTPResponse.tells """r*c|jjd}|~|jrtj dy |j dDchc] }t |}}t|dkDrtd|z|j}|dkrd}nd} t |j}|dvsd |cxkrd ksn|d k(rd}|Scc}w#t$rd}YBwxYw#t$rd}Y=wxYw) zM Set initial length value for Response content if available. zcontent-lengthNzReceived response with both Content-Length and Transfer-Encoding set. This is expressly forbidden by RFC 7230 sec 3.3.2. Ignoring Content-Length and attempting to process response as Transfer-Encoding: chunked.rzrz8Content-Length contained multiple unmatching values (%s)r)i0dHEAD) rrrlogwarningr{rrrrrr)r%rBcontent_lengthvallengthslengthrs r'r;zHTTPResponse._init_lengths &*\\%5%56F%G  %||  " 0>/C/CC/HI3s8IIwJ**++113 ##$$**,&&4+B+B+K+K+M!!#,N&a! S'tzz49JKQRR S-SV;"1+1,&tzz49JKQRR! 3JJ* - qyyj0=C/u5C#C+2!7+ K#&9!$?CJ K**++113 ##$$**,&&4+B+B+K+K+M!!#,N&s_G:BE/BG: E,B55 E,1C22 E,>AEE,E''E,,E//BG77G:Frc|jsJd}|r||kDs||jr|j|kDrtjstj dkr|r|jj |Stj}d}||dk7r_|t||}||z}n|}|jj|}|s |jS|j|~|Y|dk7r_|jS|r7||jj |S|jj S||jj|S|jjS)aX Read a response with the thought that reading the number of bytes larger than can fit in a 32-bit int at a time via SSL in some known cases leads to an overflow error that has to be prevented if `amt` or `self.length_remaining` indicate that a problem may happen. The known cases: * CPython < 3.9.7 because of a bug https://github.com/urllib3/urllib3/issues/2513#issuecomment-1152559900. * urllib3 injected with pyOpenSSL-backed SSL-support. * CPython < 3.10 only when `amt` does not fit 32-bit int. i) ir) r3r<r IS_PYOPENSSLsys version_inforrrminrrr)r%rr c_int_maxr max_chunk_amt chunk_amtr&s r'_fp_readzHTTPResponse._fp_read@sH&xxx S9_ ))))I5  C$4$4w$>xx~~i00ZZ\F"M+? #C 7I9$C -Ixx}}Y/??$ $ T"+??$ $ *-/488>>#& Otxx~~?O O*-488==% Mdhhmmo Mr*c|jyt|jdd}|j5|s|j||nd}|h|dk7rc|sa|jj |j rv|j j|j dk7r[t|j|j |r9|dk7r|r|j t|k(r|jj dddrH|xjt|z c_|j |xj t|zc_|S#1swYUxYw)z7 Reads `amt` of bytes from the socket. NclosedFrar*r) r3getattrr`rlrr0r<rr5r)r%rr fp_closedr&s r' _raw_readzHTTPResponse._raw_readys$ 88 DHHh6  " !:C4==E=2D3!8D //--9--2))<)S>STT$4+@+@CI+M  = !@    3t9 , $$0%%T2% I ! !s B=EEc.|j| |j}|r|dkrd}n7|5d}t|j|k\r|jj |S|j |}|duxs |dk7xr| }|st|jdk(r|S||j |||}|r||_|S|s|jr td|S|j |||}|jj|t|j|kr\|rZ|j |}|j |||}|jj|t|j|kr|rZ|jj |}|S)aT Similar to :meth:`http.client.HTTPResponse.read`, but with two additional parameters: ``decode_content`` and ``cache_content``. :param amt: How much of the content to read. If specified, caching is skipped because it doesn't make sense to cache partial content as the full response. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param cache_content: If True, will save the returned data such that the same result is returned despite of the state of the underlying file object. This is useful if you want the ``.data`` property to continue working after having ``.read()`` the file object. (Overridden if ``amt`` is set.) NrFr) rrrr=rrqrr2rrr)r%rrrr&r decoded_datas r'rzHTTPResponse.reads4   !!00N 37C _!M4''(C/++//44~~c"t >q(=X D001Q6K ;<<nmDD! . )",,&@ <<nmLL  $ $\ 2d**+c1d~~c*#||D.-P $$((6 d**+c1d''++C0D r*cb| |j}|r|dkrd}|jr\|s tdt|jdkDr7||jj S|jj |S|dk(ry|j|d}|r||S|j | }|j|||}|jj||s|rn|jdd}J||jj S|jj |S)a Similar to ``http.client.HTTPResponse.read1`` and documented in :meth:`io.BufferedReader.read1`, but with an additional parameter: ``decode_content``. :param amt: How much of the content to read. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. NrzaCalling read1(decode_content=False) is not supported after read1(decode_content=True) was called.r*Trai ) rrrrr=rrrqrrr)r%rrr&rrss r'rzHTTPResponse.read1s?"  !!00N 37C  $ $!"=4''(1,;//7799++//44 !8~~c~.K  $HM<<nmLL  $ $\ 2}>>$d>3D  ;''//1 1##'',,r*c#lK|jr,|jr|j||Ed{yt|jrt |j dkDrI|j||}|r|t|js/t |j dkDrHyy7|w)a_ A generator wrapper for the read() method. A call will block until ``amt`` bytes have been read from the connection or until the connection is closed. :param amt: How much of the content to read. The generator will return up to much data per iteration, but may return less. This is particularly likely when using compressed data. However, the empty string will never be returned. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. r.Nr)rr)rsupports_chunked_readsrrr3rr=r)r%rrr&s r'rzHTTPResponse.stream-s$ <># #7+ !r*c.t|jdS)a Checks if the underlying file-like object looks like a :class:`http.client.HTTPResponse` object. We do this by testing for the fp attribute. If it is present we assume it returns raw chunks as processed by read_chunked(). fp)r`r3r,s r'rvz#HTTPResponse.supports_chunked_readsstxx&&r*c$|jy|jjj}|j ddd} t |d|_y#t $r,|j|r t||dtddwxYw)N;rrrSzResponse ended prematurely) r:r3rreadliner{rrrrr)r%lines r'_update_chunk_lengthz!HTTPResponse._update_chunk_lengths ?? &xx{{##%zz$"1% L!$mDO L JJL(t4$>$$@AtK Ls A5Bcnd}|K|jj|j}|}|jjdd|_|S|jB||jkr3|jj|}|j|z |_|}|S||jk(rA|jj|}|jjdd|_|}|S|jj|j}|jjdd|_|S)NrK)r3 _safe_readr:)r%rreturned_chunkrvalues r' _handle_chunkzHTTPResponse._handle_chunks ;HH''8E"N HH   ""DO__ (S4??-BHH'',E"oo3DO"NDOO #HH'',E HH   ""DO"N "XX00AN HH   ""DOr*c#XK|j|js td|js t d|j 5|j r9t|j r$|j j dddy|jj dddy|r|dkrd} |j|jdk(rn,|j|}|j||d}|r|L|r|j}|r||j:|jjj!}|sn|dk(rn |j:|j r|j jdddy#1swYyxYww)a Similar to :meth:`HTTPResponse.read`, but with an additional parameter: ``decode_content``. :param amt: How much of the content to read. If specified, caching is skipped because it doesn't make sense to cache partial content as the full response. :param decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. zHResponse is not chunked. Header 'transfer-encoding: chunked' is missing.zkBody should be http.client.HTTPResponse like. It should have have an fp attribute which returns raw chunks.NrF)rrs )rrrrvrr`r4rrr3rrr:rrrr)r%rrrdecodedrs r'rzHTTPResponse.read_chunkeds ||$B **,*P   ". 0&&+>t?V?V+W''--/ . 0. 0xx{{". 0. 0sQw))+??a'**3/,,.'!M--/!M((&xx{{++-7? ((&&&''--/]. 0. 0. 0s=AF*=F F*F2 F*;B3F/&F F*F'#F*c|jS)z Returns the URL that was the source of this response. If the request that generated this response redirected, this method will return the final redirect location. rr,s r'rzHTTPResponse.urls   r*c||_yr!rrs r'rzHTTPResponse.urls r*c#.Kg}|jdD]d}d|vrM|jd}dj||dzdz|ddD] }|dz |dr|dg}Qg}T|j|f|rdj|yyw)NTr. r*rrr)rr{rmrl)r%rrchunksxs r'__iter__zHTTPResponse.__iter__ s [[[5 %E~U+hhv&2U::"$Ae)O$":$Rj\FF e$ % ((6" " sBB)rNrrzHTTP/?NTTNNNNNTNNTN)&r>r rrrrrrrrrrr?rrrr@z_HttplibHTTPResponse | NonerAzHTTPConnectionPool | NonerHTTPConnection | Noner6z_HttplibHTTPMessage | Nonerrr0rrBrrrr1rrCz#typing.Callable[[int], None] | Noner0rGrFr1)r0r)r0rr)rBrr0r )r0ztyping.Generator[None]r!)rr rrr0r/r#r$r%r&r)rr rr!r0ztyping.Generator[bytes])rr r0r/r)rrr0rG)r0r")"r2r3r4rr>rrr*r&rrLrNr;rr`rlrqrrrrxrrrnrr-rvrrrrr+r __classcell__)rDs@r'rr9sDRV&! $#9=*.,0*. $'+%)"&=A'>B>BP>B >B  >B  >B>B>B>B7>B(>B*>B(>B>B!%>B #!>B" #>B$%>B&;'>B( )>B@    &#6p?$?$F7N 7N 7N 7N  7Nv2 2 2 2  2l&*# H H$H H  HX&*4- 4-$4-  4-nFJ7B 8, "   $'L$.EIK0K06AK0 K0Z!! ZZ  #r*r)rrr0r)R __future__rrrrrloggingrerzrftypingrr; contextlibr http.clientr_HttplibHTTPMessager_HttplibHTTPResponserr[ TYPE_CHECKING_base_connectionr brotlicffir^ ImportErrorrr r _collectionsr rr rr exceptionsrrrrrrrrrr util.responserr util.retryrconnectionpoolr getLoggerr2rTrr7rJrPr\ compressionrdrrf zstandardtuplemaprsearch __version__groups _zstd_versionAttributeErrorrrxr|rr}rr5r*r'rs"   %:<+ 4# ((CC   = 2g!$$!^!@ !.!< "> Hnv>*$FFRpryypfb ##b #C  Fh%$  YRYY5t7G7GHOOQ R  7 "AB B #  .  K 4%saE =E' EEEEE$#E$'G-A G7G GGGGG