????

Your IP : 3.147.70.194


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/chardet/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/chardet/__pycache__/__init__.cpython-311.pyc

�

�܋f��
���ddlmZmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZmZgd	�Z	ddeeefded
e
fd�Z		ddeeefdeded
ee
fd�ZdS)�)�List�Union�)�CharSetGroupProber)�
CharSetProber)�
InputState)�
ResultDict)�UniversalDetector)�VERSION�__version__)r
�detect�
detect_allrrF�byte_str�should_rename_legacy�returnc�$�t|t��sCt|t��stdt	|�������t|��}t|���}|�|��|���S)aV
    Detect the encoding of the given byte string.

    :param byte_str:     The byte sequence to examine.
    :type byte_str:      ``bytes`` or ``bytearray``
    :param should_rename_legacy:  Should we rename legacy encodings
                                  to their more modern equivalents?
    :type should_rename_legacy:   ``bool``
    �1Expected object of type bytes or bytearray, got: �r)�
isinstance�	bytearray�bytes�	TypeError�typer
�feed�close)rr�detectors   �G/opt/cloudlinux/venv/lib64/python3.11/site-packages/chardet/__init__.pyr
r
s����h�	�*�*�'��(�E�*�*�	��T�D��N�N�T�T���
��X�&�&�� �6J�K�K�K�H��M�M�(�����>�>�����ignore_thresholdc��t|t��sCt|t��stdt	|�������t|��}t|���}|�|��|���|jtj
k�rYg}g}|jD]Q}t|t��r%|�
d�|jD�����<|�|���R|D]�}|s|���|jkr�|jpd}|���}|�d��r"|jr|j�||��}|r-|j�|���|��}|�||���|jd�����t5|��dkrt7|d��	��S|jgS)
aD
    Detect all the possible encodings of the given byte string.

    :param byte_str:          The byte sequence to examine.
    :type byte_str:           ``bytes`` or ``bytearray``
    :param ignore_threshold:  Include encodings that are below
                              ``UniversalDetector.MINIMUM_THRESHOLD``
                              in results.
    :type ignore_threshold:   ``bool``
    :param should_rename_legacy:  Should we rename legacy encodings
                                  to their more modern equivalents?
    :type should_rename_legacy:   ``bool``
    rrc3�K�|]}|V��dS)N�)�.0�ps  r�	<genexpr>zdetect_all.<locals>.<genexpr>Ws"����9�9�Q�q�9�9�9�9�9�9r�ziso-8859)�encoding�
confidence�languagerc��|dS)Nr(r")�results r�<lambda>zdetect_all.<locals>.<lambda>qs��v�l�7K�6K�r)�key)rrrrrr
rr�input_stater�	HIGH_BYTE�charset_probersr�extend�probers�append�get_confidence�MINIMUM_THRESHOLD�charset_name�lower�
startswith�
has_win_bytes�ISO_WIN_MAP�get�
LEGACY_MAPr)�len�sortedr+)	rrrr�resultsr2�proberr6�lower_charset_names	         rrr5s8��$�h�	�*�*�'��(�E�*�*�	��T�D��N�N�T�T���
��X�&�&�� �6J�K�K�K�H��M�M�(�����N�N������z�3�3�3�$&��')���.�	'�	'�F��&�"4�5�5�
'����9�9�&�.�9�9�9�9�9�9�9����v�&�&�&�&��	�	�F��
�6�#8�#8�#:�#:�X�=W�#W�#W�%�2�8�b��%1�%7�%7�%9�%9�"�&�0�0��<�<���AW��#+�#7�#;�#;�*�L�$�$�L�(��#+�#6�#:�#:�$�*�*�,�,�l�$�$�L����$0�&,�&;�&;�&=�&=�$*�O��������w�<�<�!����'�'K�'K�L�L�L�L��O��rN)F)FF)�typingrr�charsetgroupproberr�
charsetproberr�enumsr�
resultdictr	�universaldetectorr
�versionrr�__all__rr�boolr
rr"rr�<module>rKs<��$��������2�2�2�2�2�2�(�(�(�(�(�(�������"�"�"�"�"�"�0�0�0�0�0�0�)�)�)�)�)�)�)�)�
Q�
Q�
Q��EJ����E�9�$�%��=A�������2#�!&�>�>��E�9�$�%�>��>��>�
�*��	>�>�>�>�>�>r