
    3j                     <    d Z ddlmZ dedeedf   deedf   fdZy)	zStage 2a: Byte sequence validity filtering.

Note: ``from __future__ import annotations`` is intentionally omitted because
this module is compiled with mypyc, which does not support PEP 563 string
annotations.
    )EncodingInfodata
candidates.returnc                     | s|S g }|D ]1  }	 | j                  |j                  d       |j                  |       3 t        |      S # t        t        f$ r Y Pw xY w)zFilter candidates to only those where *data* decodes without errors.

    :param data: The raw byte data to test.
    :param candidates: Encoding candidates to validate.
    :returns: The subset of *candidates* that can decode *data*.
    strict)errors)decodenameappendUnicodeDecodeErrorLookupErrortuple)r   r   validencs       F/DATA/.local/lib/python3.12/site-packages/chardet/pipeline/validity.pyfilter_by_validityr      sf     E	KKK2LL  < #K0 		s   .AAAN)__doc__chardet.registryr   bytesr   r        r   <module>r      s@    *
"<#45
<r   