�
��^i� � �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-4.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 �