CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
legacy.cpython-310.pyc29 linesDownload Raw Back to __pycache__
1o

2��Yi�3�@svddlmZddlmZmZddlmZddlmZddl	m4Z5mZer2ddlm
Z
Gdd	�d	e
�Z	6dddd�ZdS)�)�annotations)�
TYPE_CHECKING�Any)�warn�)�7from_bytes)�CHARDET_CORRESPONDENCE�TOO_SMALL_SEQUENCE)�	TypedDictc@s&eZdZUded<ded<ded<dS)�8ResultDictz9str | None�encoding�str�languagezfloat | None�10confidenceN)�__name__�11__module__�__qualname__�__annotations__�rr��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\charset_normalizer/legacy.pyr
s12rF�byte_str�bytes�should_rename_legacy�bool�kwargsr�returncKs t|�rtdd�t|�����d��t|ttf�s#tdt	|�����t|t�r,t|�}t13|���}|dur9|jnd}|durG|j
dkrG|j
nd}|durRd|jnd}|duro|d	kro|d14vro|jdurot|�tkro|d8}|dur~|d
kr~|jr~|d7}|dur�|tvr�t|}|||d�S)aJ15    chardet legacy method16    Detect the encoding of the given byte string. It should be mostly backward-compatible.17    Encoding name will match Chardet own writing whenever possible. (Not on encoding name unsupported by it)18    This function is deprecated and should be used to migrate your project easily, consult the documentation for19    further information. Not planned for removal.20 21    :param byte_str:     The byte sequence to examine.22    :param should_rename_legacy:  Should we rename legacy encodings23                                  to their more modern equivalents?24    z(charset-normalizer disregard arguments '�,z' in legacy function detect()z1Expected object of type bytes or bytearray, got: N�Unknown�g�?g�������?>�ascii�utf_8Fg�������?r �_sig)rrr)�lenr�join�list�keys�25isinstance�	bytearrayr�	TypeError�typer�bestrrZchaos�bomr	r)rrr�rrrrrrr�detects<��26�27�r-N)F)rrrrrrrr)�28__future__r�typingrr�warningsr�apirZconstantrr	Ztyping_extensionsr29rr-rrrr�<module>s�
Aluode/PerceptionLabPortable · CoolFace