HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/charset_normalizer/__pycache__/legacy.cpython-37.pyc
B

���Q�c��@s�ddlZddlmZmZmZddlmZmZmZm	Z	ddl
mZddlm
Z
mZeeeeeeeffd�dd	�ZGd
d�de
�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZdS)�N)�Dict�Optional�Union�)�
from_bytes�from_fp�	from_path�	normalize)�CHARDET_CORRESPONDENCE)�CharsetMatch�CharsetMatches)�byte_str�returncCs�t|ttf�s td�t|����t|t�r2t|�}t|���}|dk	rL|jnd}|dk	rh|j	dkrh|j	nd}|dk	r~d|j
nd}|dk	r�|dkr�|jr�|d7}|tkr�|nt|||d�S)	a�
    chardet legacy method
    Detect the encoding of the given byte string. It should be mostly backward-compatible.
    Encoding name will match Chardet own writing whenever possible. (Not on encoding name unsupported by it)
    This function is deprecated and should be used to migrate your project easily, consult the documentation for
    further information. Not planned for removal.

    :param byte_str:     The byte sequence to examine.
    z4Expected object of type bytes or bytearray, got: {0}N�Unknown�g�?�utf_8Z_sig)�encoding�language�
confidence)
�
isinstance�	bytearray�bytes�	TypeError�format�typer�bestrrZchaos�bomr
)r
�rrrr�r�J/opt/alt/python37/lib/python3.7/site-packages/charset_normalizer/legacy.py�detect	s 

r c@seZdZdS)�CharsetNormalizerMatchN)�__name__�
__module__�__qualname__rrrrr!0sr!c@s<eZdZedd��Zedd��Zedd��Zedd��Zd	S)
�CharsetNormalizerMatchescOst�dt�t||�S)Nzkstaticmethod from_fp, from_bytes, from_path and normalize are deprecated and scheduled to be removed in 3.0)�warnings�warn�DeprecationWarningr)�args�kwargsrrrr5sz CharsetNormalizerMatches.from_fpcOst�dt�t||�S)Nzkstaticmethod from_fp, from_bytes, from_path and normalize are deprecated and scheduled to be removed in 3.0)r&r'r(r)r)r*rrrr>sz#CharsetNormalizerMatches.from_bytescOst�dt�t||�S)Nzkstaticmethod from_fp, from_bytes, from_path and normalize are deprecated and scheduled to be removed in 3.0)r&r'r(r)r)r*rrrrGsz"CharsetNormalizerMatches.from_pathcOst�dt�t||�S)Nzkstaticmethod from_fp, from_bytes, from_path and normalize are deprecated and scheduled to be removed in 3.0)r&r'r(r	)r)r*rrrr	Psz"CharsetNormalizerMatches.normalizeN)r"r#r$�staticmethodrrrr	rrrrr%4s			r%c@seZdZdS)�CharsetDetectorN)r"r#r$rrrrr,Zsr,c@seZdZdS)�
CharsetDoctorN)r"r#r$rrrrr-^sr-)r&�typingrrrZapirrrr	Zconstantr
Zmodelsrrr�str�floatr r!r%r,r-rrrr�<module>s$'&