관리-도구
편집 파일: __init__.cpython-39.pyc
a ��Re� � @ sD d dl mZ d dlmZ d dlmZmZ g d�Zdd� Zdd� Z d S ) � )�UniversalDetector)� InputState)�__version__�VERSION)r �detect� detect_allr r c C sH t | t�s0t | t�s(td�t| ����nt| �} 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�detector� r ��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/chardet/__init__.pyr s � r c C s� t | t�s0t | t�s(td�t| ����nt| �} t� }|�| � |�� |j t jkr�g }|jD ]X}|� � |jkr^|j}|j�� }|�d�r�|jr�|j�||�}|�||� � |jd�� q^t|�dkr�t|dd� d�S |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� confidence�language� c S s | d S )Nr r )�resultr r r �<lambda>Q � zdetect_all.<locals>.<lambda>)�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"