o
ai @ sD d dl mZ d dlmZ d dlmZmZ g dZdd Zdd Z d S )
)UniversalDetector)
InputState)__version__VERSION)r detect
detect_allr r c C sF t | tst | tstdt| 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 bytearraybytes TypeErrorformattyper feedclose)byte_strdetector r /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/chardet/__init__.pyr s
r c C s t | tst | tstdt| t| } t }|| | |j t
jkrig }|jD ],}|
|jkrZ|j}|j }|drN|jrN|j||}|||
|jd q.t|dkrit|dd dS |jgS )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
confidencelanguage c S s
| d S )Nr r )resultr r r