Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/__pycache__/payload.cpython-311.pyc

�

�܋f�4�	�|�UddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZddlmZddlmZddlmZdd	lmZm Z m!Z!m"Z"m#Z#dd
l$m%Z%ddl&m'Z'm(Z(dZ)d
Z*ee+e,d<erddlm-Z-Gd�de.��Z/Gd�de0ej1��Z2dedededdfd�Z3e2j4d�deddede2ddfd�Z5Gd�d ��Z6edZ7ee7efZ8Gd!�d"��Z9Gd#�de��Z:Gd$�d%e:��Z;Gd&�d'e;��Z<Gd(�d)e<��Z=Gd*�d+e:��Z>Gd,�d-e>��Z?Gd.�d/e>��Z@Gd0�d1e>��ZAGd2�d3e;��ZBerdd4lmCZCmDZDeDeEZFeCeEZGndd4lHmCZCmDZDeDZFeCZGGd5�d6e:��ZIGd7�d8eI��ZJe9��ZKeK�Le;eEeMeNf��eK�Le<e0��eK�Le=ejO��eK�Le?ejP��eK�Le@ejQ��eK�LeAejRejSf��eK�Le>ejT��eK�LeJe%��eK�LeIeCe2jU���dS)9�N)�ABC�abstractmethod)�chain)�IO�
TYPE_CHECKING�Any�
ByteString�Dict�Final�Iterable�Optional�TextIO�Tuple�Type�Union)�CIMultiDict�)�hdrs)�AbstractStreamWriter)�	_SENTINEL�content_disposition_header�guess_filename�parse_mimetype�sentinel)�StreamReader)�JSONEncoder�_CIMultiDict)
�PAYLOAD_REGISTRY�get_payload�payload_type�Payload�BytesPayload�
StringPayload�
IOBasePayload�BytesIOPayload�BufferedReaderPayload�
TextIOPayload�StringIOPayload�JsonPayload�AsyncIterablePayloadi�TOO_LARGE_BYTES_BODY)�Listc��eZdZdS)�LookupErrorN)�__name__�
__module__�__qualname__���F/opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/payload.pyr.r.=s�������Dr3r.c��eZdZdZdZdZdS)�Order�normal�	try_first�try_lastN)r/r0r1r7r8r9r2r3r4r6r6As������
�F��I��H�H�Hr3r6�data�args�kwargs�returnr!c�,�tj|g|�Ri|��S�N)r�get)r:r;r<s   r4rrGs#�����6�t�6�6�6�v�6�6�6r3��order�factory�typerBc�@�t�|||���dS�NrA)r�register)rCrDrBs   r4�register_payloadrHKs%�����g�t�5��9�9�9�9�9r3c�Z�eZdZejd�dededdfd�Zdeddedfd	�ZdS)
r rArDrBr=Nc�"�||_||_dSr?)rDrB)�selfrDrBs   r4�__init__zpayload_type.__init__Rs����	���
�
�
r3rCr!c�>�t||j|j���|SrF)rHrDrB)rKrCs  r4�__call__zpayload_type.__call__Vs ����$�)�4�:�>�>�>�>��r3)	r/r0r1r6r7rrLrrNr2r3r4r r Qsv������49�L����S��E��T�������Y���D��O������r3r c�d�eZdZdZdd�Zed�dededd	d
eddf
d�Zej	d
�de
dededdfd�ZdS)�PayloadRegistryzZPayload registry.

    note: we need zope.interface for more efficient adapter search
    r=Nc�0�g|_g|_g|_dSr?)�_first�_normal�_last�rKs r4rLzPayloadRegistry.__init__es��24���35���13��
�
�
r3)�_CHAINr:r;rVz!Type[chain[_PayloadRegistryItem]]r<r!c���t|t��r|S||j|j|j��D]#\}}t||��r||g|�Ri|��cS�$t���r?)�
isinstancer!rRrSrTr.)rKr:rVr;r<rCrDs       r4r@zPayloadRegistry.getjs����d�G�$�$�	��K�#�V�D�K���t�z�J�J�	6�	6�M�G�T��$��%�%�
6��w�t�5�d�5�5�5�f�5�5�5�5�5�
6��m�m�r3rArCrDrBc�.�|tjur|j�||f��dS|tjur|j�||f��dS|tjur|j�||f��dStd|�����)NzUnsupported order )	r6r8rR�appendr7rSr9rT�
ValueError)rKrCrDrBs    r4rGzPayloadRegistry.registerys����E�O�#�#��K������/�/�/�/�/�
�e�l�
"�
"��L����$��0�0�0�0�0�
�e�n�
$�
$��J���w��o�.�.�.�.�.��;�%�;�;�<�<�<r3)r=N)r/r0r1�__doc__rLrrr@r6r7�PayloadTyperGr2r3r4rPrP_s���������
4�4�4�4�7<�	
�
�
��
��
�4�	
�
�
�
�

�
�
�
� BG��
=�
=�
=�"�
=�*-�
=�9>�
=�	
�
=�
=�
=�
=�
=�
=r3rPc���eZdZUdZeed<dZeeed<de	ddfde
deeee
eefeeeeffdeedefdeed	eed
e
ddfd�Zedeefd
���Zedeefd���Zedefd���Zedefd���Zedeefd���Zedefd���Z		ddededede
ddf
d�Zededdfd���ZdS)r!�application/octet-stream�_default_content_typeN�_size�value�headers�content_type�filename�encodingr<r=c��||_||_t��|_||_|t
ur|�||jtj<n]|j�=tj	|j��d}|�|j
}||jtj<n|j
|jtj<|j�|pi��dS�Nr)�	_encoding�	_filenamer�_headers�_valuerr�CONTENT_TYPE�	mimetypes�
guess_typer`�update)rKrbrcrdrerfr<s       r4rLzPayload.__init__�s���"���!���&1�m�m��
�����x�'�'�L�,D�/;�D�M�$�+�,�,�
�^�
'�$�/���?�?��B�L��#�#�9��/;�D�M�$�+�,�,�/3�/I�D�M�$�+�,��
���W�]��+�+�+�+�+r3c��|jS)zSize of the payload.)rarUs r4�sizezPayload.size�s���z�r3c��|jS)zFilename of the payload.)rjrUs r4rezPayload.filename�����~�r3c��|jS)zCustom item headers)rkrUs r4rczPayload.headers�s���}�r3c��d�d�|j���D�����d��dzS)N�c�*�g|]\}}|dz|zdz��S)z: z
r2)�.0�k�vs   r4�
<listcomp>z+Payload._binary_headers.<locals>.<listcomp>�s)��L�L�L�t�q�!�Q��X��\�F�*�L�L�Lr3�utf-8s
)�joinrc�items�encoderUs r4�_binary_headerszPayload._binary_headers�sR��
�G�G�L�L�t�|�7I�7I�7K�7K�L�L�L�M�M�T�T��
�
��
�	
r3c��|jS)zPayload encoding)rirUs r4rfzPayload.encoding�rtr3c�0�|jtjS)zContent type)rkrrmrUs r4rdzPayload.content_type�s���}�T�.�/�/r3Tr}�disptype�quote_fields�_charset�paramsc�J�t|f||d�|��|jtj<dS)z$Sets ``Content-Disposition`` header.)r�r�N)rrkr�CONTENT_DISPOSITION)rKr�r�r�r�s     r4�set_content_dispositionzPayload.set_content_disposition�s>��3M��3
�#/�(�3
�3
�FL�3
�3
��
�d�.�/�/�/r3�writerc��
K�dS)zLWrite payload.

        writer is an AbstractStreamWriter instance:
        Nr2�rKr�s  r4�writez
Payload.write�s
�����r3)Tr})r/r0r1r`�str�__annotations__rar
�intrrrrr
rrrrL�propertyrrrerc�bytesr�rfrd�boolr�rrr�r2r3r4r!r!�sY�������!;��3�;�;�;��E�8�C�=����
�4<�"&�"&�,�,��,���,��S�#�X����s�C�x��0I�I�J�
�,��C��y�0�1�
,��3�-�,��3�-�,��,�
�,�,�,�,�4��h�s�m�����X����(�3�-�����X���������X���
��
�
�
��X�
���(�3�-�����X���0�c�0�0�0��X�0�"��	

�

��

��

��	

�
�

�
�

�

�

�

���"6��4�����^���r3c�@��eZdZdedededdf�fd�Zdeddfd�Z�xZS)	r"rbr;r<r=Nc���t|tttf��st	dt|�������d|vrd|d<t
��j|g|�Ri|��t|t��r
|j|_	nt|��|_	|j	tkrd|i}tj
dtfi|��dSdS)Nz%value argument must be byte-ish, not rdr_�sourcez}Sending a large body directly with raw bytes might lock the event loop. You should probably pass an io.BytesIO object instead)rXr��	bytearray�
memoryview�	TypeErrorrD�superrL�nbytesra�lenr+�warnings�warn�ResourceWarning�rKrbr;r<�	__class__s    �r4rLzBytesPayload.__init__�s�����%�%��J�!?�@�@�	U��S�D��K�K�S�S�T�T�T���'�'�%?�F�>�"�������0��0�0�0��0�0�0��e�Z�(�(�	$���D�J�J��U���D�J��:�,�,�,���%�F��M�,� �	
�
�
�
�
�
�
�
�-�,r3r�c��JK�|�|j���d{V��dSr?)r�rlr�s  r4r�zBytesPayload.write�s2�����l�l�4�;�'�'�'�'�'�'�'�'�'�'�'r3)	r/r0r1r	rrLrr��
__classcell__�r�s@r4r"r"�s|��������j�������������0(�"6�(�4�(�(�(�(�(�(�(�(r3r"c
�X��eZdZddd�dededeedeededdf�fd	�Z�xZS)
r#N�rfrdrbr;rfrdr<r=c����|�2|�d}d}n4t|��}|j�dd��}n	|�d|z}|}t��j|�|��g|�R||d�|��dS)Nr}�text/plain; charset=utf-8�charset�text/plain; charset=%sr�)r�
parametersr@r�rLr�)	rKrbrfrdr;r<�
real_encoding�mimetyper�s	        �r4rLzStringPayload.__init__�s�������#� '�
�:���)�,�7�7�� (� 3� 7� 7�	�7� K� K�
�
��#�7�(�B��$�M�������L�L��'�'�	
��		
�	
�"�%�	
�	
�
�	
�	
�	
�	
�	
r3)r/r0r1r�rr
rLr�r�s@r4r#r#�s��������
#'�&*�
�
�
��
��
��3�-�	
�
�s�m�
��

�
�
�
�
�
�
�
�
�
�
�
r3r#c�<��eZdZdeedededdf�fd�Z�xZS)r(rbr;r<r=Nc�f��t��j|���g|�Ri|��dSr?)r�rL�readr�s    �r4rLzStringIOPayload.__init__s8�������������7��7�7�7��7�7�7�7�7r3)r/r0r1rr�rrLr�r�s@r4r(r(s]�������8�b��g�8�c�8�S�8�T�8�8�8�8�8�8�8�8�8�8r3r(c�l��eZdZUeeed<	ddeededededdf
�fd	�
Zd
eddfd�Z	�xZ
S)
r$rl�
attachmentrb�dispositionr;r<r=Nc����d|vrt|��|d<t��j|g|�Ri|��|j�3|�3tj|jvr"|�||j���dSdSdSdS)Nre)re)rr�rLrjrr�rcr�)rKrbr�r;r<r�s     �r4rLzIOBasePayload.__init__s�����V�#�#�!/��!6�!6�F�:��������0��0�0�0��0�0�0��>�%�+�*A��'�t�|�;�;��,�,�[�4�>�,�R�R�R�R�R�&�%�*A�*A�;�;r3r�c��K�tj��}	|�d|jjd���d{V��}|rD|�|���d{V��|�d|jjd���d{V��}|�D|�d|jj���d{V��dS#|�d|jj���d{V��wxYw)N�)�asyncio�get_event_loop�run_in_executorrlr�r��close)rKr��loop�chunks    r4r�zIOBasePayload.write+s�����%�'�'��	@��.�.�t�T�[�5E�u�M�M�M�M�M�M�M�M�E��
R��l�l�5�)�)�)�)�)�)�)�)�)�"�2�2�4���9I�5�Q�Q�Q�Q�Q�Q�Q�Q���
R��&�&�t�T�[�->�?�?�?�?�?�?�?�?�?�?�?��$�&�&�t�T�[�->�?�?�?�?�?�?�?�?�?�?���s�A-B,�,(C)r�)r/r0r1rrr�r�rLrr�r�r�s@r4r$r$s����������s�G�O�O�O�2>�
S�
S���W�
S�+.�
S�FI�
S�UX�
S�	
�
S�
S�
S�
S�
S�
S�@�"6�@�4�@�@�@�@�@�@�@�@r3r$c
���eZdZUeed<ddd�dededeedeeded	df�fd
�Ze	d	ee
fd���Zded	dfd
�Z
�xZS)r'rlNr�rbr;rfrdr<r=c���|�2|�d}d}n2t|��}|j�dd��}n|�d|z}t��j|g|�R||d�|��dS)Nr}r�r�r��rdrf)rr�r@r�rL)rKrbrfrdr;r<r�r�s       �r4rLzTextIOPayload.__init__9s�������#�"��:���)�,�7�7��#�.�2�2�9�g�F�F����#�7�(�B��������	
��		
�	
�%��	
�	
�
�	
�	
�	
�	
�	
r3c��	tj|j�����j|j���z
S#t$rYdSwxYwr?��os�fstatrl�fileno�st_size�tell�OSErrorrUs r4rrzTextIOPayload.sizeUs]��	��8�D�K�.�.�0�0�1�1�9�D�K�<L�<L�<N�<N�N�N���	�	�	��4�4�	�����A	A�
A�Ar�c��K�tj��}	|�d|jjd���d{V��}|rz|jr|�|j���n|���}|�|���d{V��|�d|jjd���d{V��}|�z|�d|jj���d{V��dS#|�d|jj���d{V��wxYw)Nr�)rf)	r�r�r�rlr�rir�r�r�)rKr�r�r�r:s     r4r�zTextIOPayload.write\sI�����%�'�'��	@��.�.�t�T�[�5E�u�M�M�M�M�M�M�M�M�E��
R��~�(�E�L�L�$�.�L�9�9�9�������
�l�l�4�(�(�(�(�(�(�(�(�(�"�2�2�4���9I�5�Q�Q�Q�Q�Q�Q�Q�Q���
R��&�&�t�T�[�->�?�?�?�?�?�?�?�?�?�?�?��$�&�&�t�T�[�->�?�?�?�?�?�?�?�?�?�?���s�B#C"�"(D
)r/r0r1rr�rr
r�rLr�r�rrrr�r�r�s@r4r'r'6s����������N�N�N�#'�&*�
�
�
��
��
��3�-�	
�
�s�m�
��

�
�
�
�
�
�
�
�8��h�s�m�����X��
@�"6�
@�4�
@�
@�
@�
@�
@�
@�
@�
@r3r'c�*�eZdZedefd���ZdS)r%r=c��|j���}|j�dtj��}|j�|��||z
Srh)rlr��seekr��SEEK_END)rK�position�ends   r4rrzBytesIOPayload.sizemsN���;�#�#�%�%���k���q�"�+�.�.�������"�"�"��X�~�r3N)r/r0r1r�r�rrr2r3r4r%r%ls9������
��c�����X���r3r%c�6�eZdZedeefd���ZdS)r&r=c��	tj|j�����j|j���z
S#t$rYdSwxYwr?r�rUs r4rrzBufferedReaderPayload.sizevs_��	��8�D�K�.�.�0�0�1�1�9�D�K�<L�<L�<N�<N�N�N���	�	�	��4�4�	���r�N)r/r0r1r�r
r�rrr2r3r4r&r&us=������
��h�s�m�����X���r3r&c�N��eZdZddejfdedededededed	d
f�fd�
Z�xZ	S)r)r}zapplication/jsonrbrfrd�dumpsr;r<r=Nc���t��j||���|��g|�R||d�|��dS)Nr�)r�rLr�)rKrbrfrdr�r;r<r�s       �r4rLzJsonPayload.__init__�sl���	������E�%�L�L����)�)�	
��		
�	
�%��	
�	
�
�	
�	
�	
�	
�	
r3)
r/r0r1�jsonr�rr�rrLr�r�s@r4r)r)�s�������� �.�!�Z�
�
��
��
��	
�
�
��

��
�
�
�
�
�
�
�
�
�
�
�
r3r))�
AsyncIterable�
AsyncIteratorc�\��eZdZUdZeeed<dedededdf�fd�Z	de
ddfd	�Z�xZS)
r*N�_iterrbr;r<r=c���t|t��s/td�t	|�������d|vrd|d<t��j|g|�Ri|��|���|_dS)NzMvalue argument must support collections.abc.AsyncIterable interface, got {!r}rdr_)	rXr�r��formatrDr�rL�	__aiter__r�r�s    �r4rLzAsyncIterablePayload.__init__�s�����%��/�/�	���!�6�$�u�+�+�.�.���
���'�'�%?�F�>�"�������0��0�0�0��0�0�0��_�_�&�&��
�
�
r3r�c���K�|jrU		|j����d{V��}|�|���d{V���;#t$rd|_YdSwxYwdSr?)r��	__anext__r��StopAsyncIteration)rKr�r�s   r4r�zAsyncIterablePayload.write�s������:�	"�
"�.�"&�*�"6�"6�"8�"8�8�8�8�8�8�8�E� �,�,�u�-�-�-�-�-�-�-�-�-�.��&�
"�
"�
"�!��
�
�
�
�
"����	"�	"s�<A�A�A)
r/r0r1r�r
�_AsyncIteratorr��_AsyncIterablerrLrr�r�r�s@r4r*r*�s���������&*�E�8�N�#�*�*�*�
'�n�
'�S�
'�C�
'�D�
'�
'�
'�
'�
'�
'�	"�"6�	"�4�	"�	"�	"�	"�	"�	"�	"�	"r3r*c�0��eZdZdedededdf�fd�Z�xZS)�StreamReaderPayloadrbr;r<r=Nc�f��t��j|���g|�Ri|��dSr?)r�rL�iter_anyr�s    �r4rLzStreamReaderPayload.__init__�s:�����������)�)�;�D�;�;�;�F�;�;�;�;�;r3)r/r0r1rrrLr�r�s@r4r�r��sY�������<�l�<�3�<�#�<�$�<�<�<�<�<�<�<�<�<�<r3r�)Vr��enum�ior�rnr�r��abcrr�	itertoolsr�typingrrrr	r
rrr
rrrr�	multidictrrwrr�helpersrrrrr�streamsr�typedefsrr�__all__r+r�r�r,�	Exceptionr.r��Enumr6rr7rHr r]�_PayloadRegistryItemrPr!r"r#r(r$r'r%r&r)r�r�r�r�r��collections.abcr*r�rrGr�r��StringIO�
TextIOBase�BytesIO�BufferedReader�BufferedRandom�IOBaser9r2r3r4�<module>r�sd�����������	�	�	�	���������	�	�	�	�����#�#�#�#�#�#�#�#�������
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�"�!�!�!�!�!�������%�%�%�%�%�%���������������"�!�!�!�!�!�/�/�/�/�/�/�/�/��� $)��e�C�j�(�(�(���������	�	�	�	�	�)�	�	�	������C������7�c�7�#�7��7��7�7�7�7�
<A�<�:�:�:�
�)�_�:�$'�:�38�:�	�:�:�:�:����������9�o���[�#�-�.��$=�$=�$=�$=�$=�$=�$=�$=�NR�R�R�R�R�c�R�R�R�j(�(�(�(�(�7�(�(�(�:
�
�
�
�
�L�
�
�
�>8�8�8�8�8�m�8�8�8�
@�@�@�@�@�G�@�@�@�43@�3@�3@�3@�3@�M�3@�3@�3@�l�����]���������M����
�
�
�
�
�,�
�
�
�(�	#�3�3�3�3�3�3�3�3�"�5�)�N�"�5�)�N�N�<�<�<�<�<�<�<�<�"�N�"�N�"�"�"�"�"�7�"�"�"�><�<�<�<�<�.�<�<�<�
#�?�$�$�����,��	�:�(F�G�G�G����-��-�-�-����/�2�;�7�7�7����-���7�7�7����.�"�*�5�5�5����/�"�2C�R�EV�1W�X�X�X����-���3�3�3����-�|�<�<�<����.�
�U�^��T�T�T�T�Tr3

Hacked By AnonymousFox1.0, Coded By AnonymousFox