o
    1j                     @   s~   g d Z dddZG dd deZG dd deZG dd	 d	eZG d
d deZG dd deZG dd deZdd Z	dS ))build_res_dictCheckFailedErrorConvertFailedErrorSplitFailedErrorAnalyseFailedErrorDatasetFileNotFoundErrorNc                 K   s   | r#|durt d|  d|durt d|  dtd
d| i|S |du r/t d|  d|du rAt|r:d}nt | dtd
| ||d	|S )z+build the dataset checking result to returnNz`check_pass` is z, but `err_type` is not None.z, but `err_msg` is not None.
check_passz, but `err_type` is None. za is not a known error type, in which case `err_msg` must be specified to a value other than None.)r   err_typeerr_msg )
ValueErrordict_is_known_error_type)r   r	   r
   kwargsr   r   k/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddlex/modules/base/dataset_checker/utils.pyr      s&   

r   c                       s*   e Zd ZdZd fdd	Zdd Z  ZS )FailedErrorzbase error classNc                    s$   |d u r
|  ||}t | d S )N)_construct_messagesuper__init__)selferr_infosolutionmessage	__class__r   r   r   7   s   zFailedError.__init__c                 C   s6   |d u rdS | j  d| }|d ur|d| 7 }|S )Nr   z/ failed. We encountered the following error:
  z/
Please try to resolve the issue as follows:
  )mode)r   r   r   msgr   r   r   r   <   s   zFailedError._construct_message)NNN)__name__
__module____qualname____doc__r   r   __classcell__r   r   r   r   r   4   s    r   c                   @      e Zd ZdZdZdS )r   zcheck dataset errorzCheck datasetNr   r   r   r    r   r   r   r   r   r   H       r   c                   @   r"   )r   zconvert dataset errorzConvert datasetNr#   r   r   r   r   r   N   r$   r   c                   @   r"   )r   zsplit dataset errorzSplit datasetNr#   r   r   r   r   r   T   r$   r   c                   @   r"   )r   zanalyse dataset errorzAnalyse datasetNr#   r   r   r   r   r   Z   r$   r   c                       s"   e Zd ZdZd fdd	Z  ZS )r   zdataset file not found errorNc                    s.   |d u r|d ur| d}t  ||| d S )Nz does not exist.)r   r   )r   	file_pathr   r   r   r   r   r   r   c   s   
z!DatasetFileNotFoundError.__init__)NNNN)r   r   r   r    r   r!   r   r   r   r   r   `   s    r   c                 C   s
   t | tS )zis known error type)
isinstancer   )r	   r   r   r   r   j   s   
r   )NN)
__all__r   	Exceptionr   r   r   r   r   r   r   r   r   r   r   <module>   s   


