
    E#i]                       S r SSKJr  SSKrSSKrSSKJrJr  SSKJ	r	  SSK
Jr  SSKJr  SS	KJr  \R                   " 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 " 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)%z-Validation classes for various types of data.    )annotationsN)ABCabstractmethod)zip_longest)
attrgetter   )types)ValidationError_Tc                  D    \ rS rSrSrSrSS jrSS jr\S	S j5       r	Sr
g)
	Validator   zAbstract base class for validators.

.. note::
    This class does not provide any validation behavior. It is only used to
    add a useful `__repr__` implementation for validators.
Nc                    U R                  5       nU(       a  U S3OSnSU R                  R                   SU SU R                  < S3$ )N,  <(zerror=z)>)
_repr_args	__class____name__error)selfargss     g/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/static_dependencies/marshmallow/validate.py__repr__Validator.__repr__   sG     "$r{4>>**+1TF&bII    c                    g)zRA string representation of the args passed to this validator. Used by
`__repr__`.
r    r   s    r   r   Validator._repr_args!   s     r   c                    g Nr   r   values     r   __call__Validator.__call__'   s    9<r   r   returnstrr%   
typing.Anyr)   r,   )r   
__module____qualname____firstlineno____doc__r   r   r   r   r&   __static_attributes__r   r   r   r   r      s)     EJ < <r   r   c                  B    \ rS rSrSrSrSS.S
S jjrSS jrSS jrS	r	g)And+   a  Compose multiple validators and combine their error messages.

Example: ::

    from . import validate, ValidationError


    def is_even(value):
        if value % 2 != 0:
            raise ValidationError("Not an even value.")


    validator = validate.And(validate.Range(min=0), is_even)
    validator(-1)
    # ValidationError: ['Must be greater than or equal to 0.', 'Not an even value.']

:param validators: Validators to combine.
:param error: Error message to use when a validator returns ``False``.
zInvalid value.Nr   c               X    [        U5      U l        U=(       d    U R                  U l        g r#   )tuple
validatorsdefault_error_messager   )r   r   r8   s      r   __init__And.__init__B   s     
+8d88
r   c                "    SU R                   < 3$ )Nzvalidators=)r8   r    s    r   r   And._repr_argsF       T__/00r   c                   / n0 nU R                    H=  n U" U5      n[        U[        5      (       d  USL a  [        U R                  5      eM=  M?     U(       a  [        U40 UD6eU$ ! [         a  nUR                  UR                  5        [        UR                  [        5      (       a!  UR                  UR                  5         S nAM  UR                  [        R                  " [        UR                  5      5         S nAM  S nAff = f)NF)r8   
isinstancer   r
   r   updatekwargsmessagesdictappendextendtypingcastlist)r   r%   errorsrB   	validatorrerrs          r   r&   And.__call__I   s    I
Ce$!)Y77AJ)$**55 =G7 ) !&3F33 # Ccjj)cllD11MM#,,// MM&++dCLL"ABBCs   7A''
D1AD4DD)r   r8   )r8   ztypes.Validatorr   
str | Noner(   r+   )
r   r-   r.   r/   r0   r9   r:   r   r&   r1   r   r   r   r3   r3   +   s!    ( -IM 91r   r3   c                      \ rS rSrSr " S S5      r\" 5       rSr1 SkrSSS	SS	S
.         SS jjr	SS jr
SS jrSS jrSrg	)URL]   a  Validate a URL.

:param relative: Whether to allow relative URLs.
:param absolute: Whether to allow absolute URLs.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}`.
:param schemes: Valid schemes. By default, ``http``, ``https``,
    ``ftp``, and ``ftps`` are allowed.
:param require_tld: Whether to reject non-FQDN hostnames.
c                  N    \ rS rSrS r        SS jr        SS jrSrg)URL.RegexMemoizeri   c                    0 U l         g r#   	_memoizedr    s    r   r:   URL.RegexMemoizer.__init__j   s	    DNr   c                .   / SQnU(       d  UR                  S5        SR                  SSSSR                  U5      SS	45      nS
nU(       a  U(       a  SUSU4nO	SU4nOSXV4n[        R                  " SR                  U5      [        R                  5      $ )N)zM(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)	localhostz"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}z\[[A-F0-9]*:[A-F0-9:]+\]z+(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.?)r   z(?:[a-z0-9\.\-\+]*)://z1(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?z(?:|)z	(?::\d+)?z(?:/?|[/?]\S+)\Zz^(z)?^)rE   joinrecompile
IGNORECASE)r   relativeabsoluterequire_tldhostname_variantsabsolute_partrelative_partpartss           r   _regex_generator"URL.RegexMemoizer._regex_generatorm   s    ! !(()WXGG
 . IHH./ M  0M%%	.E "=1E}<::bggenbmm<<r   c                    XU4nX@R                   ;  a  U R                  XU5      U R                   U'   U R                   U   $ r#   )rX   rj   )r   rc   rd   re   keys        r   r&   URL.RegexMemoizer.__call__   sG     {3C..(&*&;&;'s# >>#&&r   rW   N)rc   boolrd   ro   re   ro   r)   ztyping.Pattern)r   r-   r.   r/   r:   rj   r&   r1   r   r   r   RegexMemoizerrT   i   sR    	 4	= 4	=,04	=?C4	=4	=l		' 		',0		'?C		'		'r   rp   zNot a valid URL.>   ftpftpshttphttpsFTN)rc   rd   schemesre   r   c                   U(       d  U(       d  [        S5      eXl        X l        U=(       d    U R                  U l        U=(       d    U R
                  U l        X@l        g )Nz>URL validation cannot set both relative and absolute to False.)
ValueErrorrc   rd   default_messager   default_schemesru   re   )r   rc   rd   ru   re   r   s         r   r:   URL.__init__   sO     P  ! 2d22
6$"6"6&r   c                >    SU R                   < SU R                  < 3$ )Nz	relative=z, absolute=)rc   rd   r    s    r   r   URL._repr_args   s    4==+;t}}6GHHr   c                4    U R                   R                  US9$ N)inputr   formatr$   s     r   _format_errorURL._format_error       zz  u --r   c                t   U R                  U5      nU(       d  [        U5      eSU;   a<  UR                  S5      S   R                  5       nX0R                  ;  a  [        U5      eU R                  U R                  U R                  U R                  5      nUR                  U5      (       d  [        U5      eU$ )Nz://r   )
r   r
   splitlowerru   _regexrc   rd   re   search)r   r%   messageschemeregexs        r   r&   URL.__call__   s    $$U+!'** E>[['*002F\\)%g..DMM4==$:J:JK||E""!'**r   )rd   r   rc   re   ru   )
rc   ro   rd   ro   ru   ztypes.StrSequenceOrSet | Nonere   ro   r   rO   r(   r%   r*   r)   r*   )r   r-   r.   r/   r0   rp   r   rx   ry   r:   r   r   r&   r1   r   r   r   rQ   rQ   ]   s    	C' C'J _F(O6O
 15  ' ' 	'
 /' ' '&I.r   rQ   c                      \ rS rSrSr\R                  " S\R                  \R                  -  5      r	\R                  " S\R                  \R                  -  5      r
SrSrSS.SS	 jjrSS
 jrSS jrSrg)Email   zValidate an email address.

:param error: Error message to raise in case of a validation error. Can be
    interpolated with `{input}`.
z(^[-!#$%&'*+/=?^`{}|~\w]+(\.[-!#$%&'*+/=?^`{}|~\w]+)*\Z|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"\Z)z(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,})\Z|^\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]\Z)r[   zNot a valid email address.Nr5   c               8    U=(       d    U R                   U l        g r#   )rx   r   )r   r   s     r   r:   Email.__init__   s    2d22
r   c                4    U R                   R                  US9$ r~   r   r$   s     r   r   Email._format_error   r   r   c                   U R                  U5      nU(       a  SU;  a  [        U5      eUR                  SS5      u  p4U R                  R	                  U5      (       d  [        U5      eX@R
                  ;  ao  U R                  R	                  U5      (       dO   UR                  S5      R                  S5      nU R                  R	                  U5      (       a  U$  [        U5      eU$ ! [         a     Nf = f)N@r   idnaascii)
r   r
   rsplit
USER_REGEXmatchDOMAIN_WHITELISTDOMAIN_REGEXencodedecodeUnicodeError)r   r%   r   	user_partdomain_parts        r   r&   Email.__call__  s    $$U+5(!'**!&c1!5	$$Y//!'**333$$**;77%"-"4"4V"<"C"CG"LK ((..{;;$ <%g.. $ s    C) )
C65C6r   rO   r   )r   r-   r.   r/   r0   r`   ra   rb   UNICODEr   r   r   rx   r:   r   r&   r1   r   r   r   r   r      st     	1 	

"J ::	5
 	

"L &2O.2 3.r   r   c                  z    \ rS rSrSrSrSrSrSrSr	Sr
S	r  SSSS
S.     SS jjjrSS jrSS jrSS jrSrg
)Rangei  a  Validator which succeeds if the value passed to it is within the specified
range. If ``min`` is not specified, or is specified as `None`,
no lower bound exists. If ``max`` is not specified, or is specified as `None`,
no upper bound exists. The inclusivity of the bounds (if they exist) is configurable.
If ``min_inclusive`` is not specified, or is specified as `True`, then
the ``min`` bound is included in the range. If ``max_inclusive`` is not specified,
or is specified as `True`, then the ``max`` bound is included in the range.

:param min: The minimum value (lower bound). If not provided, minimum
    value will not be checked.
:param max: The maximum value (upper bound). If not provided, maximum
    value will not be checked.
:param min_inclusive: Whether the `min` bound is included in the range.
:param max_inclusive: Whether the `max` bound is included in the range.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}`, `{min}` and `{max}`.
zMust be {min_op} {{min}}.zMust be {max_op} {{max}}.z.Must be {min_op} {{min}} and {max_op} {{max}}.zgreater than or equal tozgreater thanzless than or equal toz	less thanNT)min_inclusivemax_inclusiver   c               .   Xl         X l        XPl        X0l        X@l        U R
                  R                  U R                  (       a  U R                  OU R                  S9U l        U R                  R                  U R                  (       a  U R                  OU R                  S9U l	        U R                  R                  U R                  (       a  U R                  OU R                  U R                  (       a  U R                  OU R                  S9U l        g )N)min_op)max_op)r   r   )minmaxr   r   r   message_minr   message_gte
message_gtmessage_maxmessage_lte
message_ltmessage_all)r   r   r   r   r   r   s         r   r:   Range.__init__7  s     
**  ++22'+'9'94##t 3 
  ++22'+'9'94##t 3 
  ++22'+'9'94##t'+'9'94##t 3 
r   c                v    SU R                   < SU R                  < SU R                  < SU R                  < 3$ )Nmin=, max=z, min_inclusive=z, max_inclusive=)r   r   r   r   r    s    r   r   Range._repr_argsR  s@    dhh\|3CDDVDVCYYijnj|j|i  A  	Ar   c                p    U R                   =(       d    UR                  XR                  U R                  S9$ )N)r   r   r   )r   r   r   r   r   r%   r   s      r   r   Range._format_errorU  s)    

%g--ExxTXX-VVr   c                   U R                   bo  U R                  (       a  XR                   :  aO  OXR                   ::  a?  U R                  c  U R                  OU R                  n[        U R                  X5      5      eU R                  bo  U R                  (       a  XR                  :  aO  OXR                  :  a?  U R                   c  U R                  OU R                  n[        U R                  X5      5      eU$ r#   )	r   r   r   r   r   r
   r   r   r   r   s      r   r&   Range.__call__X  s    88 $ 2 2EHH8I*.((*:d&&@P@PG!$"4"4U"DEE88 $ 2 2EHH8I*.((*:d&&@P@PG!$"4"4U"DEEr   )r   r   r   r   r   r   r   r   NN)r   ro   r   ro   r   rO   r(   )r%   r   r   r*   r)   r*   r%   r   r)   r   )r   r-   r.   r/   r0   r   r   r   r   r   r   r   r:   r   r   r&   r1   r   r   r   r   r     sx    $ .K-KBK,KJ)KJ 

 #" 

 
 
 
6AWr   r   c                  p    \ rS rSrSrSrSrSrSr  SSSS.       SS	 jjjr	SS
 jr
SS jrSS jrSrg)Lengthih  a<  Validator which succeeds if the value passed to it has a
length between a minimum and maximum. Uses len(), so it
can work for strings, lists, or anything with length.

:param min: The minimum length. If not provided, minimum length
    will not be checked.
:param max: The maximum length. If not provided, maximum length
    will not be checked.
:param equal: The exact length. If provided, maximum and minimum
    length will not be checked.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}`, `{min}` and `{max}`.
z"Shorter than minimum length {min}.z!Longer than maximum length {max}.z'Length must be between {min} and {max}.zLength must be {equal}.N)equalr   c               r    Ub  [        X/5      (       a  [        S5      eXl        X l        X@l        X0l        g )NzVThe `equal` parameter was provided, maximum or minimum parameter must not be provided.)anyrw   r   r   r   r   )r   r   r   r   r   s        r   r:   Length.__init__|  s<     cZ: 
 

r   c                Z    SU R                   < SU R                  < SU R                  < 3$ )Nr   r   z, equal=)r   r   r   r    s    r   r   Length._repr_args  s'    dhh\|8DJJ>JJr   c                    U R                   =(       d    UR                  XR                  U R                  U R                  S9$ )N)r   r   r   r   )r   r   r   r   r   r   s      r   r   Length._format_error  s6    

%g--XX4884:: . 
 	
r   c                   [        U5      nU R                  b5  X R                  :w  a$  [        U R                  XR                  5      5      eU$ U R
                  bN  X R
                  :  a?  U R                  c  U R                  OU R                  n[        U R                  X5      5      eU R                  bN  X R                  :  a?  U R
                  c  U R                  OU R                  n[        U R                  X5      5      eU$ r#   )
lenr   r
   r   message_equalr   r   r   r   r   )r   r%   lengthr   s       r   r&   Length.__call__  s    U::!#%d&8&8@R@R&STTL88FXX$5*.((*:d&&@P@PG!$"4"4U"DEE88FXX$5*.((*:d&&@P@PG!$"4"4U"DEEr   )r   r   r   r   r   )r   
int | Noner   r   r   r   r   rO   r(   )r%   typing.Sizedr   r*   r)   r*   )r%   r   r)   r   )r   r-   r.   r/   r0   r   r   r   r   r:   r   r   r&   r1   r   r   r   r   r   h  sm     7K5K;K-M 
 !  
  &K

r   r   c                  L    \ rS rSrSrSrSS.SS jjrSS jrSS jrSS	 jr	S
r
g)Equali  zValidator which succeeds if the ``value`` passed to it is
equal to ``comparable``.

:param comparable: The object to compare to.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}` and `{other}`.
zMust be equal to {other}.Nr5   c               D    Xl         U=(       d    U R                  U l        g r#   )
comparablerx   r   )r   r   r   s      r   r:   Equal.__init__  s    $2d22
r   c                "    SU R                   < 3$ )Nzcomparable=)r   r    s    r   r   Equal._repr_args  r>   r   c                H    U R                   R                  XR                  S9$ )N)r   other)r   r   r   r$   s     r   r   Equal._format_error  s    zz  uOO DDr   c                X    XR                   :w  a  [        U R                  U5      5      eU$ r#   )r   r
   r   r$   s     r   r&   Equal.__call__  s'    OO#!$"4"4U";<<r   )r   r   r   r(   )r%   r   r)   r*   r   r   r-   r.   r/   r0   rx   r:   r   r   r&   r1   r   r   r   r   r     s&     2O:> 31Er   r   c                      \ rS rSrSrSr SSS.     SS jjjrSS jrSS jr\	R                  SS	 j5       r\	R                  SS
 j5       rS rSrg)Regexpi  a  Validator which succeeds if the ``value`` matches ``regex``.

.. note::

    Uses `re.match`, which searches for a match at the beginning of a string.

:param regex: The regular expression string to use. Can also be a compiled
    regular expression pattern.
:param flags: The regexp flags to use, for example re.IGNORECASE. Ignored
    if ``regex`` is not a string.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}` and `{regex}`.
z'String does not match expected pattern.Nr5   c                   [        U[        [        45      (       a  [        R                  " X5      OUU l        U=(       d    U R                  U l        g r#   )r@   r*   bytesr`   ra   r   rx   r   )r   r   flagsr   s       r   r:   Regexp.__init__  s=     )353,(G(GBJJu$U 	
 2d22
r   c                "    SU R                   < 3$ )Nzregex=)r   r    s    r   r   Regexp._repr_args  s    

~&&r   c                \    U R                   R                  XR                  R                  S9$ )N)r   r   )r   r   r   patternr$   s     r   r   Regexp._format_error  s$    zz  uJJ4F4F GGr   c                    g r#   r   r$   s     r   r&   Regexp.__call__  s    +.r   c                    g r#   r   r$   s     r   r&   r     s    /2r   c                r    U R                   R                  U5      c  [        U R                  U5      5      eU$ r#   )r   r   r
   r   r$   s     r   r&   r     s2    ::E"*!$"4"4U";<<r   )r   r   )r   )r   zstr | bytes | typing.Patternr   intr   rO   r(   )r%   zstr | bytesr)   r*   r   )r%   r   r)   r   )r   r-   r.   r/   r0   rx   r:   r   r   rG   overloadr&   r1   r   r   r   r   r     su     @O
 
3
 !
3+
3 
3
 
3'H __. .__2 2r   r   c                  L    \ rS rSrSrSrSS.SS jjrSS jrSS jrSS	 jr	S
r
g)	Predicatei  a  Call the specified ``method`` of the ``value`` object. The
validator succeeds if the invoked method returns an object that
evaluates to True in a Boolean context. Any additional keyword
argument will be passed to the method.

:param method: The name of the method to invoke.
:param error: Error message to raise in case of a validation error.
    Can be interpolated with `{input}` and `{method}`.
:param kwargs: Additional keyword arguments to pass to the method.
Invalid input.Nr5   c               P    Xl         U=(       d    U R                  U l        X0l        g r#   )methodrx   r   rB   )r   r   r   rB   s       r   r:   Predicate.__init__  s    2d22
r   c                >    SU R                   < SU R                  < 3$ )Nzmethod=z	, kwargs=)r   rB   r    s    r   r   Predicate._repr_args  s    y@@r   c                H    U R                   R                  XR                  S9$ )N)r   r   )r   r   r   r$   s     r   r   Predicate._format_error  s    zz  u[[ AAr   c                    [        XR                  5      nU" S0 U R                  D6(       d  [        U R	                  U5      5      eU$ )Nr   )getattrr   rB   r
   r   )r   r%   r   s      r   r&   Predicate.__call__  s:    ,$$!$"4"4U";<<r   )r   rB   r   )r   r*   r   rO   r(   )r%   r,   r)   r*   r+   r   r   r   r   r   r     s'    	 'O;? 
ABr   r   c                  L    \ rS rSrSrSrSS.SS jjrSS jrSS jrSS	 jr	S
r
g)NoneOfi  zValidator which fails if ``value`` is a member of ``iterable``.

:param iterable: A sequence of invalid values.
:param error: Error message to raise in case of a validation error. Can be
    interpolated using `{input}` and `{values}`.
r   Nr5   c                   Xl         SR                  S U R                    5       5      U l        U=(       d    U R                  U l        g )Nr   c              3  8   #    U  H  n[        U5      v   M     g 7fr#   r*   ).0eachs     r   	<genexpr>"NoneOf.__init__.<locals>.<genexpr>#  s     $I=4SYY=   )iterabler_   values_textrx   r   )r   r	  r   s      r   r:   NoneOf.__init__!  s4     99$I4==$II2d22
r   c                "    SU R                   < 3$ )Nz	iterable=)r	  r    s    r   r   NoneOf._repr_args&  s    4==+,,r   c                H    U R                   R                  XR                  S9$ )N)r   values)r   r   r
  r$   s     r   r   NoneOf._format_error)  s     zz  u5E5E FFr   c                ~     XR                   ;   a  [        U R                  U5      5      e U$ ! [         a     U$ f = fr#   )r	  r
   r   	TypeErrorr$   s     r   r&   NoneOf.__call__,  sL    	%%d&8&8&?@@ &
   		s   ). 
<<)r   r	  r
  )r	  typing.Iterabler   rO   r(   r+   r   r   r   r   r   r     s&     'OIM 3
-Gr   r   c                  r    \ rS rSrSrSr SSS.     SS jjjrSS jrSS jrSS	 jr	\
4   SS
 jjrSrg)OneOfi6  a<  Validator which succeeds if ``value`` is a member of ``choices``.

:param choices: A sequence of valid values.
:param labels: Optional sequence of labels to pair with the choices.
:param error: Error message to raise in case of a validation error. Can be
    interpolated with `{input}`, `{choices}` and `{labels}`.
zMust be one of: {choices}.Nr5   c                   Xl         SR                  S U R                    5       5      U l        Ub  UO/ U l        SR                  S U R                   5       5      U l        U=(       d    U R
                  U l        g )Nr   c              3  8   #    U  H  n[        U5      v   M     g 7fr#   r  )r  choices     r   r  !OneOf.__init__.<locals>.<genexpr>I  s     %Mfc&kkr  c              3  8   #    U  H  n[        U5      v   M     g 7fr#   r  )r  labels     r   r  r  K  s     $I[ESZZ[r  )choicesr_   choices_textlabelslabels_textrx   r   )r   r  r  r   s       r   r:   OneOf.__init__A  s_      II%M%MM & 2f99$IT[[$II2d22
r   c                >    SU R                   < SU R                  < 3$ )Nzchoices=z	, labels=)r  r  r    s    r   r   OneOf._repr_argsN  s    $,,)4;;/BBr   c                ^    U R                   R                  XR                  U R                  S9$ )N)r   r  r  )r   r   r  r   r$   s     r   r   OneOf._format_errorQ  s/    zz  !2!24;K;K ! 
 	
r   c                     XR                   ;  a  [        U R                  U5      5      e U$ ! [         a   n[        U R                  U5      5      UeS nAff = fr#   )r  r
   r   r  )r   r%   r   s      r   r&   OneOf.__call__V  s`    	HLL(%d&8&8&?@@ )
   	H!$"4"4U";<%G	Hs   ). 
AAAc                   ^ [        T5      (       a  TO
[        T5      m[        U R                  U R                  SS9nU4S jU 5       $ )a  Return a generator over the (value, label) pairs, where value
is a string associated with each choice. This convenience method
is useful to populate, for instance, a form select field.

:param valuegetter: Can be a callable or a string. In the former case, it must
    be a one-argument callable which returns the value of a
    choice. In the latter case, the string specifies the name
    of an attribute of the choice objects. Defaults to `str()`
    or `str()`.
r   )	fillvaluec              3  <   >#    U  H  u  pT" U5      U4v   M     g 7fr#   r   )r  r  r  valuegetters      r   r   OneOf.options.<locals>.<genexpr>p  s     H%V$e,%s   )callabler   r   r  r  )r   r+  pairss    ` r   optionsOneOf.options_  s<     &.k%:%:k
;@WDLL$++DH%HHr   )r  r  r   r  r   r#   )r  r  r  ztyping.Iterable[str] | Noner   rO   r(   r+   )r+  z/str | typing.Callable[[typing.Any], typing.Any]r)   z'typing.Iterable[tuple[typing.Any, str]])r   r-   r.   r/   r0   rx   r:   r   r   r&   r*   r/  r1   r   r   r   r  r  6  su     3O
 /33
 !3 3 ,3
 3C

 HKIDI 
1I Ir   r  c                  >   ^  \ rS rSrSrSrSU 4S jjrSS jrSrU =r	$ )	ContainsOnlyis  a  Validator which succeeds if ``value`` is a sequence and each element
in the sequence is also in the sequence passed as ``choices``. Empty input
is considered valid.

:param iterable choices: Same as :class:`OneOf`.
:param iterable labels: Same as :class:`OneOf`.
:param str error: Same as :class:`OneOf`.

.. versionchanged:: 3.0.0b2
    Duplicate values are considered valid.
.. versionchanged:: 3.0.0b2
    Empty input is considered valid. Use `validate.Length(min=1) <marshmallow.validate.Length>`
    to validate against empty inputs.
z:One or more of the choices you made was not in: {choices}.c                R   > SR                  S U 5       5      n[        TU ]	  U5      $ )Nr   c              3  8   #    U  H  n[        U5      v   M     g 7fr#   r  r  vals     r   r  -ContainsOnly._format_error.<locals>.<genexpr>       95Cs3xx5r  r_   superr   r   r%   
value_textr   s      r   r   ContainsOnly._format_error  '    YY9599
w$Z00r   c                j    U H,  nX R                   ;  d  M  [        U R                  U5      5      e   U$ r#   )r  r
   r   r   r%   r6  s      r   r&   ContainsOnly.__call__  s3    C,,&%d&8&8&?@@  r   r   r(   r%   typing.Sequence[_T]r)   rC  
r   r-   r.   r/   r0   rx   r   r&   r1   __classcell__r   s   @r   r2  r2  s  s     SO1 r   r2  c                  >   ^  \ rS rSrSrSrSU 4S jjrSS jrSrU =r	$ )	ContainsNoneOfi  a  Validator which fails if ``value`` is a sequence and any element
in the sequence is a member of the sequence passed as ``iterable``. Empty input
is considered valid.

:param iterable iterable: Same as :class:`NoneOf`.
:param str error: Same as :class:`NoneOf`.

.. versionadded:: 3.6.0
z5One or more of the choices you made was in: {values}.c                R   > SR                  S U 5       5      n[        TU ]	  U5      $ )Nr   c              3  8   #    U  H  n[        U5      v   M     g 7fr#   r  r5  s     r   r  /ContainsNoneOf._format_error.<locals>.<genexpr>  r8  r  r9  r;  s      r   r   ContainsNoneOf._format_error  r>  r   c                j    U H,  nX R                   ;   d  M  [        U R                  U5      5      e   U$ r#   )r	  r
   r   r@  s      r   r&   ContainsNoneOf.__call__  s3    Cmm#%d&8&8&?@@  r   r   r(   rB  rD  rF  s   @r   rH  rH    s     NO1 r   rH  )r0   
__future__r   r`   rG   abcr   r   	itertoolsr   operatorr   r   r	   
exceptionsr
   TypeVarr   r   r3   rQ   r   r   r   r   r   r   r   r  r2  rH  r   r   r   <module>rU     s    3 " 	  # !   '^^D= =4/) /d) D9I 9xJI JZ?Y ?DI 6-Y -`	 DY >:II :Iz5 <V r   