관리-도구
편집 파일: __init__.cpython-312.pyc
� G��e� � � � d dl mZmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZmZ g d �Z dd eeef dede fd �Z dd eeef dededee 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 � st dt | � � �� �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)r r �detectors ��/builddir/build/BUILDROOT/alt-python312-pip-23.3.1-1.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/chardet/__init__.pyr r sd � � �h� �*��(�E�*��C�D��N�CS�T�� � �X�&�� �6J�K�H��M�M�(���>�>��� �ignore_thresholdc �� � t | t � s2t | t � st dt | � � �� �t | � } t |�� }|j | � |j � |j t j k( �rNg }g }|j D ]F }t |t � r#|j d� |j D � � �6|j |� �H |D ]� }|s|j! � |j"