o
    NK&h@  ã                	   @   sj   d Z ddlmZ ddlmZmZ dedefdd„Zde	defd	d
„Z
	ddede	dee	 defdd„ZdS )z"Copyright (C) 2020 Nidhal Baccourié    )ÚOptional)ÚNotValidLengthÚNotValidPayloadÚtextÚreturnc                 C   s   | dkS )NÚ © )r   r   r   úK/var/www/html/venv/lib/python3.10/site-packages/deep_translator/validate.pyÚis_empty   s   r
   Ústatus_codec                 C   s   | dks| dk r
dS dS )zñCheck if a request has failed or not.
    A request is considered successfull if the status code is in the 2** range.

    Args:
        status_code (int): status code of the request

    Returns:
        bool: indicates request failure
    i+  éÈ   TFr   )r   r   r   r	   Úrequest_failed   s   
r   NÚ	min_charsÚ	max_charsc                 C   s@   t | tƒs	t| ƒ‚|r|t| ƒ  kr|k sn t| ||ƒ‚dS )z®
    validate the target text to translate
    @param min_chars: min characters
    @param max_chars: max characters
    @param text: text to translate
    @return: bool
    T)Ú
isinstanceÚstrr   Úlenr   )r   r   r   r   r   r	   Úis_input_valid   s
   
r   )r   N)Ú__copyright__Útypingr   Údeep_translator.exceptionsr   r   r   Úboolr
   Úintr   r   r   r   r   r	   Ú<module>   s    ÿÿÿÿþ