403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/webencodings/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/webencodings/__pycache__/__init__.cpython-310.pyc
o

�P�XS)�@s�dZddlmZddlZddlmZdZddd	d
d�ZiZdd
�Z	dd�Z
dd�ZGdd�de�Z
e
d�Ze
d�Ze
d�Zd+dd�Zdd�Zedfdd�Zd+dd �Zd!d"�Zedfd#d$�Zd%d&�ZGd'd(�d(e�ZGd)d*�d*e�ZdS),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-874cCs|�d����d�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)�string�r�7/usr/lib/python3/dist-packages/webencodings/__init__.py�ascii_lower#srcCsxt|�d��}t�|�}|durdSt�|�}|dur:|dkr&ddlm}nt�||�}t�	|�}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_namerrr
r=s



rcCs.t|d�r|St|�}|durtd|��|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.

    rNzUnknown encoding label: %r)�hasattrr�LookupError)�encoding_or_labelrrrr
�
_get_encoding[s
	rc@s eZdZdZdd�Zdd�ZdS)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`.

    cCs||_||_dS�N)rr)�selfrrrrr
�__init__|s
zEncoding.__init__cCs
d|jS)Nz
<Encoding %s>)r)r!rrr
�__repr__�s
zEncoding.__repr__N)�__name__�
__module__�__qualname__�__doc__r"r#rrrr
rmsrzutf-8zutf-16lezutf-16be�replacecCs2t|�}t|�\}}|p
|}|j�||�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_encodingrrrr
r
�sr
cCsV|�d�r
t|dd�fS|�d�rt|dd�fS|�d�r't|dd�fSd|fS)zBReturn (bom_encoding, input), with any BOM removed from the input.s���Ns��s�)�
startswith�_UTF16LE�_UTF16BE�UTF8)r*rrr
r)�s


r)�strictcCst|�j�||�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)rrr)r*rr,rrr
r�srcCs$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)r*r+r,�decoder�	generatorrrrr
�iter_decode�s

r:ccs��|j}t|�}|D]}||�}|r"|jdusJ�|jV|Vnq
|ddd�}|jdus0J�|jV|r9|VdS|D]}||�}|rH|Vq=|ddd�}|rV|VdSdS)zqReturn a generator that first yields the :obj:`Encoding`,
    then yields output chukns as Unicode strings.

    N�T��final)r
�iterr)r*r8r
�chunck�outputrrr
r6�s4���
�r6cCst||�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)r*rr,rrrr
�iter_encode�s
rCccs<�|D]}||�}|r|Vq|ddd�}|r|VdSdS)N�Tr<r)r*rr?r@rrr
rBs��
�rBc@s$eZdZdZd	dd�Zd
dd�ZdS)r5uO
    “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.

    r(cCs&t|�|_||_d|_d|_d|_dS)Nr;)r�_fallback_encoding�_errors�_buffer�_decoderr)r!r+r,rrr
r"s


zIncrementalDecoder.__init__FcCs||j}|dur|||�S|j|}t|�\}}|dur+t|�dkr(|s(||_dS|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.

        Nr/rD)
rHrGr)�lenrEr�incrementaldecoderrFr
r)r!r*r=r8rrrr
r
's



zIncrementalDecoder.decodeN�r()F)r$r%r&r'r"r
rrrr
r5s

r5c@seZdZdZedfdd�ZdS)rAu�
    “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.

    r4cCst|�}|j�|�j|_dSr )rr�incrementalencoderr)r!rr,rrr
r"TszIncrementalEncoder.__init__N)r$r%r&r'r3r"rrrr
rACsrArK)r'�
__future__rr�labelsr�VERSIONrrrrr�objectrr3r1r2r
r)rr:r6rCrBr5rArrrr
�<module>s6
�

 
3

Youez - 2016 - github.com/yon3zu
LinuXploit