
    bMhr                    |   d Z ddlmZ ddlZddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ dZd e             dZed         Z G d d          Z G d dee          Z G d dee          Z G d dee          Z G d de          Z G d de          Z G d de          Z ee           Z!dS )zPydantic-specific errors.    )annotationsN)AnyClassVarLiteral)Self)	Qualifier)_repr   )getattr_migration)version_short)PydanticUserErrorPydanticUndefinedAnnotationPydanticImportErrorPydanticSchemaGenerationErrorPydanticInvalidForJsonSchemaPydanticForbiddenQualifierPydanticErrorCodeszhttps://errors.pydantic.dev/z/u/)0zclass-not-fully-definedzcustom-json-schemazdecorator-missing-fieldzdiscriminator-no-fieldzdiscriminator-alias-typezdiscriminator-needs-literalzdiscriminator-aliaszdiscriminator-validatorzcallable-discriminator-no-tagztyped-dict-versionzmodel-field-overriddenzmodel-field-missing-annotationzconfig-bothzremoved-kwargszcircular-reference-schemainvalid-for-json-schemazjson-schema-already-usedzbase-model-instantiatedundefined-annotationschema-for-unknown-typeimport-errorzcreate-model-field-definitionszvalidator-no-fieldszvalidator-invalid-fieldszvalidator-instance-methodzvalidator-input-typezroot-validator-pre-skipz model-serializer-instance-methodzvalidator-field-config-infozvalidator-v1-signaturezvalidator-signaturezfield-serializer-signaturezmodel-serializer-signaturezmultiple-field-serializerszinvalid-annotated-typeztype-adapter-config-unusedzroot-model-extrazunevaluable-type-annotationz dataclass-init-false-extra-allowzclashing-init-and-init-varzmodel-config-invalid-field-namezwith-config-on-modelzdataclass-on-modelzvalidate-call-typezunpack-typed-dictzoverlapping-unpack-typed-dictzinvalid-self-typez validate-by-alias-and-name-falsec                  "    e Zd ZdZddZdd	Zd
S )PydanticErrorMixinzA mixin class for common functionality shared by all Pydantic-specific errors.

    Attributes:
        message: A message describing the error.
        code: An optional error code from PydanticErrorCodes enum.
    messagestrcodePydanticErrorCodes | NonereturnNonec               "    || _         || _        d S )Nr   r   )selfr   r   s      O/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pydantic/errors.py__init__zPydanticErrorMixin.__init__Z   s    			    c                N    | j         | j        S | j         dt           | j          S )Nz 

For further information visit )r   r   DEV_ERROR_DOCS_URL)r"   s    r#   __str__zPydanticErrorMixin.__str__^   s2    9<leeFXeZ^Zceeer%   N)r   r   r   r   r   r   )r   r   )__name__
__module____qualname____doc__r$   r(    r%   r#   r   r   R   sL            f f f f f fr%   r   c                      e Zd ZdZdS )r   z1An error raised due to incorrect use of Pydantic.N)r)   r*   r+   r,   r-   r%   r#   r   r   e   s        ;;;;r%   r   c                  <     e Zd ZdZd fdZedd            Z xZS )r   zA subclass of `NameError` raised when handling undefined annotations during `CoreSchema` generation.

    Attributes:
        name: Name of the error.
        message: Description of the error.
    namer   r   r   r   c                \    || _         t                                          |d           d S )Nr   r!   )r0   superr$   )r"   r0   r   	__class__s      r#   r$   z$PydanticUndefinedAnnotation.__init__q   s.    	/EFFFFFr%   
name_error	NameErrorr   c                    	 |j         }nE# t          $ r8 t          j        dt	          |                                        d          }Y nw xY w | |t	          |                    S )zConvert a `NameError` to a `PydanticUndefinedAnnotation` error.

        Args:
            name_error: `NameError` to be converted.

        Returns:
            Converted `PydanticUndefinedAnnotation` error.
        z	.*'(.+?)'r
   )r0   r   )r0   AttributeErrorresearchr   group)clsr4   r0   s      r#   from_name_errorz+PydanticUndefinedAnnotation.from_name_erroru   st    	E?DD 	E 	E 	E9\3z??;;AA!DDDDD	Esc*oo6666s   
 ?AA)r0   r   r   r   r   r   )r4   r5   r   r   )r)   r*   r+   r,   r$   classmethodr<   __classcell__r3   s   @r#   r   r   i   sm         G G G G G G 7 7 7 [7 7 7 7 7r%   r   c                  $     e Zd ZdZd fdZ xZS )r   zAn error raised when an import fails due to module changes between V1 and V2.

    Attributes:
        message: Description of the error.
    r   r   r   r   c                N    t                                          |d           d S )Nr   r   r2   r$   r"   r   r3   s     r#   r$   zPydanticImportError.__init__   s&    ~66666r%   r   r   r   r   r)   r*   r+   r,   r$   r>   r?   s   @r#   r   r      sG         7 7 7 7 7 7 7 7 7 7r%   r   c                  $     e Zd ZdZd fdZ xZS )r   zAn error raised during failures to generate a `CoreSchema` for some type.

    Attributes:
        message: Description of the error.
    r   r   r   r   c                N    t                                          |d           d S )Nr   rB   rC   rD   s     r#   r$   z&PydanticSchemaGenerationError.__init__   '    '@AAAAAr%   rE   rF   r?   s   @r#   r   r      Q         B B B B B B B B B Br%   r   c                  $     e Zd ZdZd fdZ xZS )r   zAn error raised during failures to generate a JSON schema for some `CoreSchema`.

    Attributes:
        message: Description of the error.
    r   r   r   r   c                N    t                                          |d           d S )Nr   rB   rC   rD   s     r#   r$   z%PydanticInvalidForJsonSchema.__init__   rI   r%   rE   rF   r?   s   @r#   r   r      rJ   r%   r   c                  B     e Zd ZU dZdddddddZd	ed
<   d fdZ xZS )r   zLAn error raised if a forbidden type qualifier is found in a type annotation.ztyping.Requiredztyping.NotRequiredztyping.ReadOnlyztyping.ClassVarzdataclasses.InitVarztyping.Final)requirednot_required	read_only	class_varinit_varfinalzClassVar[dict[Qualifier, str]]_qualifier_repr_map	qualifierr   
annotationr   r   r   c                    t                                          dt          j        |          d| j        |         dd            d S )NzThe annotation z contains the z? type qualifier, which is invalid in the context it is defined.r!   )r2   r$   r	   display_as_typerT   )r"   rU   rV   r3   s      r#   r$   z#PydanticForbiddenQualifier.__init__   sp    R%"7
"C"C R RUYUmnwUx R R R  	 	
 	
 	
 	
 	
r%   )rU   r   rV   r   r   r   )r)   r*   r+   r,   rT   __annotations__r$   r>   r?   s   @r#   r   r      sz         VV &,&&); ;    
 
 
 
 
 
 
 
 
 
r%   r   )"r,   
__future__r   _annotationsr8   typingr   r   r   typing_extensionsr   typing_inspection.introspectionr   pydantic._internalr	   
_migrationr   versionr   __all__r'   r   r   	TypeErrorr   r5   r   ImportErrorr   r   r   r   r)   __getattr__r-   r%   r#   <module>rf      s.     2 2 2 2 2 2 				 ) ) ) ) ) ) ) ) ) ) " " " " " " 5 5 5 5 5 5 $ $ $ $ $ $ ) ) ) ) ) ) " " " " " " IMMOOHHH /(1 hf f f f f f f f&< < < < <*I < < <7 7 7 7 7"4i 7 7 7:7 7 7 7 7,k 7 7 7B B B B B$5 B B BB B B B B#4 B B B
 
 
 
 
!2 
 
 
,  ))r%   