
    Ƒi                       S r SSKJr  SSK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  SSKJrJr  SS	KJr  / S
QrS\R0                  \\4           SS jjrSS\R0                  \\4             SS jjrg)u?   Universal character encoding detector — MIT-licensed rewrite.    )annotations)_DEFAULT_CHUNK_SIZEDEFAULT_MAX_BYTESMINIMUM_THRESHOLD_validate_max_bytes_warn_deprecated_chunk_size)__version__)UniversalDetector)EncodingEraLanguageFilter)apply_legacy_rename)DetectionDictDetectionResult)run_pipeline)
r   r   r   r   r   r   r
   r	   detect
detect_allTc                    [        U5        [        U5        [        U [        5      (       a  U O
[        U 5      n[	        XRUS9nUS   R                  5       nU(       a  [        U5        U$ )a  Detect the encoding of the given byte string.

Parameters match chardet 6.x for backward compatibility.
*chunk_size* is accepted but has no effect.

:param byte_str: The byte sequence to detect encoding for.
:param should_rename_legacy: If ``True`` (the default), remap legacy
    encoding names to their modern equivalents.
: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*.
:returns: A dictionary with keys ``"encoding"``, ``"confidence"``, and
    ``"language"``.
	max_bytesr   )r   r   
isinstancebytesr   to_dictr   )byte_strshould_rename_legacyencoding_era
chunk_sizer   dataresultsresults           P/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/chardet/__init__.pyr   r   !   sY    ,  
+	"!(E228hD4CGQZ!FF#M    Fc                   [        U5        [        U5        [        U [        5      (       a  U O
[        U 5      n[	        XcUS9nU Vs/ s H  oR                  5       PM     n	nU(       d)  U	 V
s/ s H  oS   [        :  d  M  U
PM     nn
U(       a  Un	U(       a  U	 H  n
[        U
5        M     [        U	S SS9$ s  snf s  sn
f )a0  Detect all possible encodings of the given byte string.

Parameters match chardet 6.x for backward compatibility.
*chunk_size* is accepted but has no effect.

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: If ``True`` (the default), remap legacy
    encoding names to their modern equivalents.
: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*.
:returns: A list of dictionaries, each with keys ``"encoding"``,
    ``"confidence"``, and ``"language"``, sorted by descending confidence.
r   
confidencec                    U S   $ )Nr#    )ds    r    <lambda>detect_all.<locals>.<lambda>k   s    qr!   T)keyreverse)	r   r   r   r   r   r   r   r   sorted)r   ignore_thresholdr   r   r   r   r   r   rdictsr&   filtereds               r    r   r   A   s    <  
+	"!(E228hD4CG")*'QYY['E*$Lu!,:K(KAuLEA" %6EE +Ls   B9-B>B>N)r   bytes | bytearrayr   boolr   r   r   intr   r2   returnr   )r   r0   r,   r1   r   r1   r   r   r   r2   r   r2   r3   zlist[DetectionDict])__doc__
__future__r   chardet._utilsr   r   r   r   r   chardet._versionr	   chardet.detectorr
   chardet.enumsr   r   chardet.equivalencesr   chardet.pipeliner   r   chardet.pipeline.orchestratorr   __all__ALLr   r   r%   r!   r    <module>r?      s    E "  ) . 5 4 ; 6  "& +)&  	
  D #!% +)&*F*F*F *F 	*F
 *F *F *Fr!   