HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/charset_normalizer/__pycache__/legacy.cpython-310.pyc
o

;��g	�@srddlmZddlmZmZddlmZddlmZddl	m
Z
er0ddlmZGdd	�d	e�Z
	
dddd�ZdS)�)�annotations)�
TYPE_CHECKING�Any)�warn�)�
from_bytes)�CHARDET_CORRESPONDENCE)�	TypedDictc@s&eZdZUded<ded<ded<dS)�
ResultDictz
str | None�encoding�str�languagezfloat | None�
confidenceN)�__name__�
__module__�__qualname__�__annotations__�rr�D/usr/local/lib/python3.10/dist-packages/charset_normalizer/legacy.pyr

s
r
F�byte_str�bytes�should_rename_legacy�bool�kwargsr�returncKs�t|�rtdd�t|�����d��t|ttf�s#td�	t
|����t|t�r,t|�}t|���}|dur9|j
nd}|durG|jdkrG|jnd}|durRd|jnd}|durc|d	krc|jrc|d
7}|duro|tvrot|}|||d�S)
aJ
    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.
    :param should_rename_legacy:  Should we rename legacy encodings
                                  to their more modern equivalents?
    z(charset-normalizer disregard arguments '�,z' in legacy function detect()z3Expected object of type bytes or bytearray, got: {}N�Unknown�g�?�utf_8�_sigF)rr
r)�lenr�join�list�keys�
isinstance�	bytearrayr�	TypeError�format�typer�bestrr
�chaos�bomr)rrr�rrr
rrrr�detects0���
�r-N)F)rrrrrrrr
)�
__future__r�typingrr�warningsr�apir�constantr�typing_extensionsr	r
r-rrrr�<module>s�