U
ʗRey @ sL d dl mZ d dlmZ d dlmZmZ dddddgZd d Zd
ddZ dS ) )
InputState)UniversalDetector)VERSION__version__r detect
detect_allr r c C sF t | ts.t | ts&tdt| 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``
1Expected object of type bytes or bytearray, got: )
isinstance bytearraybytes TypeErrortyper feedclose)byte_strdetector r /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/chardet/__init__.pyr s
Fc C s t | ts.t | ts&tdt| t| } t }|| | |jt j
krg }g }|jD ]0}t|dr|
dd |jD qb|| qb|D ]^}|s| |jkr|jpd}| }|dr|jr|j||}||| |jd qt|dkrt|d d
dS |jgS )a
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``
r probersc s s | ]
}|V qd S )Nr ).0pr r r