
    |-j                         g d Z ddZ G d de          Z G d de          Z G d de          Z G d	 d
e          Z G d de          Z G d de          Zd Z	dS ))build_res_dictCheckFailedErrorConvertFailedErrorSplitFailedErrorAnalyseFailedErrorDatasetFileNotFoundErrorNc                    | r8|t          d|  d          |t          d|  d          t          d
d| i|S |t          d|  d          |$t          |          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   kwargss       j/var/www/html/banglarbhumi/venv/lib/python3.11/site-packages/paddlex/modules/base/dataset_checker/utils.pyr   r      s     YL:LLL   K:KKK   44z4V444U
UUUVVV?#H--        XzHgXXQWXXX    c                   *     e Zd ZdZd fd	Zd Z xZS )FailedErrorzbase error classNc                 z    ||                      ||          }t                                          |           d S )N)_construct_messagesuper__init__)selferr_infosolutionmessage	__class__s       r   r   zFailedError.__init__7   s;    ?--hAAG!!!!!r   c                 :    |dS | j          d| }||d| z  }|S )Nr
   z/ failed. We encountered the following error:
  z/
Please try to resolve the issue as follows:
  )mode)r   r   r   msgs       r   r   zFailedError._construct_message<   sG    2 9XXhXX  #U8UUUJr   )NNN)__name__
__module____qualname____doc__r   r   __classcell__r   s   @r   r   r   4   sR        " " " " " "
	 	 	 	 	 	 	r   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           DDDr   r   c                       e Zd ZdZdZdS )r   zconvert dataset errorzConvert datasetNr)   r   r   r   r   r   N           DDDr   r   c                       e Zd ZdZdZdS )r   zsplit dataset errorzSplit datasetNr)   r   r   r   r   r   T   r*   r   r   c                       e Zd ZdZdZdS )r   zanalyse dataset errorzAnalyse datasetNr)   r   r   r   r   r   Z   r,   r   r   c                   $     e Zd ZdZd fd	Z xZS )r   zdataset file not found errorNc                 `    ||| d}t                                          |||           d S )Nz does not exist.)r   r   )r   	file_pathr   r   r   r   s        r   r   z!DatasetFileNotFoundError.__init__c   s?    $'9998W55555r   )NNNN)r"   r#   r$   r%   r   r&   r'   s   @r   r   r   `   sC        &&6 6 6 6 6 6 6 6 6 6r   r   c                 ,    t          | t                    S )zis known error type)
isinstancer   )r   s    r   r   r   j   s    h 0111r   )NN)
__all__r   	Exceptionr   r   r   r   r   r   r   r   r   r   <module>r6      sD     Y Y Y Y4    )   (    {              {          6 6 6 6 6/ 6 6 62 2 2 2 2r   