VULN_CHECK_I913V6 j ddlmZmZddlmZddlmZddlmZddl m Z ddl m Z ddl mZmZgd Z dd eeefd ed e fd Z dd eeefded ed ee fdZy))ListUnion)CharSetGroupProber) CharSetProber) InputState) ResultDict)UniversalDetector)VERSION __version__)r detect detect_allr r byte_strshould_rename_legacyreturnct|ts2t|tstdt |t|}t |}|j ||jS)aV Detect the encoding of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` :param should_rename_legacy: Should we rename legacy encodings to their more modern equivalents? :type should_rename_legacy: ``bool`` 1Expected object of type bytes or bytearray, got: r) isinstance bytearraybytes TypeErrortyper feedclose)rrdetectors A/usr/lib/python3.12/site-packages/pip/_vendor/chardet/__init__.pyr r sd h *(E*CDNCST X& 6JKH MM( >> ignore_thresholdct|ts2t|tstdt |t|}t |}|j ||j|jtjk(rNg}g}|jD]F}t|tr#|jd|jD6|j|H|D]}|s|j!|j"kDs#|j$xsd}|j'}|j)dr(|j*r|j,j/||}|r*|j0j/|j'|}|j||j!|j2dt5|dkDrt7|d S|j8gS) aD Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` :param ignore_threshold: Include encodings that are below ``UniversalDetector.MINIMUM_THRESHOLD`` in results. :type ignore_threshold: ``bool`` :param should_rename_legacy: Should we rename legacy encodings to their more modern equivalents? :type should_rename_legacy: ``bool`` rrc3 K|]}|yw)N).0ps r zdetect_all..Ws9.Qq.s ziso-8859)encoding confidencelanguagerc|d S)Nr(r")results rzdetect_all..qs vl7K6Kr)key)rrrrrr rr input_stater HIGH_BYTEcharset_probersrextendprobersappendget_confidenceMINIMUM_THRESHOLD charset_namelower startswith has_win_bytes ISO_WIN_MAPget LEGACY_MAPr)lensortedr+) rrrrresultsr2proberr6lower_charset_names rrr5s$ h *(E*CDNCST X& 6JKH MM( NNz333$&')..F&"459&..99v& / F6#8#8#:X=W=W#W%228b %1%7%7%9"&00<AWAW#+#7#7#;#;*L$L(#+#6#6#:#:$**,l$L$0&,&;&;&=$*OO, wrKs$2("0) QEJE9$%=A2#!&>E9$%>>> * >r