+
    PjTe                     >  a  R: tE0 t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtHtH	t	H
t
Ht ^ RIHtHt ^ RIHtHtHtHtHtHtHtHtHtHt  ^ RIHtHt ^R	IH t H!t!H"t" ]].R3,          t#]! R
4      t$]! R]%]&]3,          R7      t'](! 4       t)]R R l4       t*]RR/R R ll4       t*R<RR/R R lllt*R R lt+]R R l4       t,R R lt-]]RRRRR3R R llt.R R lt/R  R! lt0R" R# lt1R$ R% lt2R& R' lt3R( R) lt4R* R+ lt5R, R- lt6R. R/ lt7R0 R1 lt8R2 R3 lt9R4 R5 lt:R6 R7 lt;R8 R9 lt<]]2]]3]=]4]%]5]>]6]?]7]P                  P                  ]8/tB] ^ k ]2]B]P                  &   . R=OtDR#   ] d1     ^ RIHtHt  EL(  ] d    ]! RR;/ 4      t]! RR;/ 4      t  ELGi ; ii ; i)>    N)Callable)MISSINGFieldfieldfieldsmake_dataclass)	lru_cachewraps)
	AnnotatedAny
ForwardRefLiteralTypeTypeVarUnionget_args
get_originoverload)NotRequiredRequiredr   r   )#StrictDataclassClassValidationErrorStrictDataclassDefinitionError#StrictDataclassFieldValidationErrorTTypedDictType)boundc                \    V ^8  d   QhR\         \        ,          R\         \        ,          /#    clsreturnr   r   )formats   "t/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/huggingface_hub/dataclasses.py__annotate__r%   1   s     ( (Q (DG (    c                     R # N )r    s   &r$   strictr*   0   s    %(r&   accept_kwargsFc                    V ^8  d   QhR\         R\        \        \        ,          .\        \        ,          3,          /# )r   r+   r!   )boolr   r   r   )r#   s   "r$   r%   r%   5   s&     O OT OhQy$q'7I.J Or&   c                     R # r(   r)   )r+   s   $r$   r*   r*   4   s    LOr&   c          
          V ^8  d   QhR\         \        ,          R,          R\        R\         \        ,          \        \         \        ,          .\         \        ,          3,          ,          /# )r   r    Nr+   r!   )r   r   r-   r   )r#   s   "r$   r%   r%   8   sS     c2 c2Q$ c2 c2$q'T\^bcd^e]fhlmnho]oTpJp c2r&   c               2   a R V3R llpV e	   V! V 4      # T# )a  
Decorator to add strict validation to a dataclass.

This decorator must be used on top of `@dataclass` to ensure IDEs and static typing tools
recognize the class as a dataclass.

Can be used with or without arguments:
- `@strict`
- `@strict(accept_kwargs=True)`

Args:
    cls:
        The class to convert to a strict dataclass.
    accept_kwargs (`bool`, *optional*):
        If True, allows arbitrary keyword arguments in `__init__`. Defaults to False.

Returns:
    The enhanced dataclass with strict validation on field assignment.

Example:
```py
>>> from dataclasses import dataclass
>>> from huggingface_hub.dataclasses import as_validated_field, strict, validated_field

>>> @as_validated_field
>>> def positive_int(value: int):
...     if not value >= 0:
...         raise ValueError(f"Value must be positive, got {value}")

>>> @strict(accept_kwargs=True)
... @dataclass
... class User:
...     name: str
...     age: int = positive_int(default=10)

# Initialize
>>> User(name="John")
User(name='John', age=10)

# Extra kwargs are accepted
>>> User(name="John", age=30, lastname="Doe")
User(name='John', age=30, *lastname='Doe')

# Invalid type => raises
>>> User(name="John", age="30")
huggingface_hub.errors.StrictDataclassFieldValidationError: Validation error for field 'age':
    TypeError: Field 'age' expected int, got str (value: '30')

# Invalid value => raises
>>> User(name="John", age=-1)
huggingface_hub.errors.StrictDataclassFieldValidationError: Validation error for field 'age':
    ValueError: Value must be positive, got -1
```
c                \    V ^8  d   QhR\         \        ,          R\         \        ,          /# r   r"   )r#   s   "r$   r%   strict.<locals>.__annotate__p   s&     h h$q' hd1g hr&   c           	        <a aaa \        S R 4      '       g   \        RS P                   R24      h/ p\        S 4       F  p. pVP	                  \        V4      4       VP                  P                  R4      pVea   \        V\        4      '       g   V.pV F0  p\        V4      '       d   K  \        RVP                   RV R24      h	  VP                  V4       W1VP                  &   K  	  VS n        S P                  oR V3R llpVS n        S'       d   S P                  p\!        V4      R	 V 3R
 ll4       pVS n        \        S R4      '       g   R R lp	V	S n        S P$                  o\!        S4      R V V3R ll4       p
S P&                  P(                  RJ d   V
S n        . p\+        S 4       F  pVP-                  R4      '       g   K  \/        S V4      p\1        V4      '       g   K;  \3        \4        P6                  ! V4      P8                  4      ^8w  d   \        RS P                   RV R24      hVP	                  V4       K  	  VS n        R V 3R llpRVn        \        S R4      '       d7   \/        S P>                  RR4      '       g   \        RS P                   R24      hVS n        S P                  o\!        S4      R V V3R ll4       p\A        S RV4       S # )__dataclass_fields__zClass 'z.' must be a dataclass before applying @strict.	validatorzInvalid validator for field '': z.. Must be a callable taking a single argument.c                @    V ^8  d   QhR\         R\        R\         RR/# )r   selfnamevaluer!   N)r   str)r#   s   "r$   r%   *strict.<locals>.wrap.<locals>.__annotate__   s(     
	0 
	0S 
	0 
	0C 
	0D 
	0r&   c                   < V P                   P                  V. 4       F  p V! V4       K  	  S! WV4       R#   \        \        3 d   p\	        YR7      ThRp?ii ; i)z1Custom __setattr__ method for strict dataclasses.)r   causeN)__validators__get
ValueError	TypeErrorr   )r8   r9   r:   r5   eoriginal_setattrs   &&&  r$   __strict_setattr__0strict.<locals>.wrap.<locals>.__strict_setattr__   sc     "0044T2>	Ze$ ? T/	 #I. Z=DRXYYZs   9A
AAc                (    V ^8  d   QhR\         RR/# r   kwargsr!   Nr   )r#   s   "r$   r%   r<      s      8  8  8  8r&   c                 :  < \        S4       Uu0 uF  q3P                  kK  	  ppVP                  4        UUu/ uF  w  rVWT9   g   K  WVbK  	  ppp\        V4      ^ 8  d&   \	        RSP
                   R\        V4       R24      h\        S4       F  pVP                  V9   d)   \        WP                  WsP                  ,          4       K<  VP                  \        Jd#   \        WP                  VP                  4       Kr  VP                  \        Jd'   \        WP                  VP                  4       4       K  \        RVP                   R24      h	  / pVP                  4        F  w  rW9  g   K  WV	&   K  	  V P                  ! R/ VB  R# u upi u uppi )r   zWhen `accept_kwargs=True`, z, accepts only keyword arguments, but found `z` positional args.zMissing required field - ''Nr)   )r   r9   itemslenrA   __name__setattrdefaultr   default_factoryrB   __post_init__)r8   argsrI   fdataclass_fieldskvstandard_kwargsadditional_kwargsr9   r:   r    s   &*,        r$   __init__&strict.<locals>.wrap.<locals>.__init__   sT    5;3K#@KqFFK #@4:LLN"\NDAaF[414N"\ t9q=$5cll^ D&&)$i[0BD 
  Avv0ffoff.EF'1ffaii8**'9ffa.?.?.AB'*DQVVHA(NOO % %'!#)<<>KD327$/ $2 ""7%67= $A"\s   F
FFrS   c                (    V ^8  d   QhR\         RR/# rH   rJ   )r#   s   "r$   r%   r<      s     3 3# 3$ 3r&   c                P    VP                  4        F  w  r#\        WV4       K  	  R# )z2Default __post_init__ to accept additional kwargs.N)rM   rP   )r8   rI   r9   r:   s   &,  r$   rS   +strict.<locals>.wrap.<locals>.__post_init__   s    '-||~E2 (6r&   c                $    V ^8  d   QhR\         /# )r   r!   )r;   )r#   s   "r$   r%   r<      s     k k# kr&   c                    < S! V 4      pV P                   P                  4        UUu. uF!  w  r#VSP                  9  g   K  R V RV: 2NK#  	  pppRP                  V4      pV'       d   VRR  RV R2# T# u uppi )*=z, N))__dict__rM   r4   join)r8   standard_reprrW   rX   rZ   additional_reprr    original_reprs   &     r$   __repr__&strict.<locals>.wrap.<locals>.__repr__   s     !.d 3 !% 3 3 5% !6 8 88 "as!A5M 5 " % #')),="> GX-,-R/@Bj]jj%s   A7A7T	validate_z' has a class validator 'z' that takes more than one argument. Class validators must take only 'self' as an argument. Methods starting with 'validate_' are considered to be class validators.c                (    V ^8  d   QhR\         RR/# )r   r8   r!   N)r   )r#   s   "r$   r%   r<      s     	l 	l1 	l 	lr&   c                   < SP                    F  p V! V 4       K  	  R#   \        \        3 d   p\        TP                  TR7      ThRp?ii ; i)z%Run class validators on the instance.)r5   r>   N)__class_validators__rA   rB   r   rO   )r8   r5   rC   r    s   &  r$   validate&strict.<locals>.wrap.<locals>.validate   sP     55	ldO 6 #I. l=	HZHZbcdjkkls    AA		Arq   "__is_defined_by_strict_decorator__Fz' already implements a method called 'validate'. This method name is reserved when using the @strict decorator on a dataclass. If you want to keep your own method, please rename it.c                    V ^8  d   QhRR/# )r   r!   Nr)   )r#   s   "r$   r%   r<     s     	 	 	r&   c                B   < S! V .VO5/ VB  SP                  V 4       R# )z*Run class validators after initialization.N)rq   )r8   rT   rI   r    initial_inits   &*,r$   init_with_validate0strict.<locals>.wrap.<locals>.init_with_validate  s#     ///LLr&   r[   )!hasattrr   rO   r   append_create_type_validatormetadatar@   
isinstancelist_is_validatorr9   extendr?   __setattr__r[   r
   rS   rk   __dataclass_params__reprdir
startswithgetattrcallablerN   inspect	signature
parametersrp   rs   rq   rP   )r    field_validatorsrU   
validatorscustom_validatorr5   rE   original_initr[   rS   rk   class_validatorsr9   methodrq   rw   rv   rj   rD   r+   s   f               @@@r$   wrapstrict.<locals>.wrapp   s   s2330#,,'UV 
 :<AJ4Q78 zz~~k:+!"2D99(8'9$!1I(33<;AFF83ykQ  A  "2
 !!"23'1QVV$  . ??
	0 
	0 -LLM=! 8 " 8D $CL 3003
 %2!  LLM=!k k "k  '',,4' HD??;//S$'FF##7$$V,778A=4cll^+DTF K> > 
 ##F+  $4 	l 	l 7;33
##3<<)MuUU4cll^ ,N N    ||	|		 	 
	
 	Z!34
r&   r)   )r    r+   r   s   &d r$   r*   r*   8   s&    ph hV 491T1r&   c                J    V ^8  d   QhR\         \        ,          R\        RR/# )r   schemadatar!   N)typer   dict)r#   s   "r$   r%   r%     s&     / /] 3 /4 /D /r&   c                ,    \        V 4      pV! R/ VB  R# )an  
Validate that a dictionary conforms to the types defined in a TypedDict class.

Under the hood, the typed dict is converted to a strict dataclass and validated using the `@strict` decorator.

Args:
    schema (`type[TypedDictType]`):
        The TypedDict class defining the expected structure and types.
    data (`dict`):
        The dictionary to validate.

Raises:
    `StrictDataclassFieldValidationError`:
        If any field in the dictionary does not conform to the expected type.

Example:
```py
>>> from typing import Annotated, TypedDict
>>> from huggingface_hub.dataclasses import validate_typed_dict

>>> def positive_int(value: int):
...     if not value >= 0:
...         raise ValueError(f"Value must be positive, got {value}")

>>> class User(TypedDict):
...     name: str
...     age: Annotated[int, positive_int]

>>> # Valid data
>>> validate_typed_dict(User, {"name": "John", "age": 30})

>>> # Invalid type for age
>>> validate_typed_dict(User, {"name": "John", "age": "30"})
huggingface_hub.errors.StrictDataclassFieldValidationError: Validation error for field 'age':
    TypeError: Field 'age' expected int, got str (value: '30')

>>> # Invalid value for age
>>> validate_typed_dict(User, {"name": "John", "age": -1})
huggingface_hub.errors.StrictDataclassFieldValidationError: Validation error for field 'age':
    ValueError: Value must be positive, got -1
```
Nr)   )!_build_strict_cls_from_typed_dict)r   r   
strict_clss   && r$   validate_typed_dictr     s    X 36:J r&   c                F    V ^8  d   QhR\         \        ,          R\        /# r   r   r!   )r   r   r   )r#   s   "r$   r%   r%   Q  s     ; ;d=.A ;d ;r&   c                    \        V 4      p\        V R R4      '       g   VP                  4        F  w  r#\        V4      pV\        J dV   \        V4      vrV\        V4      '       g   \        V,          p\        \        V.\        V4      ,           4      ,          W&   Ko  \        V4      '       d   K  \        V,          W&   K  	  . pVP                  4        Ft  w  r#\        V4      \        J d;   \        V4      vrVVP                  ! W%\        \        RV^ ,          /R7      34       KR  VP                  ! W#\        \        R7      34       Kv  	  \        \        V P                  V4      4      # )	__total__Tr5   )rQ   r|   )rQ   )_get_typed_dict_annotationsr   rM   r   r   r   _is_required_or_notrequiredr   tupler~   rz   r   _TYPED_DICT_DEFAULT_VALUEr*   r   rO   )r   
type_hintskeyr:   originbasemetar   s   &       r$   r   r   P  s"    -V4J 6;--$**,JC&F"&uo2488&t,D"+E4&4:2E,F"G
077"-e"4
 - F &&(
e	)"5/KDMM3e4MYdfjklfmXn&opqMM3u5N'OPQ ) .&9::r&   c                h    V ^8  d   QhR\         \        ,          R\        \        \        3,          /# r   )r   r   r   r;   r   )r#   s   "r$   r%   r%   o  s'     
 
](; 
S#X 
r&   c           	          ^ RI pVP                  V 4      #   \         dX    T P                  P	                  R/ 4      P                  4        UUu/ uF  w  r#Y#e   TM
\        R4      bK  	  Mu uppi uppu # i ; i)z0Extract type annotations from a TypedDict class.N__annotations__)annotationlibget_annotationsImportErrorrf   r@   rM   r   )r   r   r9   r:   s   &   r$   r   r   o  sz    
,,V44 

  &223DbIOOQ	
  R ,%$t*<Q	
 	

s    8A9A,+A98A9Tc                    V ^8  d   QhR\         \        ,          \        ,          R\        R\        R\        R\        R\        R,          R\        R	\        R,          R
\        R\        /
# )r   r5   rQ   rR   initr   hashNcomparer|   rI   r!   )r~   Validator_Tr   r-   r   )r#   s   "r$   r%   r%     s~     ( (K ;.(( ( 	(
 ( +( ( Tk( ( 	(r&   c                z    \        V \        4      '       g   V .p Vf   / pWR&   \        R	RVRVRVRVRVRVRV/VB # )
a  
Create a dataclass field with a custom validator.

Useful to apply several checks to a field. If only applying one rule, check out the [`as_validated_field`] decorator.

Args:
    validator (`Callable` or `list[Callable]`):
        A method that takes a value as input and raises ValueError/TypeError if the value is invalid.
        Can be a list of validators to apply multiple checks.
    **kwargs:
        Additional arguments to pass to `dataclasses.field()`.

Returns:
    A field with the validator attached in metadata
r5   rQ   rR   r   r   r   r   r|   r)   )r}   r~   r   )	r5   rQ   rR   r   r   r   r   r|   rI   s	   &&&&&&&&,r$   validated_fieldr     s    4 i&&K	%[ 		'	 	 		
 	 	 	 	 	r&   c                $    V ^8  d   QhR\         /# )r   r5   )r   )r#   s   "r$   r%   r%     s      + r&   c                <   a  \         \         RRRRR3R V 3R lllpV# )z
Decorates a validator function as a [`validated_field`] (i.e. a dataclass field with a custom validator).

Args:
    validator (`Callable`):
        A method that takes a value as input and raises ValueError/TypeError if the value is invalid.
TNc                    V ^8  d   QhR\         R\         R\        R\        R\        R,          R\        R\        R,          R	\         /# )
r   rQ   rR   r   r   r   Nr   r|   rI   )r   r-   r   )r#   s   "r$   r%   (as_validated_field.<locals>.__annotate__  s`     
 


 
 	

 Tk
 
 +
 
r&   c                 8   < \        S3R V RVRVRVRVRVRV/VB # )rQ   rR   r   r   r   r   r|   )r   )	rQ   rR   r   r   r   r   r|   rI   r5   s	   &&&&&&&,r$   _inner"as_validated_field.<locals>._inner  sc     



 ,

 	


 

 

 

 

 

 
	
r&   )r   )r5   r   s   f r$   as_validated_fieldr     s+     &  $
 
, Mr&   c                @    V ^8  d   QhR\         R\        R\        RR/# r   r9   r:   expected_typer!   Nr;   r   )r#   s   "r$   r%   r%     s.     Q Q QS Q Q Qr&   c                D   \        V4      p\        V4      pV\        J d   R# Vf   \        W4       R# \        P                  V4      ;p'       d   V! WV4       R# \        V\        4      '       d   \        WV4       R# \        V\        4      '       g   \        V\        4      '       d   R# V\        J d/   V\        J d   \        RV  R24      h\        WV^ ,          4       R# V\        J d"   V\        J d   R# \        WV^ ,          4       R# \        RV  RV 24      h)z.Validate that 'value' matches 'expected_type'.NField 'z' is required but missing.zUnsupported type for field 'r6   )r   r   r   _validate_none_BASIC_TYPE_VALIDATORSr@   r}   r   _validate_simple_typer   r;   r   r   rB   type_validatorr   )r9   r:   r   r   rT   r5   s   &&&   r$   r   r     s    &FM"D		t#,008	8	8$t$	M4	(	(d=9	M:	.	.*]C2P2P	8	--gdV+EFGGtDG,	;	--tDG,6tfCOPPr&   c                4    V ^8  d   QhR\         R\        RR/# )r   r9   r:   r!   Nr   )r#   s   "r$   r%   r%     s&     U U US UT Ur&   c                V    Ve%   \        RV  R\        V4      P                   24      hR# )zValidate None type.

'None' is not a type, it's a special value. Type should be `NoneType` instead.
But in type annotations 'None' is accepted so we must support it.
Nr   z' expected None, got )rB   r   rO   )r9   r:   s   &&r$   r   r     s3     '$'<T%[=Q=Q<RSTT r&   c                Z    V ^8  d   QhR\         R\        R\        \        R3,          RR/# r   r9   r:   rT   .r!   Nr;   r   r   )r#   s   "r$   r%   r%     s0      # c sCx T r&   c                    . pV F  p \        WV4        R# 	  \        RV  R\	        V4       RV RRP                  V4       24      h  \         d&   pTP                  \        T4      4        Rp?Ko  Rp?ii ; i)z8Validate that value matches one of the types in a Union.Nr   z' with value z doesn't match any type in z
. Errors: z; )r   rB   rz   r;   r   rg   )r9   r:   rT   errorstrC   s   &&&   r$   _validate_unionr     s    F	"4*  
$}T%[M1LTFR\]a]f]fgm]n\op   	"MM#a&!!	"s   A		A9A44A9c                Z    V ^8  d   QhR\         R\        R\        \        R3,          RR/# r   r   )r#   s   "r$   r%   r%      s6     	O 	OC 	O 	O5c? 	Ot 	Or&   c                   \        V\        4      '       dE   Y Uu. uF  p\        V\        4      '       g   K  VNK  	  up9  d   \        RV  RV RV 24      hR# \        V\        4      '       d]   Y Uu. uF5  p\        V\        4      '       g   K  \        V\        4      '       d   K3  VNK7  	  up9  d   \        RV  RV RV 24      hR# W9  d   \        RV  RV RV 24      hR# u upi u upi )zValidate Literal type.r   z' expected one of , got N)r}   r-   rB   int)r9   r:   rT   args   &&& r$   _validate_literalr      s    %F
30EFFgdV+=dV6%QRR G	E3		c
30DZX[]aMbccgdV+=dV6%QRR d		'$'9$veWMNN 
 G ds   C)C)5C.C.*C.c                Z    V ^8  d   QhR\         R\        R\        \        R3,          RR/# r   r   )r#   s   "r$   r%   r%     s6     R R RS Rc3h RD Rr&   c           	     &   \        V\        4      '       g%   \        RV  R\        V4      P                   24      hV^ ,          p\        V4       F  w  rE \        V  RV R2WS4       K  	  R#   \         d   p\        RT RT  R24      ThRp?ii ; i)	zValidate list[T] type.r   z' expected a list, got []Invalid item at index z
 in list 'rL   N)r}   r~   rB   r   rO   	enumerater   r9   r:   rT   	item_typeiitemrC   s   &&&    r$   _validate_listr     s    eT""'$'>tE{?S?S>TUVV QIU#	RdV1QCq>4; $  	R4QCz$qIJPQQ	Rs   A--B8BBc                Z    V ^8  d   QhR\         R\        R\        \        R3,          RR/# r   r   )r#   s   "r$   r%   r%     s6     M M MS Mc3h MD Mr&   c                @   \        V\        4      '       g%   \        RV  R\        V4      P                   24      hVw  r4VP                  4        F(  w  rV \        V  R2WS4       \        V  RV: R2Wd4       K*  	  R#   \         d   p\        RT  R24      ThRp?ii ; i)	zValidate dict[K, V] type.r   z' expected a dict, got z.keyr   r   zInvalid key or value in dict 'rL   N)r}   r   rB   r   rO   rM   r   )r9   r:   rT   key_type
value_typerW   rX   rC   s   &&&     r$   _validate_dictr     s    eT""'$'>tE{?S?S>TUVV  H	MdV4=!6dV1QE+Q;   	M<TF!DE1L	Ms   "A==BBBc                Z    V ^8  d   QhR\         R\        R\        \        R3,          RR/# r   r   )r#   s   "r$   r%   r%   )  s6     W W# Wc WsCx WT Wr&   c           
        \        V\        4      '       g%   \        RV  R\        V4      P                   24      h\        V4      ^8X  dB   V^,          \        J d1   \        V4       F  w  r4 \        V  RV R2WB^ ,          4       K!  	  R# \        V4      \        V4      8w  d'   \        RV  R	\        V4       R
\        V4       24      h\        \        W4      4       F  w  pw  rF \        V  RV R2WF4       K  	  R#   \         d   p\        RT RT  R24      ThRp?ii ; i  \         d   p\        RT RT  R24      ThRp?ii ; i)zValidate Tuple type.r   z' expected a tuple, got r   r   r   z in tuple 'rL   Nz' expected a tuple of length r   )
r}   r   rB   r   rO   rN   Ellipsisr   r   zip)r9   r:   rT   r   r   rC   expecteds   &&&    r$   _validate_tupler   )  sT   eU##'$'?U@T@T?UVWW 4yA~$q'X- 'GAW$q1~t!W= ( 
Tc%j	 '$'DSYKvVYZ_V`Uabcc#,S-=#>AW$q1~t> $?  W"8;tfA NOUVVW  W"8;tfA NOUVVWs0   -D (D& D#DD#&E	1EE	c                Z    V ^8  d   QhR\         R\        R\        \        R3,          RR/# r   r   )r#   s   "r$   r%   r%   @  s6     D D DC DuS#X D4 Dr&   c                   \        V\        4      '       g%   \        RV  R\        V4      P                   24      hV^ ,          p\        V4       F  w  rE \        V  R2WS4       K  	  R#   \         d   p\        RT  R24      ThRp?ii ; i)zValidate set[T] type.r   z' expected a set, got z itemzInvalid item in set 'rL   N)r}   setrB   r   rO   r   r   r   s   &&&    r$   _validate_setr   @  s    eS!!'$'=d5k>R>R=STUU QIU#	DdV5>4; $  	D3D6;<!C	Ds   A**B
5BB
c                Z    V ^8  d   QhR\         R\        R\        \        R3,          RR/# r   r   )r#   s   "r$   r%   r%   N  s6     V VS V VE#s(O V Vr&   c           	     b   \        V\        P                  P                  4      '       g%   \	        RV  R\        V4      P                   24      hV'       g   R# V^ ,          p\        V4       F  w  rE \        V  RV R2WS4       K  	  R#   \         d   p\	        RT RT  R24      ThRp?ii ; i)	z&Validate Sequence or Sequence[T] type.r   z' expected a Sequence, got Nr   r   r   z in sequence 'rL   )	r}   collectionsabcSequencerB   r   rO   r   r   r   s   &&&    r$   _validate_sequencer   N  s    e[__5566'$'B4;CWCWBXYZZ  QIU#	VdV1QCq>4; $  	V4QC~dV1MNTUU	Vs   3BB.B))B.c                @    V ^8  d   QhR\         R\        R\        RR/# r   )r;   r   r   )r#   s   "r$   r%   r%   `  s(     	
 	
 	
C 	
 	
 	
r&   c                `   V\         J dU   \        V\        4      '       d?   \        RV  RVP                   R\        V4      P                   R\        V4       R2	4      h\        W4      '       g?   \        RV  RVP                   R\        V4      P                   R\        V4       R2	4      hR# )z&Validate simple type (int, str, etc.).r   z' expected r   z	 (value: rd   N)r   r}   r-   rB   rO   r   r   )r9   r:   r   s   &&&r$   r   r   `  s    
5$ 7 7dV;}'='=&>fT%[EYEYDZZcdhindocppqr
 	
 e++dV;}'='=&>fT%[EYEYDZZcdhindocppqr
 	
 ,r&   c                0    V ^8  d   QhR\         R\        /# )r   r   r!   )r   r   )r#   s   "r$   r%   r%   l  s      % K r&   c                   a  R V 3R llpV# )z-Create a type validator function for a field.c                (    V ^8  d   QhR\         RR/# )r   r:   r!   NrJ   )r#   s   "r$   r%   ,_create_type_validator.<locals>.__annotate__p  s     6 6 6 6r&   c                 J   < \        SP                  V SP                  4       R # r(   )r   r9   r   )r:   r   s   &r$   r5   )_create_type_validator.<locals>.validatorp  s    uzz5%**5r&   r)   )r   r5   s   f r$   r{   r{   l  s    6 6 r&   c                0    V ^8  d   QhR\         R\        /# )r   r5   r!   r   r-   )r#   s   "r$   r%   r%   v  s      S T r&   c                   \        V 4      '       g   R# \        P                  ! V 4      p\        VP                  P                  4       4      p\        V4      ^ 8X  d   R# V^ ,          P                  \        P                  P                  \        P                  P                  \        P                  P                  39  d   R# VR,           F/  pVP                  \        P                  P                  8X  g   K.   R# 	  R# )zCheck if a function is a validator.

A validator is a Callable that can be called with a single positional argument.
The validator can have more arguments with default values.

Basically, returns True if `validator(value)` is possible.
F:   NNT)r   r   r   r~   r   valuesrN   kind	ParameterPOSITIONAL_OR_KEYWORDPOSITIONAL_ONLYVAR_POSITIONALrQ   empty)r5   r   r   	parameters   &   r$   r   r   v  s     I!!),Ii**1134J
:!!}//))((" 
 ^^	 1 1 7 77 $ r&   c                0    V ^8  d   QhR\         R\        /# )r   	type_hintr!   r   )r#   s   "r$   r%   r%     s     f f3 f4 fr&   c                `    V \         \        39   ;'       g    \        V 4      \         \        39   # )z2Helper to check if a type is Required/NotRequired.)r   r   r   )r  s   &r$   r   r     s*    ;//eeJy4IhXcMd4der&   c          	          V ^8  d   Qh/ ^ \         9   d@   \        \        \        \        \        \
        \        R3,          .R3,          3,          ;R&   # )r   .Nr   )__conditional_annotations__r   r   r   r;   r   )r#   s   "r$   r%   r%      sC      j S(CeCHo+F+L"MMN k r&   r)   r(   )r*   r   r   r   r   r   r   )Fr  collections.abcr   r   typesr   dataclassesr   r   r   r   r   	functoolsr	   r
   typingr   r   r   r   r   r   r   r   r   r   r   r   r   typing_extensionsr   r   r   r   r   r   r   r   r;   r   objectr   r*   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r{   r   r   r~   r   r   r   r   r   	UnionType__all__r%   )r  s   @r$   <module>r     s       $ E E &  
2,  ud{#CLtCH~>"H  
 ( 
 ( 
 OE O 
 Oc2 c2 c2L/d ; ;<
$ " (VDQ6U	ORMW.DV$	
6f 
?..	?OO0R   +: u 'Y  22;; 2
B+="b12	2s*   E% %F-E88FFFF