관리-도구
편집 파일: __init__.cpython-311.pyc
� �Re� � �B � d dl mZ d dlmZ d dlmZmZ g d�Zd� Zd� Z dS )� )�UniversalDetector)� InputState)�__version__�VERSION)r �detect� detect_allr r c �@ � t | t � � sSt | t � � s/t d� t | � � � � � � �t | � � } t � � }|� | � � |� � � S )z� Detect the encoding of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` �3Expected object of type bytes or bytearray, got: {}) � isinstance� bytearray�bytes� TypeError�format�typer �feed�close)�byte_str�detectors ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/chardet/__init__.pyr r s� � � �h� �*�*� +��(�E�*�*� +�� !�!'���X���!7�!7�9� 9� 9� !��*�*�H� �"�"�H��M�M�(�����>�>���� c �$ � t | t � � sSt | t � � s/t d� t | � � � � � � �t | � � } t � � }|� | � � |� � � |j t j k r�g }|j D ]�}|� � � |j k r�|j }|j � � � }|� d� � r"|j r|j � ||� � }|� ||� � � |j d�� � ��t/ |� � dk rt1 |d� �� � S |j gS )z� Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` r ziso-8859)�encoding� confidence�language� c � � | d S )Nr � )�results r �<lambda>zdetect_all.<locals>.<lambda>Q s � �v�l�7K�6K� r )�key)r r r r r r r r r �_input_stater � HIGH_BYTE�_charset_probers�get_confidence�MINIMUM_THRESHOLD�charset_name�lower� startswith�_has_win_bytes�ISO_WIN_MAP�get�appendr �len�sortedr )r r �results�proberr&