
    f jq                       d Z ddlmZ ddlmZ ddlmZmZmZm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZmZ ddlmZmZ dd	lmZmZ dd
lmZ ddlmZmZ g dZdej        eefdddddddd*d&Z ddej        eefdddddddd+d)Z!dS ),u@   Universal character encoding detector — 0BSD-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_encodingbyte_strbytes | bytearrayshould_rename_legacyboolencoding_erar   
chunk_sizeint	max_bytesr   r   r   Iterable[str] | Noner   r   strr   returnr   c          	        t          |           t          |           t          ||          }t          |d          }t          |d          }t	          |	d          }t	          |
d          }t          | t                    r| nt          |           }t          |||||||          }|d                                         }|rt          |           |rt          |           |S )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   r&   r   r   r   r   r   )r
   r	   r   r   r   
isinstancebytesr   to_dictr   r   )r   r!   r#   r$   r&   r   r   r   r   r   r   includeexcludeno_matchemptydataresultsresults                     dC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\chardet/__init__.pyr   r   %   s   L  
+++	"""./C_UUO!"35HIIG!"35HIIG!"35HIIH35KLLE!(E22G88hD!!""  G QZ!!F ) ((( #6"""M    ignore_thresholdlist[DetectionDict]c          	        t          |           t          |           t          ||          }t          |d          }t          |	d          }t	          |
d          }t	          |d          }t          | t                    r| nt          |           }t          |||||||          }d |D             }|sd |D             }|r|}|D ]$}|rt          |           |rt          |           %t          |d d	
          S )aV  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+   c                6    g | ]}|                                 S  )r.   ).0rs     r6   
<listcomp>zdetect_all.<locals>.<listcomp>   s     ***QQYY[[***r7   c                4    g | ]}|d          t           k    |S )
confidence)r   )r=   ds     r6   r?   zdetect_all.<locals>.<listcomp>   s'    LLL!,:K(KLALLLr7   c                    | d         S )NrA   r<   )rB   s    r6   <lambda>zdetect_all.<locals>.<lambda>   s
    q r7   T)keyreverse)r
   r	   r   r   r   r,   r-   r   r   r   sorted)r   r8   r!   r#   r$   r&   r   r   r   r   r   r   r/   r0   r1   r2   r3   r4   dictsfilteredrB   s                        r6   r   r   d   sN   Z  
+++	"""./C_UUO!"35HIIG!"35HIIG!"35HIIH35KLLE!(E22G88hD!!""  G +*'***E LLuLLL 	E " " 	($Q''' 	"q!!!%66EEEEr7   )r   r    r!   r"   r#   r   r$   r%   r&   r%   r   r"   r   r"   r   r'   r   r'   r   r(   r   r(   r)   r   )r   r    r8   r"   r!   r"   r#   r   r$   r%   r&   r%   r   r"   r   r"   r   r'   r   r'   r   r(   r   r(   r)   r9   )"__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   r<   r7   r6   <module>rW      s   F F " " " " " " $ $ $ $ $ $                ) ( ( ( ( ( . . . . . . 5 5 5 5 5 5 5 5 M M M M M M M M ; ; ; ; ; ; ; ; 6 6 6 6 6 6 D D D D D D D D    "' +)&< ".2.2% '< < < < < <B #!& +)&HF ".2.2% 'HF HF HF HF HF HF HF HFr7   