Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_decoders.cpython-313.pyc96 linesDownload Raw Back to __pycache__
1�

2��j	/����SrSSKJr SSKrSSKrSSKrSSKrSSKJr SSK	r	SSKr"SS5r
"SS	\
5r"S3S\
5r"SS
\
5r"SS\
5r"SS\
5r"SS\
5r"SS5r"SS5r"SS5r"SS5r\\\\\S.r\	c\R3S5 \c\R3S5 gg!\4a SSKr	N�!\5a Sr	N�f=ff=f!\6a SrN�f=f)zq7Handlers for Content-Encoding.8 9See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding10�)�annotationsN�)�
DecodingErrorc�(�\rSrSrSSjrSSjrSrg)�ContentDecoder�$c��[5e�N��NotImplementedError��self�datas  �AD:\code\apps\devtools\python\Lib\site-packages\httpx/_decoders.py�decode�ContentDecoder.decode%���!�#�#�c��[5er11r�rs r�flush�ContentDecoder.flush(rr�N�r�bytes�returnr�rr)�__name__�12__module__�__qualname__�__firstlineno__rr�__static_attributes__rrrrr$s��$�$rrc�,�\rSrSrSrSSjrSSjrSrg)	�IdentityDecoder�,z13Handle unencoded data.14c��U$r15rr
s  rr�IdentityDecoder.decode1s���rc��g�Nrrrs rr�IdentityDecoder.flush4s��rrNrr)rrr r!�__doc__rrr"rrrr$r$,s����rr$c�6�\rSrSrSrSSjrS	SjrS16SjrSrg)�DeflateDecoder�8zN17Handle 'deflate' decoding.18 19See: https://stackoverflow.com/questions/183869920c�F�SUl[R"5Ulg�NT)�
first_attempt�zlib�
decompressobj�decompressorrs r�__init__�DeflateDecoder.__init__?s��!��� �.�.�0��rc�P�URnSUlURRU5$![RaanU(a@[R21"[R*5UlURU5sSnA$[[U55UeSnAff=f�NF)22r1r4�23decompressr2�errorr3�	MAX_WBITSrr�str)rr�was_first_attempt�excs    rr�DeflateDecoder.decodeCs��� �.�.��"���	3��$�$�/�/��5�5���z�z�	3� �$(�$6�$6�����$G��!��{�{�4�(�(���C��)�s�2��		3�s"�0�B%�AB �B%�B � B%c��URR5$![Ran[	[U55UeSnAff=fr24�r4rr2r:rr<�rr>s  rr�DeflateDecoder.flushN�A��	3��$�$�*�*�,�,���z�z�	3���C��)�s�2��	3����A25�A�A26)r4r1N�r�Nonerr�	rrr r!r+r5rrr"rrrr-r-8s���1�	3�3rr-c�6�\rSrSrSrSSjrS	SjrS27SjrSrg)�GZipDecoder�UzK28Handle 'gzip' decoding.29 30See: https://stackoverflow.com/questions/183869931c�\�[R"[RS-5Ulg)N�)r2r3r;r4rs rr5�GZipDecoder.__init__\s�� �.�.�t�~�~��/B�C��rc��URRU5$![Ran[	[U55UeSnAff=fr32)r4r9r2r:rr<�rrr>s   rr�GZipDecoder.decode_sC��	3��$�$�/�/��5�5���z�z�	3���C��)�s�2��	3�s��A�A�Ac��URR5$![Ran[	[U55UeSnAff=fr33rArBs  rr�GZipDecoder.flusherDrE)r4NrFrrrHrrrrJrJUs���D�3�3rrJc�6�\rSrSrSrSSjrS	SjrS34SjrSrg)�
BrotliDecoder�la<35Handle 'brotli' decoding.36 37Requires `pip install brotlipy`. See: https://brotlipy.readthedocs.io/38    or   `pip install brotli`. See https://github.com/google/brotli39Supports both 'brotlipy' and 'Brotli' packages since they share an import40name. The top branches are for 'brotlipy' and bottom branches for 'Brotli'41c��[c[S5Se[R"5UlSUlU [URS5(aURRUlgURRUlg)Nz�Using 'BrotliDecoder', but neither of the 'brotlicffi' or 'brotli' packages have been installed. Make sure to install httpx using `pip install httpx[brotli]`.Fr9)	�brotli�ImportError�Decompressorr4�	seen_data�hasattrr9�_decompress�processrs rr5�BrotliDecoder.__init__vsy���>��P���	
�#�/�/�1��������4�$�$�l�3�3�#�0�0�;�;�D�� $�0�0�8�8�D�rc��U(dgSUlURU5$![Ran[	[U55UeSnAff=f�NrT)r[r]rXr:rr<rPs   rr�BrotliDecoder.decode�sJ�������	3��#�#�D�)�)���|�|�	3���C��)�s�2��	3�s�"�A�A�Ac���UR(dg[URS5(aURR5 g![R42an[
[U55UeSnAff=f)Nr�finish)r[r\r4rdrXr:rr<rBs  rr�BrotliDecoder.flush�s`���~�~��43	3��t�(�(�(�3�3��!�!�(�(�*����|�|�	3���C��)�s�2��	3�s�5A44�45A8�A3�3A8)r]r4r[NrFrrrHrrrrUrUls���9�$3�
3rrUc�6�\rSrSrSrSSjrS	SjrS46SjrSrg)�ZStandardDecoder�z�47Handle 'zstd' RFC 8878 decoding.48 49Requires `pip install zstandard`.50Can be installed as a dependency of httpx using `pip install httpx[zstd]`.51c��[c[S5Se[R"5R5UlSUlg)NzXUsing 'ZStandardDecoder', ...Make sure to install httpx using `pip install httpx[zstd]`.F)�	zstandardrY�ZstdDecompressorr3r4r[rs rr5�ZStandardDecoder.__init__�sC�����N���
�52&�6�6�8�F�F�H�����rc���[ceSUl[R"5nUR	UR53R
U55 UR54R(a�UR55R(a�UR56Rn[R"5R5UlUR	UR57R
U55 UR58R(aUR59R(aM�UR5$![Ran[[U55UeSnAff=fr0)rjr[�io�BytesIO�writer4r9�eof�unused_datarkr3�	ZstdErrorrr<�getvalue)rr�outputrrr>s     rr�ZStandardDecoder.decode�s���$�$�$���������	3��L�L��*�*�5�5�d�;�<��#�#�'�'�D�,=�,=�,I�,I�"�/�/�;�;��$-�$>�$>�$@�$N�$N�$P��!����T�.�.�9�9�+�F�G��#�#�'�'�D�,=�,=�,I�,I�,I���� � ���"�"�	3���C��)�s�2��	3�s�C>D7�7E%�E � E%c��UR(dgURR5nURR(d[	S5e[U5$)NrzZstandard data is incomplete)r[r4rrqrr)r�rets  rr�ZStandardDecoder.flush�sE���~�~�����%�%�'��� � �$�$�� >�?�?��S�z�r)r4r[NrFrrrHrrrrgrg�s����!�rrgc�6�\rSrSrSrSSjrS	SjrS60SjrSrg)�MultiDecoder��z=61Handle the case where multiple encodings have been applied.62c�6�[[U55Ulg)zU63'children' should be a sequence of decoders in the order in which64each was applied.65N)�list�reversed�children)rr�s  rr5�MultiDecoder.__init__�s���X�h�/�0��
rc�N�URHnURU5nM U$r66)r�r�rr�childs   rr�MultiDecoder.decode�s#���]�]�E��<�<��%�D�#��rc�t�SnURH%nURU5UR5-nM' U$r))r�rrr�s   rr�MultiDecoder.flush�s3�����]�]�E��<�<��%����
�5�D�#��r)r�N)r�ztyping.Sequence[ContentDecoder]rrGrrrHrrrr{r{�s���1��67rr{c�:�\rSrSrSrSS	SjjrS68SjrSSjrSrg)�ByteChunker��z669Handles returning byte content in fixed-size chunks.70Nc�D�[R"5UlXlgr71)rnro�_buffer�_chunk_size�r�72chunk_sizes  rr5�ByteChunker.__init__�s���z�z�|���%�rc���URcU(aU/$/$URRU5 URR5UR:�GaURR	5n[S[
U5UR5Vs/sHnX#X0R-PM nn[
US5UR:Xa7URRS5 URR5 U$URRS5 URRUS5 URR5 USS$/$s snf�Nr������	r�r�rp�tellrt�range�len�seek�truncate�r�content�value�i�chunkss     rr�ByteChunker.decode��,�����#� '�G�9�/�R�/������7�#��<�<����$�"2�"2�2��L�L�)�)�+�E��q�#�e�*�d�.>�.>�?��?�A��!�.�.�.�/�?�
���6�"�:��$�"2�"2�2����!�!�!�$����%�%�'��
����!�!�!�$����"�"�6�"�:�.����%�%�'��c�r�{�"��I����E#c��URR5nURRS5 URR5 U(aU/$/$�Nr�r�rtr�r��rr�s  rr�ByteChunker.flush�E�����%�%�'�������!����������w�'�R�'r�r�r�r73�r�z74int | NonerrG)r�rr�list[bytes])rr�rHrrrr�r������&��.(rr�c�:�\rSrSrSrSS	SjjrS75SjrSSjrSrg)�TextChunkeriz676Handles returning text content in fixed-size chunks.77Nc�D�[R"5UlXlgr78)rn�StringIOr�r�r�s  rr5�TextChunker.__init__s���{�{�}���%�rc���URcU(aU/$/$URRU5 URR5UR:�GaURR	5n[S[
U5UR5Vs/sHnX#X0R-PM nn[
US5UR:Xa7URRS5 URR5 U$URRS5 URRUS5 URR5 USS$/$s snfr�r�r�s     rr�TextChunker.decoder�r�c��URR5nURRS5 URR5 U(aU/$/$r�r�r�s  rr�TextChunker.flush+r�rr�r79r�)r�r<r�	list[str]�rr�rHrrrr�r�r�rr�c�:�\rSrSrSrSS	SjjrS80SjrSSjrSrg)�TextDecoderi2z081Handles incrementally decoding bytes into text82c�B�[R"U5"SS9Ulg)N�replace)�errors)�codecs�getincrementaldecoder�decoder)r�encodings  rr5�TextDecoder.__init__7s���3�3�H�=�Y�O��rc�8�URRU5$r83�r�rr
s  rr�TextDecoder.decode:s���|�|�"�"�4�(�(rc�:�URRSS5$rar�rs rr�TextDecoder.flush=s���|�|�"�"�3��-�-r)r�N)zutf-8)r�r<rrG)rrrr<)rr<rHrrrr�r�2s���P�)�.rr�c�6�\rSrSrSrSSjrS	SjrS84SjrSrg)�LineDecoderiAz�85Handles incrementally reading lines from text.86 87Has the same behaviour as the stdllib splitlines,88but handling the input iteratively.89c� �/UlSUlgr8��buffer�trailing_crrs rr5�LineDecoder.__init__Is��!#���!&��rc���SnUR(aSU-nSUlURS5(aSUlUSSnU(d/$USU;nUR5n[U5S:Xa'U(d URRUS5 /$UR(a/SR
UR5US-/USS-n/UlU(dUR5/UlU$)	Nu90
…

�
FTr�rr�)r��endswith�91splitlinesr�r��append�join�pop)r�text�
NEWLINE_CHARS�trailing_newline�liness     rr�LineDecoder.decodeMs���B�
�����$�;�D�$�D���=�=����#�D�����9�D���I���8�}�4�����!���u�:��?�#3��K�K���u�Q�x�(��I��;�;��W�W�T�[�[�)�E�!�H�4�5��a�b�	�A�E��D�K��!�9�9�;�-�D�K��rc��UR(dUR(d/$SRUR5/n/UlSUlU$)Nr�F)r�r�r�)rr�s  rr�LineDecoder.flushss?���{�{�4�#3�#3��I�������%�&����� ����rr�NrF)r�r<rr�r�rHrrrr�r�As���'�$�Lrr�)�identity�gzip�deflate�br�zstdr�r�)r+�92__future__rr�rn�typingr2�_exceptionsrrXrY�93brotlicffirjrr$r-rJrUrgr{r�r�r�r��SUPPORTED_DECODERSr�rrr�<module>r�s9���#�
�	�
��&�	����94$�$�	�n�	�3�^�3�:3�.�3�.23�N�23�j'�~�'�T�>��2$(�$(�N$(�$(�N.�.�9�9�z ���95����96�>����4� ������6�"���i���	$�������������I��s:�C�C/�C,�C�C(�$C,�'C(�(C,�/C:�9C:
codekingpro/portable-devtools · Team Ai