o
    j                     @   s:   d Z ddlmZ dedeedf deedf fddZd	S )
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              
   C   sR   | s|S g }|D ]}z| j |jdd || W q ttfy$   Y qw t|S )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enc r   _/var/www/html/fyndo/pharma/fyndo/venv/lib/python3.10/site-packages/chardet/pipeline/validity.pyfilter_by_validity   s   	r   N)__doc__chardet.registryr   bytesr   r   r   r   r   r   <module>   s    

