HEX
Server: LiteSpeed
System: Linux br-asc-web1845.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
User: u790421558 (790421558)
PHP: 8.2.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/requests/__pycache__/models.cpython-311.pyc
�

V�Zg���0�dZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZddlmZdd	lmZdd
lmZddlmZddlmZmZmZdd
lmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%m&Z&ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>ddl2m?Z@ddlAmBZBeBjCeBjDeBjEeBjFeBjGfZHdZIdZJdZKGd�deL��ZMGd�deL��ZNGd�deN��ZOGd�deMeN��ZPGd�deL��ZQdS) z`
requests.models
~~~~~~~~~~~~~~~

This module contains the primary objects that power Requests.
�N)�RequestField)�encode_multipart_formdata)�	parse_url)�DecodeError�ReadTimeoutError�
ProtocolError�LocationParseError)�UnsupportedOperation�)�
default_hooks)�CaseInsensitiveDict)�
HTTPBasicAuth)�cookiejar_from_dict�get_cookie_header�_copy_cookie_jar)�	HTTPError�
MissingSchema�
InvalidURL�ChunkedEncodingError�ContentDecodingError�ConnectionError�StreamConsumedError)�to_native_string�unicode_is_ascii)
�guess_filename�get_auth_from_url�requote_uri�stream_decode_response_unicode�to_key_val_list�parse_header_links�iter_slices�guess_json_utf�	super_len�check_header_validity)�Callable�Mapping�	cookielib�
urlunparse�urlsplit�	urlencode�str�bytes�is_py2�chardet�builtin_str�
basestring)�json)�codes�i(ic�P�eZdZed���Zed���Zed���ZdS)�RequestEncodingMixinc��g}t|j��}|j}|sd}|�|��|j}|r*|�d��|�|��d�|��S)zBuild the path URL to use.�/�?�)r)�url�path�append�query�join)�selfr:�pr;r=s     �B/opt/alt/python311/lib/python3.11/site-packages/requests/models.py�path_urlzRequestEncodingMixin.path_url=s~�����T�X�����v���	��D��
�
�4��������	��J�J�s�O�O�O��J�J�u�����w�w�s�|�|��c	�
�t|ttf��r|St|d��r|St|d��r�g}t	|��D]�\}}t|t
��st|d��s|g}|D]o}|�k|�t|t��r|�d��n|t|t��r|�d��n|f���p��t|d���S|S)z�Encode parameters in a piece of data.

        Will successfully encode parameters when passed as a dict or a list of
        2-tuples. Order is retained if data is a list of 2-tuples but arbitrary
        if parameters are supplied as a dict.
        �read�__iter__N�utf-8T)�doseq)	�
isinstancer+r,�hasattrrr0r<�encoder*)�data�result�k�vs�vs     rA�_encode_paramsz#RequestEncodingMixin._encode_paramsRs0���d�S�%�L�)�)�	��K�
�T�6�
"�
"�	��K�
�T�:�
&�
&�	��F�(��.�.�
N�
N���2��b�*�-�-��W�R��5L�5L����B��N�N�A��}��
�
�2<�Q��2D�2D�K�Q�X�X�g�.�.�.�!�2<�Q��2D�2D�K�Q�X�X�g�.�.�.�!�M�N�N�N��N�
�V�4�0�0�0�0��KrCc	�v�|std���t|t��rtd���g}t|pi��}t|pi��}|D]�\}}t|t��st	|d��s|g}|D]�}|��t|t
��st
|��}|�t|t
��r|�d��n|t|t��r|�	d��n|f������|D�]\}}d}d}	t|ttf��r;t|��dkr|\}
}n5t|��dkr|\}
}}n|\}
}}}	nt|��p|}
|}t|tt
tf��r|}n*t	|d��r|���}n|���|}t!|||
|	�	��}
|
�|�
��|�|
����t%|��\}}||fS)a�Build the body for a multipart/form-data request.

        Will successfully encode files when passed as a dict or a list of
        tuples. Order is retained if data is a list of tuples but arbitrary
        if parameters are supplied as a dict.
        The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype)
        or 4-tuples (filename, fileobj, contentype, custom_headers).
        zFiles must be provided.zData must not be a string.rFNrG��rE)�namerL�filename�headers)�content_type)�
ValueErrorrIr0rrJr,r+r<�decoderK�tuple�list�lenr�	bytearrayrEr�make_multipartr)�filesrL�
new_fields�fields�field�valrPrN�ft�fh�fn�fp�fdata�rf�bodyrXs                rA�
_encode_filesz"RequestEncodingMixin._encode_filesms����	;��6�7�7�7�
��j�
)�
)�	;��9�:�:�:��
� ����,�,������,�,�� �	J�	J�J�E�3��#�z�*�*�
�'�#�z�2J�2J�
��e���
J�
J���=�%�a��/�/�#���F�F���%�%�2<�U�E�2J�2J�U����g�.�.�.�PU�.8��C�.@�.@�G����'�*�*�*�a�I�J�J�J��

J��	"�	"�F�Q���B��B��!�e�T�]�+�+�	
��q�6�6�Q�;�;��F�B�����V�V�q�[�[�!"�J�B��B�B�%&�N�B��B���#�A�&�&�+�!�����"�s�E�9�5�6�6�
������V�$�$�
����	�	���������1�5�2�r�J�J�J�B����2��.�.�.����b�!�!�!�!�6�z�B�B���l��\�!�!rCN)�__name__�
__module__�__qualname__�propertyrB�staticmethodrQrl�rCrAr5r5<sc������
����X��(����\��4�="�="��\�="�="�="rCr5c��eZdZd�Zd�ZdS)�RequestHooksMixinc�"�||jvrtd|z���t|t��r"|j|�|��dSt|d��r,|j|�d�|D����dSdS)zProperly register a hook.z1Unsupported event specified, with event name "%s"rFc3�DK�|]}t|t���|V��dS�N)rIr%)�.0�hs  rA�	<genexpr>z2RequestHooksMixin.register_hook.<locals>.<genexpr>�s1����$P�$P�1�
�1�h�8O�8O�$P�Q�$P�$P�$P�$P�$P�$PrCN)�hooksrYrIr%r<rJ�extend�r?�event�hooks   rA�
register_hookzRequestHooksMixin.register_hook�s�����
�"�"��P�TY�Z�[�[�[��d�H�%�%�	Q��J�u��$�$�T�*�*�*�*�*�
�T�:�
&�
&�	Q��J�u��$�$�$P�$P��$P�$P�$P�P�P�P�P�P�	Q�	QrCc�j�	|j|�|��dS#t$rYdSwxYw)ziDeregister a previously registered hook.
        Returns True if the hook existed, False if not.
        TF)r{�removerYr}s   rA�deregister_hookz!RequestHooksMixin.deregister_hook�sI��
	��J�u��$�$�T�*�*�*��4���	�	�	��5�5�	���s� $�
2�2N)rmrnror�r�rrrCrArtrt�s5������	Q�	Q�	Q�	�	�	�	�	rCrtc�*�eZdZdZ		dd�Zd�Zd�ZdS)�Requesta{A user-created :class:`Request <Request>` object.

    Used to prepare a :class:`PreparedRequest <PreparedRequest>`, which is sent to the server.

    :param method: HTTP method to use.
    :param url: URL to send.
    :param headers: dictionary of headers to send.
    :param files: dictionary of {filename: fileobject} files to multipart upload.
    :param data: the body to attach to the request. If a dictionary or
        list of tuples ``[(key, value)]`` is provided, form-encoding will
        take place.
    :param json: json for the body to attach to the request (if files or data is not specified).
    :param params: URL parameters to append to the URL. If a dictionary or
        list of tuples ``[(key, value)]`` is provided, form-encoding will
        take place.
    :param auth: Auth handler or (user, pass) tuple.
    :param cookies: dictionary or CookieJar of cookies to attach to this request.
    :param hooks: dictionary of callback hooks, for internal usage.

    Usage::

      >>> import requests
      >>> req = requests.Request('GET', 'https://httpbin.org/get')
      >>> req.prepare()
      <PreparedRequest [GET]>
    Nc�b�|�gn|}|�gn|}|�in|}|�in|}|	�in|	}	t��|_t|	�����D]\}}|�||����||_||_||_||_||_	|
|_
||_||_||_
dS)N)r~r)rr{r\�itemsr��methodr:rWr`rLr1�params�auth�cookies)
r?r�r:rWr`rLr�r�r�r{r1rNrPs
             rA�__init__zRequest.__init__�s���
�\�r�r�t���m�������"�"�W���~���6���m�����"�_�_��
��5�;�;�=�=�)�)�	0�	0�F�Q�����Q�Q��/�/�/�/������������
���	���	������	�����rCc��d|jzS)Nz<Request [%s]>�r��r?s rA�__repr__zRequest.__repr__�s���4�;�/�/rCc���t��}|�|j|j|j|j|j|j|j|j	|j
|j��
�
|S)zXConstructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it.)
r�r:rWr`rLr1r�r�r�r{)�PreparedRequest�preparer�r:rWr`rLr1r�r�r�r{�r?r@s  rAr�zRequest.prepare�sa������	�	�	��;����L��*������;����L��*�	�	
�	
�	
��rC�
NNNNNNNNNN)rmrnro�__doc__r�r�r�rrrCrAr�r��sZ��������8CG�CG�����20�0�0�����rCr�c�z�eZdZdZd�Z		dd�Zd�Zd�Zd�Ze	d���Z
d	�Zd
�Zdd�Z
d�Zdd�Zd�Zd�ZdS)r�a)The fully mutable :class:`PreparedRequest <PreparedRequest>` object,
    containing the exact bytes that will be sent to the server.

    Instances are generated from a :class:`Request <Request>` object, and
    should not be instantiated manually; doing so may produce undesirable
    effects.

    Usage::

      >>> import requests
      >>> req = requests.Request('GET', 'https://httpbin.org/get')
      >>> r = req.prepare()
      >>> r
      <PreparedRequest [GET]>

      >>> s = requests.Session()
      >>> s.send(r)
      <Response [200]>
    c��d|_d|_d|_d|_d|_t��|_d|_dSrw)r�r:rW�_cookiesrkrr{�_body_positionr�s rAr�zPreparedRequest.__init__%s@�������������
���	�"�_�_��
�"����rCNc�4�|�|��|�||��|�|��|�|��|�|||
��|�||��|�|	��dS)z6Prepares the entire request with the given parameters.N)�prepare_method�prepare_url�prepare_headers�prepare_cookies�prepare_body�prepare_auth�
prepare_hooks)r?r�r:rWr`rLr�r�r�r{r1s           rAr�zPreparedRequest.prepare6s���
	
���F�#�#�#�����f�%�%�%����W�%�%�%����W�%�%�%����$��t�,�,�,����$��$�$�$�	
���5�!�!�!�!�!rCc��d|jzS)Nz<PreparedRequest [%s]>r�r�s rAr�zPreparedRequest.__repr__Hs��'�4�;�7�7rCc��t��}|j|_|j|_|j�|j���nd|_t|j��|_|j|_|j|_|j	|_	|Srw)
r�r�r:rW�copyrr�rkr{r�r�s  rAr�zPreparedRequest.copyKss�������;�������+/�<�+C�D�L�%�%�'�'�'���	�%�d�m�4�4��
������*����.����rCc�|�||_|j�-t|j�����|_dSdS)zPrepares the given HTTP method.N)r�r�upper)r?r�s  rAr�zPreparedRequest.prepare_methodVs:������;�"�*�4�;�+<�+<�+>�+>�?�?�D�K�K�K�#�"rCc��ddl}	|�|d����d��}n#|j$rt�wxYw|S)NrT)�uts46rG)�idnarKrZ�	IDNAError�UnicodeError)�hostr�s  rA�_get_idna_encoded_hostz&PreparedRequest._get_idna_encoded_host\s]������	��;�;�t�4�;�0�0�7�7��@�@�D�D���~�	�	�	���	�����s	�*1�Ac
��t|t��r|�d��}n%trt	|��nt|��}|���}d|vr0|����d��s	||_	dS	t|��\}}}}}}}	n #t$r}
t|
j
��d}
~
wwxYw|s4d}|�t|d����}t!|���|std|z���t#|��s4	|�|��}nA#t&$rtd���wxYw|�d��rtd���|pd	}|r|d
z
}||z
}|r|dt|��zz
}|sd}tr�t|t
��r|�d��}t|t
��r|�d��}t|t
��r|�d��}t|t
��r|�d��}t|	t
��r|	�d��}	t|t
tf��rt|��}|�|��}
|
r|r|�d
|
��}n|
}t-t/|||d||	g����}||_	dS)zPrepares the given HTTP URL.�utf8�:�httpNzDInvalid URL {0!r}: No schema supplied. Perhaps you meant http://{0}?z Invalid URL %r: No host suppliedzURL has an invalid label.�*r9�@r7rG�&)rIr,rZr-�unicoder+�lstrip�lower�
startswithr:rr	r�args�formatrrrr�r�rKrQrr()r?r:r��schemer�r��portr;r=�fragment�e�error�netloc�
enc_paramss              rAr�zPreparedRequest.prepare_urlfs0���c�5�!�!�	7��*�*�V�$�$�C�C�"(�6�'�#�,�,�,�c�#�h�h�C��j�j�l�l��
�#�:�:�c�i�i�k�k�4�4�V�<�<�:��D�H��F�	&�>G��n�n�;�F�D�$��d�E�8�8��!�	&�	&�	&��a�f�%�%�����	&�����	'�[�E��L�L�!1�#�v�!>�!>�?�?�E���&�&�&��	G��?�#�E�F�F�F� ��%�%�	:�
>��2�2�4�8�8�����
>�
>�
>� �!<�=�=�=�
>����
�_�_�T�
"�
"�	:��8�9�9�9������	��c�M�F��$����	&��c�C��I�I�o�%�F��	��D��
	4��&�#�&�&�
0����w�/�/���&�#�&�&�
0����w�/�/���$��$�$�
,��{�{�7�+�+���%��%�%�
.����W�-�-���(�C�(�(�
4�#�?�?�7�3�3���f�s�E�l�+�+�	.�%�f�-�-�F��(�(��0�0�
��	#��
#�#(�5�5�*�*�5���"���*�f�f�d�D�%��%R�S�S�T�T������s$�B2�2
C�<C
�
C�,E�Ec��t��|_|rB|���D]/}t|��|\}}||jt	|��<�.dSdS)z Prepares the given HTTP headers.N)r
rWr�r$r)r?rW�headerrU�values     rAr�zPreparedRequest.prepare_headers�ss��+�,�,����	=�!�-�-�/�/�
=�
=��%�f�-�-�-�$���e�7<���-�d�3�3�4�4�	=�	=�
=�
=rCc
��d}d}|sB|�@d}tj|��}t|t��s|�d��}tt
|d��t|ttttf��g��}|r�	t|��}n#tttf$rd}YnwxYw|}t|dd���E	|���|_n*#t$t&f$rt)��|_YnwxYw|rt+d���|rt-|��|jd<n�d|jd	<n�|r|�||��\}}nA|r?|�|��}t|t��st
|d
��rd}nd}|�|��|rd|jvr
||jd
<||_dS)z"Prepares the given HTTP body data.Nzapplication/jsonrGrF�tellz1Streamed bodies and files are mutually exclusive.�Content-Length�chunkedzTransfer-EncodingrEz!application/x-www-form-urlencodedzcontent-typezContent-Type)�complexjson�dumpsrIr,rK�allrJr0r\r[r&r#�	TypeError�AttributeErrorr
�getattrr�r��IOError�OSError�object�NotImplementedErrorr/rWrlrQ�prepare_content_lengthrk)r?rLr`r1rkrX�	is_stream�lengths        rAr�zPreparedRequest.prepare_body�s;�������	,��(�.�L��$�T�*�*�D��d�E�*�*�
,��{�{�7�+�+����D�*�%�%��4�*�d�E�7�!C�D�D�D�
���	�
�*	<�
�"�4�������~�/C�D�
�
�
�����
�����D��t�V�T�*�*�6�3�*.�)�)�+�+�D�'�'����)�3�3�3�+1�(�(�D�'�'�'�3����
�
_�)�*]�^�^�^��
>�1<�V�1D�1D���-�.�.�4=���0�1�1��
K�'+�'9�'9�%��'F�'F�$��|�|��K��.�.�t�4�4�D�!�$�
�3�3�K�w�t�V�7L�7L�K�'+���'J���'�'��-�-�-��
<��t�|�!C�!C�/;���^�,���	�	�	s$�B"�"B>�=B>�C/�/$D�Dc���|�,t|��}|rt|��|jd<dSdS|jdvr&|j�d���d|jd<dSdSdS)z>Prepare Content-Length header based on request method and bodyNr�)�GET�HEAD�0)r#r/rWr��get)r?rkr�s   rAr�z&PreparedRequest.prepare_content_lengths������t�_�_�F��
E�2=�V�1D�1D���-�.�.�.�
E�
E��[��
/�
/�D�L�4D�4D�EU�4V�4V�4^�.1�D�L�)�*�*�*�0�
/�4^�4^rCr9c�J�|�'t|j��}t|��r|nd}|rwt|t��rt|��dkr	t
|�}||��}|j�|j��|�	|j
��dSdS)z"Prepares the given HTTP auth data.NrS)rr:�anyrIr[r]r�__dict__�updater�rk)r?r�r:�url_auth�rs     rAr�zPreparedRequest.prepare_auths����<�(���2�2�H�"�8�}�}�6�8�8�$�D��	3��$��&�&�
,�3�t�9�9��>�>�$�d�+����T�
�
�A�
�M� � ���,�,�,�
�'�'��	�2�2�2�2�2�	3�	3rCc��t|tj��r||_nt	|��|_t|j|��}|�||jd<dSdS)aPrepares the given HTTP cookie data.

        This function eventually generates a ``Cookie`` header from the
        given cookies using cookielib. Due to cookielib's design, the header
        will not be regenerated if it already exists, meaning this function
        can only be called once for the life of the
        :class:`PreparedRequest <PreparedRequest>` object. Any subsequent calls
        to ``prepare_cookies`` will have no actual effect, unless the "Cookie"
        header is removed beforehand.
        N�Cookie)rIr'�	CookieJarr�rrrW)r?r��
cookie_headers   rAr�zPreparedRequest.prepare_cookies/sb���g�y�2�3�3�	9�#�D�M�M�/��8�8�D�M�)�$�-��>�>�
��$�%2�D�L��"�"�"�%�$rCc�P�|pg}|D]}|�|||���dS)zPrepares the given hooks.N)r�)r?r{r~s   rAr�zPreparedRequest.prepare_hooksCsC��
�����	4�	4�E����u�e�E�l�3�3�3�3�	4�	4rCr�rw)r9)rmrnror�r�r�r�r�r�rqr�r�r�r�r�r�r�r�rrrCrAr�r�s��������(#�#�#�$CG�CG�"�"�"�"�$8�8�8�	�	�	�@�@�@�����\��T�T�T�l	=�	=�	=�C�C�C�C�J1�1�1�3�3�3�3�,3�3�3�(4�4�4�4�4rCr�c�(�eZdZdZgd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
ed���Zed
���Zed���Zed���Zed���Zdd�Zeddfd�Zed���Zed���Zd�Zed���Zd�Zd�ZdS)�ResponsezhThe :class:`Response <Response>` object, which contains a
    server's response to an HTTP request.
    )
�_content�status_coderWr:�history�encoding�reasonr��elapsed�requestc��d|_d|_d|_d|_t	��|_d|_d|_d|_g|_	d|_
ti��|_tjd��|_d|_dS)NFr)r��_content_consumed�_nextr�r
rW�rawr:r�r�r�rr��datetime�	timedeltar�r�r�s rAr�zResponse.__init__Ws�����
�!&�����
� ���
+�,�,���
��������
�
������+�2�.�.��� �)�!�,�,�������rCc��|Srwrrr�s rA�	__enter__zResponse.__enter__�s���rCc�.�|���dSrw)�close)r?r�s  rA�__exit__zResponse.__exit__�s���
�
�����rCc�F���js�j�fd��jD��S)Nc�4��i|]}|t�|d����Srw)r�)rx�attrr?s  �rA�
<dictcomp>z)Response.__getstate__.<locals>.<dictcomp>�s'���K�K�K�D��g�d�D�$�/�/�K�K�KrC)r��content�	__attrs__r�s`rA�__getstate__zResponse.__getstate__�s3����%�	��L�L�K�K�K�K�D�N�K�K�K�KrCc��|���D]\}}t|||���t|dd��t|dd��dS)Nr�Tr�)r��setattr)r?�staterUr�s    rA�__setstate__zResponse.__setstate__�s_�� �;�;�=�=�	'�	'�K�D�%��D�$��&�&�&�&�	��)�4�0�0�0���e�T�"�"�"�"�"rCc��d|jzS)Nz<Response [%s]>)r�r�s rAr�zResponse.__repr__�s�� �D�$4�5�5rCc��|jS�akReturns True if :attr:`status_code` is less than 400.

        This attribute checks if the status code of the response is between
        400 and 600 to see if there was a client error or a server error. If
        the status code, is between 200 and 400, this will return True. This
        is **not** a check to see if the response code is ``200 OK``.
        ��okr�s rA�__bool__zResponse.__bool__�����w�rCc��|jSrr	r�s rA�__nonzero__zResponse.__nonzero__�rrCc�,�|�d��S)z,Allows you to use a response as an iterator.�)�iter_contentr�s rArFzResponse.__iter__�s��� � ��%�%�%rCc�T�	|���n#t$rYdSwxYwdS)axReturns True if :attr:`status_code` is less than 400, False if not.

        This attribute checks if the status code of the response is between
        400 and 600 to see if there was a client error or a server error. If
        the status code is between 200 and 400, this will return True. This
        is **not** a check to see if the response code is ``200 OK``.
        FT)�raise_for_statusrr�s rAr
zResponse.ok�sC��	��!�!�#�#�#�#���	�	�	��5�5�	�����ts��
%�%c�0�d|jvo
|jtvS)z�True if this Response is a well-formed HTTP redirect that could have
        been processed automatically (by :meth:`Session.resolve_redirects`).
        �location)rWr��REDIRECT_STATIr�s rA�is_redirectzResponse.is_redirect�s��
�d�l�*�Q�t�/?�>�/Q�RrCc�R�d|jvo|jtjtjfvS)z@True if this Response one of the permanent versions of redirect.r)rWr�r2�moved_permanently�permanent_redirectr�s rA�is_permanent_redirectzResponse.is_permanent_redirect�s*���d�l�*�v�t�/?�E�D[�]b�]u�Cv�/v�wrCc��|jS)zTReturns a PreparedRequest for the next request in a redirect chain, if there is one.)r�r�s rA�nextz
Response.next�s���z�rCc�@�tj|j��dS)z7The apparent encoding, provided by the chardet library.r�)r.�detectr�r�s rA�apparent_encodingzResponse.apparent_encoding�s���~�d�l�+�+�J�7�7rCrFc�X�����fd�}�jr(t�jt��rt	�����4t�t
��st
dt���z���t�j���}|��}�jr|n|}|rt|���}|S)a�Iterates over the response data.  When stream=True is set on the
        request, this avoids reading the content at once into memory for
        large responses.  The chunk size is the number of bytes it should
        read into memory.  This is not necessarily the length of each item
        returned as decoding can take place.

        chunk_size must be of type int or None. A value of None will
        function differently depending on the value of `stream`.
        stream=True will read data as it arrives in whatever size the
        chunks are received. If stream=False, data is returned as
        a single chunk.

        If decode_unicode is True, content will be decoded using the best
        available encoding based on the response.
        c3��K�t�jd��r~	�j��d���D]}|V��n|#t$r}t	|���d}~wt
$r}t
|���d}~wt$r}t|���d}~wwxYw	�j�	���}|sn|V��"d�_
dS)N�streamT)�decode_content)rJr�r#rrrrrrrEr�)�chunkr��
chunk_sizer?s  ��rA�generatez'Response.iter_content.<locals>.generate�s������t�x��*�*�
 �-�!%�����D��!Q�!Q�$�$��#�����$��$�2�2�2�.�q�1�1�1�����"�2�2�2�.�q�1�1�1�����'�-�-�-�)�!�,�,�,�����-���� � �H�M�M�*�5�5�E� ����K�K�K�	 �&*�D�"�"�"s-�#>�
B�A�
B�$A3�3
B�B�BNz.chunk_size must be an int, it is instead a %s.)
r�rIr��boolr�intr��typer!r)r?r&�decode_unicoder'�
reused_chunks�
stream_chunks�chunkss``     rArzResponse.iter_content�s�����"	*�	*�	*�	*�	*�	*�,�!�	a�j����&E�&E�	a�%�'�'�'�
�
#�J�z�3�,G�,G�
#��L�t�T^�O_�O_�_�`�`�`�#�D�M�:�>�>�
� ��
�
�
�"&�"8�K���m���	B�3�F�D�A�A�F��
rCNc#�@K�d}|�||���D]y}|�||z}|r|�|��}n|���}|r7|dr/|r-|dd|dkr|���}nd}|D]}|V���z|�|V�dSdS)z�Iterates over the response data, one line at a time.  When
        stream=True is set on the request, this avoids reading the
        content at once into memory for large responses.

        .. note:: This method is not reentrant safe.
        N)r&r+���)r�split�
splitlines�pop)r?r&r+�	delimiter�pendingr%�lines�lines        rA�
iter_lineszResponse.iter_liness��������&�&�*�^�&�\�\�	�	�E��"��%����
+����I�.�.����(�(�*�*���
��r��
�u�
��r��2��%��)�1K�1K��)�)�+�+������
�
���
�
�
�
�
����M�M�M�M�M��rCc��|jdurd|jrtd���|jdks|j�d|_n4d�|�t����pd|_d|_|jS)z"Content of the response, in bytes.Fz2The content for this response was already consumedrNrCT)r�r��RuntimeErrorr�r�r>r�CONTENT_CHUNK_SIZEr�s rAr�zResponse.content2s����=�E�!�!��%�
J�"�H�J�J�J���1�$�$���(8� $��
�
� #����):�):�;M�)N�)N� O� O� V�SV��
�!%����}�rCc���d}|j}|jstd��S|j�|j}	t|j|d���}n-#tt
f$rt|jd���}YnwxYw|S)a�Content of the response, in unicode.

        If Response.encoding is None, encoding will be guessed using
        ``chardet``.

        The encoding of the response content is determined based solely on HTTP
        headers, following RFC 2616 to the letter. If you can take advantage of
        non-HTTP knowledge to make a better guess at the encoding, you should
        set ``r.encoding`` appropriately before accessing this property.
        Nr9�replace)�errors)r�r�r+r �LookupErrorr�)r?r�r�s   rA�textz
Response.textFs������=���|�	��r�7�7�N��=� ��-�H�		:��$�,���C�C�C�G�G���Y�'�	:�	:�	:��$�,�y�9�9�9�G�G�G�	:�����s�A�'A1�0A1c��|jsp|jrit|j��dkrQt|j��}|�;	t	j|j�|��fi|��S#t$rYnwxYwt	j|jfi|��S)z�Returns the json-encoded content of a response, if any.

        :param \*\*kwargs: Optional arguments that ``json.loads`` takes.
        :raises ValueError: If the response body does not contain valid json.
        rT)	r�r�r]r"r��loadsrZ�UnicodeDecodeErrorr@)r?�kwargsr�s   rAr1z
Response.jsonls����}�	���	�#�d�l�2C�2C�a�2G�2G�
&�d�l�3�3�H��#�	�&�,���+�+�H�5�5���9?�����*����
�D������ ���5�5�f�5�5�5s�)A(�(
A5�4A5c���|j�d��}i}|rCt|��}|D]1}|�d��p|�d��}|||<�2|S)z8Returns the parsed header links of the response, if any.�link�relr:)rWr�r )r?r��l�linksrF�keys      rArIzResponse.links�sr����!�!�&�)�)��
���	�&�v�.�.�E��
�
���h�h�u�o�o�8����%������#����rCc��d}t|jt��rF	|j�d��}n1#t$r|j�d��}YnwxYw|j}d|jcxkrdkrnn|j�d|�d|j��}n)d|jcxkrdkrnn|j�d	|�d|j��}|rt||�
���dS)z+Raises :class:`HTTPError`, if one occurred.r9rGz
iso-8859-1i�i�z Client Error: z
 for url: iXz Server Error: )�responseN)rIr�r,rZrCr�r:r)r?�http_error_msgr�s   rArzResponse.raise_for_status�s-�����d�k�5�)�)�
	!�

:���+�+�G�4�4����%�
:�
:�
:���+�+�L�9�9����
:�����[�F��$�"�(�(�(�(�S�(�(�(�(�(�CG�CS�CS�CS�U[�U[�U[�]a�]e�]e�f�N�N�
�D�$�
*�
*�
*�
*�s�
*�
*�
*�
*�
*�CG�CS�CS�CS�U[�U[�U[�]a�]e�]e�f�N��	;��N�T�:�:�:�:�	;�	;s�9�$A �A c��|js|j���t|jdd��}|�|��dSdS)z�Releases the connection back to the pool. Once this method has been
        called the underlying ``raw`` object must not be accessed again.

        *Note: Should not normally need to be called explicitly.*
        �release_connN)r�r�r�r�)r?rOs  rAr�zResponse.close�sQ���%�	��H�N�N�����t�x���>�>���#��L�N�N�N�N�N�$�#rC)rF)rmrnror�rr�r�r�rrr�rrrFrpr
rrrr r�ITER_CHUNK_SIZEr8r�r@r1rIrr�rrrCrAr�r�Ms������������I�
-�-�-�^������L�L�L�#�#�#�6�6�6�������&�&�&�����X���S�S��X�S��x�x��X�x�����X���8�8��X�8�5�5�5�5�n%4�E�UY�����>����X��&�#�#��X�#�J6�6�6�4����X��";�;�;�2����rCr�)Rr�r��sys�encodings.idna�	encodings�urllib3.fieldsr�urllib3.filepostr�urllib3.utilr�urllib3.exceptionsrrrr	�ior
r{r�
structuresr
r�rr�rrr�
exceptionsrrrrrrr�_internal_utilsrr�utilsrrrrrr r!r"r#r$�compatr%r&r'r(r)r*r+r,r-r.r/r0r1r��status_codesr2�moved�found�other�temporary_redirectrr�DEFAULT_REDIRECT_LIMITr;rPr�r5rtr�r�r�rrrCrA�<module>rds��������
�
�
�
�
����'�'�'�'�'�'�6�6�6�6�6�6�"�"�"�"�"�"�F�F�F�F�F�F�F�F�F�F�F�F�$�#�#�#�#�#� � � � � � �+�+�+�+�+�+�������M�M�M�M�M�M�M�M�M�M�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�?�?�?�?�?�?�?�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�(�'�'�'�'�'�������

�K�	�K�	�K�	��	����������o"�o"�o"�o"�o"�6�o"�o"�o"�d���������0G�G�G�G�G��G�G�G�Tz4�z4�z4�z4�z4�*�,=�z4�z4�z4�z	o�o�o�o�o�v�o�o�o�o�orC