+
    7*iP9  c                   s  a  R8 t?0 t ^ RIt^ RIHt ^ RIHtHtHt ^ RIH	t	 ^ RI
Ht ^ RIHtHtHtHtHtHtHtHtHtHtHtHt ^ RIHt ^ RIHt ^ R	IHtHt ]'       d   ^ R
IH t   ! R R4      t!]'       d[   ^ RI"H#t# ^ RI$H%t% ^ RI&H't' ^ RI(H)t) ]]]),          ]]]*]3,          ]']]%,          .]3,          t+]]+,          t,]]*]]!,          3,          t-].! 4       t/] ^ k Rt0Rt1RRRRRRRRRRRR/R R llt2]R R l4       t3]RRRRRR/R  R! ll4       t3R9RRRRRR/R" R# lllt3R$ R% lt4 ! R& R'4      t5R( R) lt6R* R+ lt7R, R- lt8R. R/ lt9R0 R1 lt:0 R:mt;R2 R3 lt<R4 R5 lt=R6 R7 lt>R# );    N)ChainMap)partialpartialmethodwraps)chain)FunctionType)TYPE_CHECKINGAnyCallableDictIterableListOptionalSetTupleTypeUnionoverload)ConfigErrorAnyCallable)ROOT_KEY
in_ipython)AnyClassMethodc                   s:   a  ] tR t^t o RtRV 3R lR lltRtV tR# )	Validatorc                s>   < V ^8  d   QhRS[ RS[RS[RS[RS[RS[/# )   funcpre	each_itemalwayscheck_fieldsskip_on_failurer   boolformat__classdict__   "A/usr/lib/python3.14/site-packages/pydantic/v1/class_validators.py__annotate__ZValidator.__annotate__   sG     / // / 	/
 / / /    c                sN    Wn         W n        W0n        W@n        WPn        W`n        R # Nr   r   r   r   r   r    )selfr   r   r   r   r   r    s   &&&&&&&r'   __init__ZValidator.__init__   s$     	"(.r)   )r   r   r   r   r   r    Nr+   )FFFFF)__name__
__module____qualname____firstlineno__Z	__slots__r-   __static_attributes____classdictcell__r%      @r'   r   r      s     WI/ / /r)   r   )	Signature)
BaseConfig)
ModelField)	ModelOrDcZ__validator_config__Z__root_validator_config__r   Fr   r   r   Twholeallow_reusec                s    V ^8  d   QhR\         R\        R\        R\        R\        R\        \        ,          R\        R\        \        .R	3,          /# )
r   fieldsr   r   r   r   r:   r;   returnr   )strr"   r   r	   r   r$      "r'   r(   r(   4   si     4 44	4 4 	4
 4 D>4 4 {m--.4r)   c                sz  a aaaaa S'       g   \        R4      h\        S^ ,          \        4      '       d   \        R4      h\        ;QJ d    R S 4       F  '       d   K   RM	  RM! R S 4       4      '       g   \        R4      hVe#   \        P
                  ! R\        4       V'       * oR VVVVVV 3R	 llpV# )
a  
Decorate methods on the class indicating that they should be used to validate fields
:param fields: which field(s) the method should be called on
:param pre: whether or not this validator should be called before the standard validators (else after)
:param each_item: for complex objects (sets, lists etc.) whether to validate individual elements rather than the
  whole object
:param always: whether this method and other validators should be called even if the value is missing
:param check_fields: whether to check that the fields actually exist on the model
:param allow_reuse: whether to track and raise an error if another validator refers to the decorated function
z"validator with no fields specifiedz}validators should be used with fields and keyword arguments, not bare. E.g. usage should be `@validator('<field_name>', ...)`c              3   sB   "   T F  p\        V\        4      x  K  	  R # 5ir*   )
isinstancer>   ).0field   & r'   	<genexpr>Zvalidator.<locals>.<genexpr>N   s     <VEE3''Vs   FTzvalidator fields should be passed as separate string args. E.g. usage should be `@validator('<field_name_1>', '<field_name_2>', ...)`zdThe "whole" keyword argument is deprecated, use "each_item" (inverse meaning, default False) insteadc                (    V ^8  d   QhR\         RR/# r   fr=   r   r   r?   r@   r'   r(   Zvalidator.<locals>.__annotate__\   s     
 
{ 
/ 
r)   c                 sv   < \        V S4      p\        V\        S\        VP                  SSSSR 7      34       V# ))r   r   r   r   r   )_prepare_validatorsetattrVALIDATOR_CONFIG_KEYr   __func__)rH   f_clsr;   r   r   r   r<   r   s   & r'   decZvalidator.<locals>.dec\   sB    "1k2 u~~3)TZiuv	
 r)   )r   rA   r   ZallwarningsZwarnZDeprecationWarning)r   r   r   r   r:   r;   r<   rN   s   dddd$dj r'   	validatorrP   4   s    & >??	F1I|	,	,E
 	
 S<V<SSS<V<<<Y
 	

 r	

 I	
 
 Jr)   c                rF   )r   _funcr=   r   r   r?   r@   r'   r(   r(   l   s      + *: r)   c                     R # r*    )rQ   s   &r'   root_validatorrT   k   s    r)   r    c          
      sd    V ^8  d   QhR\         R\         R\         R\        \        .R3,          /# )r   r   r;   r    r=   r   )r"   r	   r   r?   r@   r'   r(   r(   q   s9      '+FJ{m--.r)   c                 rR   r*   rS   )r   r;   r    s   $$$r'   rT   rT   p   s     r)   c                s    V ^8  d   QhR\         \        ,          R\        R\        R\        R\        R\        \        .R3,          3,          /# )r   rQ   r   r;   r    r=   r   )r   r   r"   r   r	   r?   r@   r'   r(   r(   w   sQ      K 15LPko
X{m5E&EFFGr)   c          
     s   aaa V '       d6   \        V S4      p\        V\        \        VP                  SSR7      4       V# R VVV3R llpV# )z
Decorate methods on a model indicating that they should be used to validate (and perhaps modify) data either
before or after standard model parsing/validation is performed.
r   r   r    c                rF   rG   r   r?   r@   r'   r(   Z$root_validator.<locals>.__annotate__   s      { / r)   c           
      sn   < \        V S4      p\        V\        \        VP                  SSR 7      4       V# )rU   rI   rJ   ROOT_VALIDATOR_CONFIG_KEYr   rL   )rH   rM   r;   r   r    s   & r'   rN   Zroot_validator.<locals>.dec   s5    "1k2,iU^^QTfu.v	
 r)   rV   )rQ   r   r;   r    rM   rN   s   &ddd  r'   rT   rT   w   sK     "5+6,iU^^QTfu.v	
   Jr)   c                s4    V ^8  d   QhR\         R\        RR/# )r   functionr;   r=   r   r!   r?   r@   r'   r(   r(      s"       4 DT r)   c           	     s|   \        V \        4      '       d   T M
\        V 4      p\        4       '       g   V'       g   \        VP                  RR4      R,           \        VP                  RR\        VP                  4       R24      ,           pV\        9   d   \        RV R24      h\        P                  V4       V# )	z
Avoid validators with duplicated names since without this, validators can be overwritten silently
which generally isn't the intended behaviour, don't run in ipython (see #312) or if allow_reuse is False.
r/   z<No __module__>Z.r0   z<No __qualname__: id:>zduplicate validator function "z."; if this is intended, set `allow_reuse=True`)	rA   Zclassmethodr   getattrrL   id_FUNCSr   add)rX   r;   rM   Zref   &&  r'   rI   rI      s    
 #8[99H{8?TE<<ENNL2CDennn8MbQVQ_Q_N`Maab6cde 	
 &= >seCqrss

3Lr)   c                   sV   a  ] tR t^t o V 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )	ValidatorGroupc                s"   < V ^8  d   QhRRRR/# )r   
validatorsValidatorListDictr=   NrS   r#   r&   r'   r(   ValidatorGroup.__annotate__   s     % %#6 %4 %r)   c                s"    Wn         R 0V n        R# )*N)r`   used_validators)r,   r`   s   &&r'   r-   ZValidatorGroup.__init__   s    $ #ur)   c                sL   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          /# )r   namer=   )r>   r   r
   r   r#   r&   r'   r(   rb      s)      3 8Di4H+I r)   c                sf   V P                   P                  V4       V P                  P                  V. 4      pV\        8w  d#   W P                  P                  R . 4      ,          pV'       d@   V Uu/ uF2  p\        VP                  RR\        VP                  4       R24      VbK4  	  up# R# u upi )rc   r.   <No __name__: id:rY   N)rd   r]   r`   Zgetr   rZ   r   r[   )r,   re   r`   vr^   r'   get_validatorsZValidatorGroup.get_validators   s      &__((r2
8//--c266J_ij_iZ[GAFFJ2CBqvvJ<q0QRTUU_ijj ks   18B.c                s   < V ^8  d   QhRR/# )r   r=   NrS   r#   r&   r'   r(   rb      s      $ r)   c                s   a  \        \        P                  ! V 3R  lS P                  P	                  4       S P
                  ,
           4       4      4      pV'       d!   RP                  V4      p\        RV R24      hR# )c              3   sX   <"   T F  pR  SP                   V,           4       x  K!  	  R# 5i)c           	   3   s   "   T FG  pVP                   '       g   K  \        VP                  R R\        VP                  4       R24      x  KI  	  R# 5i)r.   rf   rY   N)r   rZ   r   r[   )rB   rg   rD   r'   rE   Z<ValidatorGroup.check_for_unused.<locals>.<genexpr>.<genexpr>   sC      /~~ SGAFFJ2CBqvvJ<q0QRR/s
   A6AN)r`   )rB   rH   r,   s   & r'   rE   Z2ValidatorGroup.check_for_unused.<locals>.<genexpr>   s4        HA!__Q/ 
 Hs   '*z, z*Validators defined with incorrect fields: zO (use check_fields=False if you're inheriting from the model and intended this)N)setr   Zfrom_iterabler`   keysrd   Zjoinr   )r,   Zunused_validatorsZfns   f  r'   check_for_unusedZValidatorGroup.check_for_unused   s}       //..043G3GG  	
 ,-B<RD Aa b  r)   )rd   r`   N)	r.   r/   r0   r1   r-   rh   rk   r2   r3   r4   r5   r'   r_   r_      s#     % %  r)   r_   c                s    V ^8  d   QhR\         \        \        3,          R\         \        \        \        ,          3,          /# r   	namespacer=   )r
   r>   r   r   r   r?   r@   r'   r(   r(      s0      $sCx. T#tI:N5O r)   c                 s    / pV P                  4        FQ  w  r#\        V\        R 4      pV'       g   K   Vw  rVV F'  pWq9   d   W,          P                  V4       K"  V.W&   K)  	  KS  	  V# r*   )itemsrZ   rK   append)rm   r`   Zvar_namevaluevalidator_configr<   rg   rC   s   &       r'   extract_validatorsrr      sj    -/J$??,"5*>E(IF&%,,Q/)*J%	  	 - r)   c          	      s    V ^8  d   QhR\         \        \        3,          R\        \        \
        ,          \        \        \        \
        3,          ,          3,          /# rl   )r
   r>   r   r   r   r   r"   r?   r@   r'   r(   r(      sD     + +tCH~ +%[@QSWX]^bdo^oXpSq@q:r +r)   c                 s   ^ RI Hp . p. pV P                  4        F  w  rE\        V\        R4      pV'       g   K   V! VP
                  4      p\        VP                  P                  4       4      pV^ ,          R8X  d   \        RV RV R24      h\        V4      ^8w  d   \        RV RV R24      hVP                  '       d   VP                  VP
                  4       K  VP                  VP                  VP
                  34       K  	  W#3# )r    	signatureNr,   z%Invalid signature for root validator : zC, "self" not permitted as first argument, should be: (cls, values).z, should be: (cls, values).)inspectrt   rn   rZ   rW   r   list
parametersrj   r   Zlenr   ro   r    )	rm   rt   Zpre_validatorsZpost_validatorsre   rp   rq   sigargss	   &        r'   extract_root_validatorsr{      s
   !(*N68O (07?XZ^0_,112C++-.DAw& !;D6C5 I0 1  4yA~!$I$rRUQVVq"rss###%%&6&;&;<&&(8(H(HJZJ_J_'`a! )" **r)   c                s$    V ^8  d   QhRRRRRR/# )r   base_validatorsra   r`   r=   rS   r?   r@   r'   r(   r(      s$      (; I\ at r)   c                 st    V P                  4        F#  w  r#W!9  d   . W&   W;;,          V,          uu&   K%  	  V# r*   )rn   )r|   r`   rC   Zfield_validatorsr^   r'   inherit_validatorsr}      s=    #2#8#8#:" "J-- $; r)   c                rF   )r   rP   r=   ValidatorCallabler   r?   r@   r'   r(   r(      s     $U $Uk $U6I $Ur)   c           
     s   ^ RI Hp \        V \        \        34      '       g-   V! V 4      p\        VP                  P                  4       4      pM|V! V P                  4      pV! V P                  4      P                  P                  4        Uu. uF6  pW@P                  V P                  P                  4       ,          9  g   K4  VNK8  	  ppVP                  ^ 4      pVR8X  d   \        RV  RV R24      hVR8X  d,   \        V 4      ! \        W\        VR,          4      4      4      # \        V 4      ! \!        W\        V4      4      4      # u upi )a  
Make a generic function which calls a validator with the right arguments.

Unfortunately other approaches (eg. return a partial of a function that builds the arguments) is slow,
hence this laborious way of doing things.

It's done like this so validators don't all need **kwargs in their signature, eg. any combination of
the arguments "values", "fields" and/or "config" are permitted.
rs   r,    Invalid signature for validator ru   z, "self" not permitted as first argument, should be: (cls, value, values, config, field), "values", "config" and "field" are all optional.cls:i   NN)rv   rt   rA   r   r   rw   rx   rj   r   rz   ZkeywordsZpopr   r   _generic_validator_clsri   _generic_validator_basic)rP   rt   ry   rz   kZ	first_args   &     r'   make_generic_validatorr      s0    "i'=!9::	"CNN'')* 	' y~~.99>>@
@););)@)@)BBB A@ 	 
 IF.ykC5 Ao p
 	
 
e	Y 6ys4PR8} UVV Y 8T STT#
s   1EEc                s>    V ^8  d   QhR\         \        ,          RR/# )r   v_funcsr=   ValidatorsList)r   r   r?   r@   r'   r(   r(     s      = =Xk2 =7G =r)   c                 sT    V  Uu. uF  q'       g   K  \        V4      NK  	  up# u upi r*   )r   )r   rH   rD   r'   prep_validatorsr     s%    /6<w!!%"1%w<<<s   	%%c                N    V ^8  d   QhR\         RRR\        \        ,          RR/# r   rP   ry   r6   rz   r=   r~   r   r   r>   r?   r@   r'   r(   r(      s3     r rk r r3s8 rXk rr)   c                   a  R pRV9   d   RpVR0,          pVP                  \        4      '       g   \        RS  RV R24      hV'       d   V 3R l# V\        4       8X  d   V 3R l# VR08X  d   V 3R	 l# VR
08X  d   V 3R l# VR08X  d   V 3R l# VRR
08X  d   V 3R l# VRR08X  d   V 3R l# VR
R08X  d   V 3R l# V 3R l# )FkwargsTr   ru   zb, should be: (cls, value, values, config, field), "values", "config" and "field" are all optional.c                    < S! WW#VR 7      # )valuesrC   configrS   r   rg   r   rC   r   rP      &&&&&r'   <lambda>(_generic_validator_cls.<locals>.<lambda>.      Ysfjp5qr)   c                 s   < S! W4      # r*   rS   r   r   r'   r   r   0  s
    Ys5Fr)   r   c                 s   < S! WVR 7      # )r   rS   r   r   r'   r   r   2      Ysf5Ur)   rC   c                 s   < S! WVR 7      # )rC   rS   r   r   r'   r   r   4  s    YsU5Sr)   r   c                 s   < S! WVR 7      # )r   rS   r   r   r'   r   r   6  r   r)   c                 s   < S! WW#R 7      # )r   rC   rS   r   r   r'   r   r   8  s    Ysf5br)   c                 s   < S! WW$R 7      # )r   r   rS   r   r   r'   r   r   :  s    Ysf5dr)   c                 s   < S! WW4R 7      # )rC   r   rS   r   r   r'   r   r   <  s    YsU5br)   c                 r   r   rS   r   r   r'   r   r   ?  r   r)   Zissubset
all_kwargsr   ri   rP   ry   rz   Z
has_kwargs   f&& r'   r   r      s    J4

==$$.ykC5 Ad e
 	

 qq	FF	(	UU	'	SS	(	UU	(G$	$bb	(H%	%dd	'8$	$bb rqr)   c                r   r   r   r?   r@   r'   r(   r(   B  s4     m m m+ mSQTX mZm mr)   c                 r   )Fr   Tr   ru   z], should be: (value, values, config, field), "values", "config" and "field" are all optional.c                    < S! WW4R 7      # r   rS   r   r   r'   r   *_generic_validator_basic.<locals>.<lambda>O      YqW\5lr)   c                 s   < S! V4      # r*   rS   r   r   r'   r   r   Q  s	    Yq\r)   r   c                 s   < S! WR 7      # r   rS   r   r   r'   r   r   S  
    Yq5Pr)   rC   c                 s   < S! WR 7      # r   rS   r   r   r'   r   r   U  s
    Yq5Nr)   r   c                 s   < S! WR 7      # r   rS   r   r   r'   r   r   W  r   r)   c                 s   < S! WVR 7      # r   rS   r   r   r'   r   r   Y  s    YqW\5]r)   c                 s   < S! WVR 7      # r   rS   r   r   r'   r   r   [  s    YqX^5_r)   c                 s   < S! WVR 7      # r   rS   r   r   r'   r   r   ]  s    YqV\5]r)   c                 r   r   rS   r   r   r'   r   r   `  r   r)   r   r   r   r'   r   r   B  s    J4

==$$.ykC5 A_ `
 	

 ll	AA	(	PP	'	NN	(	PP	(G$	$]]	(H%	%__	'8$	$]] mlr)   c                sB    V ^8  d   QhRRR\         \        R3,          /# )r   type_r9   r=   r   )r
   r>   r?   r@   r'   r(   r(   c  s%       c;K6K1L r)   c                 s   \        V P                   Uu. uF  qP                  NK  	  up!  pVP                  4        UUu/ uF5  w  r4\	        V\
        4      '       g   \	        V\        4      '       g   K3  W4bK7  	  upp# u upi u uppi r*   )r   Z__mro__Z__dict__rn   ZhasattrrK   rW   )r   r   Zall_attributesr   rg   s   &    r'   gather_all_validatorsr   c  su    FFGN #((**DA1*++wq:S/T 	*   Gs   A? 0B5Bc                sV    V ^8  d   Qh/ ^ \         9   d   \        \        ,          ;R&   # )r   r\   )__conditional_annotations__r   r>   r?   r@   r'   r(   r(      s    \  C ] r)   r*   >   rC   r   r   )@r   rO   Zcollectionsr   Z	functoolsr   r   r   Z	itertoolsr   Ztypesr   Ztypingr   r   r	   r
   r   r   r   r   r   r   r   r   Zpydantic.v1.errorsr   Zpydantic.v1.typingr   Zpydantic.v1.utilsr   r   r   r   rv   r6   Zpydantic.v1.configr7   Zpydantic.v1.fieldsr8   Zpydantic.v1.typesr9   r>   r~   r   ra   ri   r\   rK   rW   rP   rT   rI   r_   rr   r{   r}   r   r   r   r   r   r   r(   )r   r5   r'   <module>r      s      3 3   r r r r * * 21/ /( !--+ (9"5sDcNJX\]gXh!ikn!no+,NS$y/125 - 7 44 4 	4
 4 !4 4n 
 
 
.3MR 
8=SXrw 0$ D+2$UN= +
rDmBr)   