
    i                         S SK Jr  S SKJrJrJr  S SKJr  S SKJ	r	   " S S\
5      r " S S\	5      r " S	 S
\5      r " S S\5      r " S S\5      r " S S\5      r " S S\
5      rg)    )Sequence)AnyOptionalUnion)Self)ExceptionGroupc                   J   ^  \ rS rSrSrS\S\SS4U 4S jjrS\4S jrS	r	U =r
$ )
StructureHandlerNotFoundError	   z_
Error raised when structuring cannot find a handler for converting inputs into
:attr:`type_`.
messagetype_returnNc                 <   > [         TU ]  X5        Xl        X l        g N)super__init__r   r   )selfr   r   	__class__s      L/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/cattrs/errors.pyr   &StructureHandlerNotFoundError.__init__   s    (
    c                     U R                   $ r   )r   r   s    r   __str__%StructureHandlerNotFoundError.__str__   s    ||r   )r   r   )__name__
__module____qualname____firstlineno____doc__strtyper   r   __static_attributes____classcell__r   s   @r   r
   r
   	   s3    
 D T 
  r   r
   c                   f   ^  \ rS rSr% \\S'   S\S\\   S\S\	4U 4S jjr
S\\   S\	4S jrSrU =r$ )	BaseValidationError   clr   excsr   c                 4   > [         TU ]  XU5      nX4l        U$ r   )r   __new__r)   )clsr   r*   r)   objr   s        r   r,   BaseValidationError.__new__   s    gocD1
r   c                 N    U R                  U R                  XR                  5      $ r   )r   r   r)   )r   r*   s     r   deriveBaseValidationError.derive    s    ~~dllD''::r    )r   r   r   r   r"   __annotations__r!   r   	Exceptionr   r,   r1   r#   r$   r%   s   @r   r'   r'      sK    Hc ))< $ 4 
;8I. ;4 ; ;r   r'   c                       \ rS rSr% Sr\\\4   \S'   \	\S'   S\S\\\4   S\	S\
4S jrS\\\\\4   \	4   4S jrS	rg
)IterableValidationNote$   zNAttached as a note to an exception when an iterable element fails structuring.indexr"   stringr   c                 H    [         R                  X5      nX$l        X4l        U$ r   )r!   r,   r9   r"   )r-   r:   r9   r"   instances        r   r,   IterableValidationNote.__new__*   s    ;;s+r   c                 F    [        U 5      U R                  U R                  4$ r   )r!   r9   r"   r   s    r   __getnewargs__%IterableValidationNote.__getnewargs__0   s    D	4::tyy11r   r3   N)r   r   r   r   r    r   intr!   r4   r   r   r,   tupler?   r#   r3   r   r   r7   r7   $   sa    Xc?
IS sCx   2c5c?C&? @ 2r   r7   c                   F    \ rS rSrSrS\\\\\4      \\   4   4S jr	Sr
g)IterableValidationError4   z$Raised when structuring an iterable.r   c                    / n/ nU R                    Hs  n[        US5      (       aN  UR                   H+  nUR                  [        L d  M  UR                  X445          MM     UR                  U5        Mb  UR                  U5        Mu     X4$ zHSplit the exceptions into two groups: with and without validation notes.	__notes__)
exceptionshasattrrH   r   r7   appendr   excs_with_notes
other_excssubexcnotes        r   group_exceptions(IterableValidationError.group_exceptions7   s     
ooFv{++",,D~~)??'..~> -
 %%f-!!&) & **r   r3   N)r   r   r   r   r    rB   listr5   r7   rQ   r#   r3   r   r   rD   rD   4   s0    .+	tE)%;;<=tIN	O+r   rD   c                   b    \ rS rSr% Sr\\S'   \\S'   S\S\S\S\4S jr	S\
\\\4   4S jrS	rg
)AttributeValidationNoteK   zGAttached as a note to an exception when an attribute fails structuring.namer"   r:   r   c                 H    [         R                  X5      nX$l        X4l        U$ r   )r!   r,   rW   r"   )r-   r:   rW   r"   r<   s        r   r,   AttributeValidationNote.__new__Q   s    ;;s+r   c                 F    [        U 5      U R                  U R                  4$ r   )r!   rW   r"   r   s    r   r?   &AttributeValidationNote.__getnewargs__W   s    D	499dii00r   r3   N)r   r   r   r   r    r!   r4   r   r   r,   rB   r?   r#   r3   r   r   rU   rU   K   sG    Q
I
IS  3 4 1c3m 4 1r   rU   c                   F    \ rS rSrSrS\\\\\4      \\   4   4S jr	Sr
g)ClassValidationError[   z=Raised when validating a class if any attributes are invalid.r   c                    / n/ nU R                    Hs  n[        US5      (       aN  UR                   H+  nUR                  [        L d  M  UR                  X445          MM     UR                  U5        Mb  UR                  U5        Mu     X4$ rG   )rI   rJ   rH   r   rU   rK   rL   s        r   rQ   %ClassValidationError.group_exceptions^   s     
ooFv{++",,D~~)@@'..~> -
 %%f-!!&) & **r   r3   N)r   r   r   r   r    rB   rS   r5   rU   rQ   r#   r3   r   r   r]   r]   [   s0    G+	tE)%<<=>YO	P+r   r]   c                   Z   ^  \ rS rSrSrS\\   S\S\\   SS4U 4S jjr	S\4S	 jr
S
rU =r$ )ForbiddenExtraKeysErrorr   a
  
Raised when `forbid_extra_keys` is activated and such extra keys are detected
during structuring.

The attribute `extra_fields` is a sequence of those extra keys, which were the
cause of this error, and `cl` is the class which was structured with those extra
keys.
r   r)   extra_fieldsr   Nc                 J   > Xl         X l        X0l        [        TU ]  XU5        g r   )r   r)   rd   r   r   )r   r   r)   rd   r   s       r   r    ForbiddenExtraKeysError.__init__|   s$     (l3r   c                     U R                   =(       d>    SU R                  R                   SSR                  [	        U R
                  5      5       3$ )Nz Extra fields in constructor for z: z, )r   r)   r   joinsortedrd   r   s    r   r   ForbiddenExtraKeysError.__str__   sF    LL 61$''2B2B1C2yy 1 12346	
r   )r)   rd   r   )r   r   r   r   r    r   r!   r"   setr   r   r#   r$   r%   s   @r   rb   rb   r   sF    4}4*.4>A#h4	4
 
 
r   rb   N)collections.abcr   typingr   r   r   typing_extensionsr   cattrs._compatr   r5   r
   r'   r!   r7   rD   rU   r]   rb   r3   r   r   <module>rp      sj    $ ' ' " )I 	;. 	;2S 2 +1 +.1c 1 +. +.
i 
r   