
    ޺i                       S r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
Jr  SSKJr  SSKJr  SSKJrJr  SSKJrJr  SS	KJrJr  SS
KJr  SSKJrJr  / SQrS\R>                  \\4SSSSSSS.                       SS jjjr SS\R>                  \\4SSSSSSS.                         SS jjjr!g)u?   Universal character encoding detector — MIT-licensed rewrite.    )annotations)Iterable)_DEFAULT_CHUNK_SIZEDEFAULT_MAX_BYTESMINIMUM_THRESHOLD_resolve_prefer_superset_validate_max_bytes_warn_deprecated_chunk_size)__version__)UniversalDetector)EncodingEraLanguageFilter)apply_compat_namesapply_preferred_superset)DetectionDictDetectionResult)run_pipeline)_validate_encodingnormalize_encodings)
r   r   r   r   r   r   r   r   detect
detect_allFTNcp1252zutf-8)prefer_supersetcompat_namesinclude_encodingsexclude_encodingsno_match_encodingempty_input_encodingc          
     x   [        U5        [        U5        [        X5      n[        US5      n[        US5      n[	        U	S5      n[	        U
S5      n[        U [        5      (       a  U O
[        U 5      n[        UUUUUUUS9nUS   R                  5       nU(       a  [        U5        U(       a  [        U5        U$ )a  Detect the encoding of the given byte string.

:param byte_str: The byte sequence to detect encoding for.
:param should_rename_legacy: Deprecated alias for *prefer_superset*.
:param encoding_era: Restrict candidate encodings to the given era.
:param chunk_size: Deprecated -- accepted for backward compatibility but
    has no effect.
:param max_bytes: Maximum number of bytes to examine from *byte_str*.
:param prefer_superset: If ``True``, remap ISO subset encodings to their
    Windows/CP superset equivalents (e.g., ISO-8859-1 -> Windows-1252).
:param compat_names: If ``True`` (default), return encoding names
    compatible with chardet 5.x/6.x.  If ``False``, return raw Python
    codec names.
:param include_encodings: If given, restrict detection to only these
    encodings (names or aliases).
:param exclude_encodings: If given, remove these encodings from the
    candidate set.
:param no_match_encoding: Encoding to return when no candidate survives
    the pipeline.  Defaults to ``"cp1252"``.
:param empty_input_encoding: Encoding to return for empty input.  Defaults
    to ``"utf-8"``.
:returns: A dictionary with keys ``"encoding"``, ``"confidence"``, and
    ``"language"``.
r   r   r   r   	max_bytesr   r   r   r   r   )r
   r	   r   r   r   
isinstancebytesr   to_dictr   r   )byte_strshould_rename_legacyencoding_era
chunk_sizer!   r   r   r   r   r   r   includeexcludeno_matchemptydataresultsresults                     O/var/www/piano.thomer.com/venv/lib/python3.13/site-packages/chardet/__init__.pyr   r   %   s    L  
+	"./CUO!"35HIG!"35HIG!"35HIH35KLE!(E228hD!!""G QZ!F (6"M    c          
     2   [        U5        [        U5        [        X&5      n[        US5      n[        U	S5      n[	        U
S5      n[	        US5      n[        U [        5      (       a  U O
[        U 5      n[        UUUUUUUS9nU Vs/ s H  nUR                  5       PM     nnU(       d*  U Vs/ s H  nUS   [        :  d  M  UPM     nnU(       a  UnU H)  nU(       a  [        U5        U(       d  M  [        U5        M+     [        US SS	9$ s  snf s  snf )
a  Detect all possible encodings of the given byte string.

When *ignore_threshold* is False (the default), results with confidence
<= MINIMUM_THRESHOLD (0.20) are filtered out.  If all results are below
the threshold, the full unfiltered list is returned as a fallback so the
caller always receives at least one result.

:param byte_str: The byte sequence to detect encoding for.
:param ignore_threshold: If ``True``, return all candidate encodings
    regardless of confidence score.
:param should_rename_legacy: Deprecated alias for *prefer_superset*.
:param encoding_era: Restrict candidate encodings to the given era.
:param chunk_size: Deprecated -- accepted for backward compatibility but
    has no effect.
:param max_bytes: Maximum number of bytes to examine from *byte_str*.
:param prefer_superset: If ``True``, remap ISO subset encodings to their
    Windows/CP superset equivalents.
:param compat_names: If ``True`` (default), return encoding names
    compatible with chardet 5.x/6.x.  If ``False``, return raw Python
    codec names.
:param include_encodings: If given, restrict detection to only these
    encodings (names or aliases).
:param exclude_encodings: If given, remove these encodings from the
    candidate set.
:param no_match_encoding: Encoding to return when no candidate survives
    the pipeline.  Defaults to ``"cp1252"``.
:param empty_input_encoding: Encoding to return for empty input.  Defaults
    to ``"utf-8"``.
:returns: A list of dictionaries, sorted by descending confidence.
r   r   r   r   r    
confidencec                    U S   $ )Nr3    )ds    r0   <lambda>detect_all.<locals>.<lambda>   s    qr1   T)keyreverse)r
   r	   r   r   r   r"   r#   r   r$   r   r   r   sorted)r%   ignore_thresholdr&   r'   r(   r!   r   r   r   r   r   r   r)   r*   r+   r,   r-   r.   rdictsr6   filtereds                         r0   r   r   d   s   Z  
+	"./CUO!"35HIG!"35HIG!"35HIH35KLE!(E228hD!!""G #**'QQYY['E*$Lu!,:K(KAuLE$Q'<q!	 
 %6EE +Ls   D.DD)r%   bytes | bytearrayr&   boolr'   r   r(   intr!   rB   r   rA   r   rA   r   Iterable[str] | Noner   rC   r   strr   rD   returnr   )r%   r@   r<   rA   r&   rA   r'   r   r(   rB   r!   rB   r   rA   r   rA   r   rC   r   rC   r   rD   r   rD   rE   zlist[DetectionDict])"__doc__
__future__r   collections.abcr   chardet._utilsr   r   r   r   r	   r
   chardet._versionr   chardet.detectorr   chardet.enumsr   r   chardet.equivalencesr   r   chardet.pipeliner   r   chardet.pipeline.orchestratorr   chardet.registryr   r   __all__ALLr   r   r5   r1   r0   <module>rS      s   E " $  ) . 5 M ; 6 D  "' +)&< ".2.2% '<<< < 	<
 < < < ,< ,< < < <B #!& +)&HF ".2.2% 'HFHFHF HF 	HF
 HF HF HF HF ,HF ,HF HF HF HFr1   