jf8 ddlZddlmZmZmZddlmZmZmZm Z ddl m Z ddl m Z mZdedeeeeeefffd ZGd d e ZGd d eZGddeZGddeZdS)N)DictOptionalUnion) from_bytesfrom_fp from_path normalize)CHARDET_CORRESPONDENCE) CharsetMatchCharsetMatchesbyte_strreturnct|ttfs/tdt |t|trt|}t |}||jnd}||j dkr|j nd}| d|j z nd}||dkr |j r|dz }|tvr|n t|||dS) 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}NUnknowng?utf_8_sig)encodinglanguage confidence) isinstance bytearraybytes TypeErrorformattyperbestrrchaosbomr )rrrrrs y/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/charset_normalizer/legacy.pydetectr# s hE 2 3 3  &h((   (I&&#??8!!##A]qzzH]qzY/F/FqzzBH"#-qwTJ }W,,,F 1 1 1H #H -   ceZdZdS)CharsetNormalizerMatchN__name__ __module__ __qualname__r$r"r&r&0Dr$r&cfeZdZedZedZedZedZdS)CharsetNormalizerMatchescNtjdtt|i|SNzkstaticmethod from_fp, from_bytes, from_path and normalize are deprecated and scheduled to be removed in 3.0)warningswarnDeprecationWarningrargskwargss r"rz CharsetNormalizerMatches.from_fp5s3  1    ''''r$cNtjdtt|i|Sr0)r1r2r3rr4s r"rz#CharsetNormalizerMatches.from_bytes>s3  1    4*6***r$cNtjdtt|i|Sr0)r1r2r3r r4s r"r z"CharsetNormalizerMatches.from_pathG3  1    $)&)))r$cNtjdtt|i|Sr0)r1r2r3r r4s r"r z"CharsetNormalizerMatches.normalizePr9r$N)r(r)r* staticmethodrrr r r+r$r"r.r.4s~((\(++\+**\***\***r$r.ceZdZdS)CharsetDetectorNr'r+r$r"r=r=Zr,r$r=ceZdZdS) CharsetDoctorNr'r+r$r"r?r?^r,r$r?)r1typingrrrapirrr r constantr modelsr r rstrfloatr#r&r.r=r?r+r$r"rFsj((((((((((::::::::::::,,,,,,00000000$U$tC%U 2C)D$DE$$$$N     \   #*#*#*#*#*~#*#*#*L     .        ,     r$