
     f]                       d Z ddlmZ ddlZddlZddlmZmZ ddlm	Z	 ddl
mZ ddlmZ dd	lmZ  ej                   d
      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d d e      Z G d! d"e      Z G d# d$e      Zy)%z-Validation classes for various types of data.    )annotationsN)ABCabstractmethod)zip_longest)
attrgetter   )types)ValidationError_Tc                  6    e Zd ZdZdZddZddZedd       Zy)	ValidatorzAbstract 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                    | j                         }|r| dnd}d| j                  j                   d| d| j                  dS )N,  <(zerror=z)>)
_repr_args	__class____name__error)selfargss     g/var/www/html/py/new-venv/lib/python3.12/site-packages/ccxt/static_dependencies/marshmallow/validate.py__repr__zValidator.__repr__   sG     "$r{4>>**+1TF&bII    c                     y)zbA string representation of the args passed to this validator. Used by
        `__repr__`.
        r    r   s    r   r   zValidator._repr_args!   s     r   c                     y Nr   r   values     r   __call__zValidator.__call__'   s    9<r   returnstrr"   
typing.Anyr%   r(   )	r   
__module____qualname____doc__r   r   r   r   r#   r   r   r   r   r      s)     EJ < <r   r   c                  2    e Zd ZdZdZddddZd	dZd
dZy)Anda)  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               N    t        |      | _        |xs | j                  | _        y r    )tuple
validatorsdefault_error_messager   )r   r   r1   s      r   __init__zAnd.__init__B   s     
+8d88
r   c                     d| j                   S )Nzvalidators=)r1   r   s    r   r   zAnd._repr_argsF       T__/00r   c                   g }i }| j                   D ]4  }	  ||      }t        |t              s|du rt        | j                        6 |rt        |fi ||S # t        $ r}|j                  |j                         t        |j                  t              r|j                  |j                         n3|j                  t        j                  t        |j                               Y d }~d }~ww xY w)NF)r1   
isinstancer   r
   r   updatekwargsmessagesdictappendextendtypingcastlist)r   r"   errorsr9   	validatorrerrs          r   r#   zAnd.__call__I   s     	CI
Ce$!)Y7AJ)$**55		C !&3F33 # Ccjj)cllD1MM#,,/ MM&++dCLL"ABCs   1A	C/!BC**C/)r1   ztypes.Validatorr   
str | Noner$   r'   )r   r)   r*   r+   r2   r3   r   r#   r   r   r   r-   r-   +   s!    ( -IM 91r   r-   c                  ~    e Zd ZdZ G d d      Z e       ZdZh dZdddddd		 	 	 	 	 	 	 	 	 dd
ZddZ	ddZ
ddZy)URLa  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                  B    e Zd Zd Z	 	 	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 ddZy)URL.RegexMemoizerc                    i | _         y r    )	_memoizedr   s    r   r3   zURL.RegexMemoizer.__init__j   s	    DNr   c                   g d}|s|j                  d       dj                  ddddj                  |      dd	f      }d
}|r|rd|d|f}n
d|f}nd||f}t        j                  dj                  |      t        j                        S )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)?^)r<   joinrecompile
IGNORECASE)r   relativeabsoluterequire_tldhostname_variantsabsolute_partrelative_partpartss           r   _regex_generatorz"URL.RegexMemoizer._regex_generatorm   s    ! !(()WXGG
 . IHH./ M  0M%%	.E "=1E}m<::bggenbmm<<r   c                    |||f}|| j                   vr | j                  |||      | j                   |<   | j                   |   S r    )rK   r\   )r   rU   rV   rW   keys        r   r#   zURL.RegexMemoizer.__call__   sM     X{3C$..(&*&;&;h's# >>#&&r   N)rU   boolrV   r_   rW   r_   r%   ztyping.Pattern)r   r)   r*   r3   r\   r#   r   r   r   RegexMemoizerrI   i   sR    	 4	= 4	=,04	=?C4	=4	=l		' 		',0		'?C		'		'r   r`   zNot a valid URL.>   ftpftpshttphttpsFTN)rU   rV   schemesrW   r   c                   |s|st        d      || _        || _        |xs | j                  | _        |xs | j
                  | _        || _        y )Nz>URL validation cannot set both relative and absolute to False.)
ValueErrorrU   rV   default_messager   default_schemesre   rW   )r   rU   rV   re   rW   r   s         r   r3   zURL.__init__   sU     P  ! 2d22
6$"6"6&r   c                :    d| j                   d| j                  S )Nz	relative=z, absolute=)rU   rV   r   s    r   r   zURL._repr_args   s    4==+;t}}6GHHr   c                :    | j                   j                  |      S N)inputr   formatr!   s     r   _format_errorzURL._format_error       zz  u --r   c                Z   | j                  |      }|st        |      d|v r;|j                  d      d   j                         }|| j                  vrt        |      | j                  | j                  | j                  | j                        }|j                  |      st        |      |S )Nz://r   )
rp   r
   splitlowerre   _regexrU   rV   rW   search)r   r"   messageschemeregexs        r   r#   zURL.__call__   s    $$U+!'** E>[['*002FT\\)%g..DMM4==$:J:JK||E"!'**r   )
rU   r_   rV   r_   re   ztypes.StrSequenceOrSet | NonerW   r_   r   rE   r$   r"   r&   r%   r&   )r   r)   r*   r+   r`   ru   rh   ri   r3   r   rp   r#   r   r   r   rG   rG   ]   s    	C' C'J _F(O6O
 15  ' ' 	'
 /' ' '&I.r   rG   c                      e Zd ZdZ ej
                  dej                  ej                  z        Z ej
                  dej                  ej                  z        Z	dZ
dZddddZdd	Zdd
Zy)EmailzValidate 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)rM   zNot a valid email address.Nr.   c               .    |xs | j                   | _        y r    )rh   r   )r   r   s     r   r3   zEmail.__init__   s    2d22
r   c                :    | j                   j                  |      S rl   rn   r!   s     r   rp   zEmail._format_error   rq   r   c                   | j                  |      }|rd|vrt        |      |j                  dd      \  }}| j                  j	                  |      st        |      || j
                  vrd| j                  j	                  |      sI	 |j                  d      j                  d      }| j                  j	                  |      r|S t        |      |S # t        $ r Y t        |      w xY w)N@r   idnaascii)
rp   r
   rsplit
USER_REGEXmatchDOMAIN_WHITELISTDOMAIN_REGEXencodedecodeUnicodeError)r   r"   rw   	user_partdomain_parts        r   r#   zEmail.__call__  s    $$U+5(!'**!&c1!5	;$$Y/!'**d333$$**;7%"-"4"4V"<"C"CG"LK ((..{;$%g.. $  &g..s    C 	C('C(r   rE   rz   )r   r)   r*   r+   rR   rS   rT   UNICODEr   r   r   rh   r3   rp   r#   r   r   r   r|   r|      sx     	1 	

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

"L &2O.2 3.r   r|   c                  f    e Zd ZdZdZdZdZdZdZdZ	dZ
	 	 dd
d
d	d	 	 	 	 	 ddZddZddZddZy	)Rangea-  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               "   || _         || _        || _        || _        || _        | j
                  j                  | j                  r| j                  n| j                        | _        | j                  j                  | j                  r| j                  n| j                        | _	        | j                  j                  | j                  r| j                  n| j                  | j                  r| j                  n| j                        | _        y )N)min_op)max_op)r   r   )minmaxr   r   r   message_minro   message_gte
message_gtmessage_maxmessage_lte
message_ltmessage_all)r   r   r   r   r   r   s         r   r3   z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                n    d| j                   d| j                  d| j                  d| j                  S )Nmin=, max=z, min_inclusive=z, max_inclusive=)r   r   r   r   r   s    r   r   zRange._repr_argsR  s@    dhh\|3CDDVDVCYYijnj|j|i  A  	Ar   c                n    | j                   xs |j                  || j                  | j                        S )N)rm   r   r   )r   ro   r   r   r   r"   rw   s      r   rp   zRange._format_errorU  s+    

%g--EtxxTXX-VVr   c                   | j                   j| j                  r|| j                   k  rOn|| j                   k  r?| j                  | j                  n| j                  }t        | j                  ||            | j                  j| j                  r|| j                  kD  rOn|| j                  k\  r?| j                   | j                  n| j                  }t        | j                  ||            |S r    )	r   r   r   r   r   r
   rp   r   r   r   s      r   r#   zRange.__call__X  s    88 $ 2 2EDHH8I*.((*:d&&@P@PG!$"4"4UG"DEE88 $ 2 2EDHH8I*.((*:d&&@P@PG!$"4"4UG"DEEr   NN)r   r_   r   r_   r   rE   r$   )r"   r   rw   r&   r%   r&   r"   r   r%   r   )r   r)   r*   r+   r   r   r   r   r   r   r   r3   r   rp   r#   r   r   r   r   r     sx    $ .K-KBK,KJ)KJ 

 #" 

 
 
 
6AWr   r   c                  \    e Zd ZdZdZdZdZdZ	 	 dddd	 	 	 	 	 	 	 ddZdd	Z	dd
Z
ddZy)Lengthah  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               p    |t        ||g      rt        d      || _        || _        || _        || _        y )NzVThe `equal` parameter was provided, maximum or minimum parameter must not be provided.)anyrg   r   r   r   r   )r   r   r   r   r   s        r   r3   zLength.__init__|  sD     c3Z: 
 

r   c                T    d| j                   d| j                  d| j                  S )Nr   r   z, equal=)r   r   r   r   s    r   r   zLength._repr_args  s'    dhh\|8DJJ>JJr   c                    | j                   xs |j                  || j                  | j                  | j                        S )N)rm   r   r   r   )r   ro   r   r   r   r   s      r   rp   zLength._format_error  s8    

%g--TXX4884:: . 
 	
r   c                   t        |      }| j                  6|| j                  k7  r%t        | j                  || j                              |S | j
                  N|| j
                  k  r?| j                  | j                  n| j                  }t        | j                  ||            | j                  N|| j                  kD  r?| j
                  | j                  n| j                  }t        | j                  ||            |S r    )
lenr   r
   rp   message_equalr   r   r   r   r   )r   r"   lengthrw   s       r   r#   zLength.__call__  s    U::!#%d&8&8@R@R&STTL88FTXX$5*.((*:d&&@P@PG!$"4"4UG"DEE88FTXX$5*.((*:d&&@P@PG!$"4"4UG"DEEr   r   )r   
int | Noner   r   r   r   r   rE   r$   )r"   typing.Sizedrw   r&   r%   r&   )r"   r   r%   r   )r   r)   r*   r+   r   r   r   r   r3   r   rp   r#   r   r   r   r   r   h  sm     7K5K;K-M 
 !  
  &K

r   r   c                  :    e Zd ZdZdZddd	dZd
dZddZddZy)Equala  Validator 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}.Nr.   c               <    || _         |xs | j                  | _        y r    )
comparablerh   r   )r   r   r   s      r   r3   zEqual.__init__  s    $2d22
r   c                     d| j                   S )Nzcomparable=)r   r   s    r   r   zEqual._repr_args  r5   r   c                P    | j                   j                  || j                        S )N)rm   other)r   ro   r   r!   s     r   rp   zEqual._format_error  s     zz  uDOO DDr   c                X    || j                   k7  rt        | j                  |            |S r    )r   r
   rp   r!   s     r   r#   zEqual.__call__  s)    DOO#!$"4"4U";<<r   r   r$   )r"   r   r%   r&   r   	r   r)   r*   r+   rh   r3   r   rp   r#   r   r   r   r   r     s&     2O:> 31Er   r   c                      e Zd ZdZdZ	 ddd	 	 	 	 	 ddZddZddZej                  dd       Z
ej                  dd	       Z
d
 Z
y)Regexpa  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.Nr.   c                   t        |t        t        f      rt        j                  ||      n|| _        |xs | j                  | _        y r    )r7   r&   bytesrR   rS   ry   rh   r   )r   ry   flagsr   s       r   r3   zRegexp.__init__  s<     )353,(GBJJue$U 	
 2d22
r   c                     d| j                   S )Nzregex=)ry   r   s    r   r   zRegexp._repr_args  s    

~&&r   c                d    | j                   j                  || j                  j                        S )N)rm   ry   )r   ro   ry   patternr!   s     r   rp   zRegexp._format_error  s&    zz  uDJJ4F4F GGr   c                     y r    r   r!   s     r   r#   zRegexp.__call__  s    +.r   c                     y r    r   r!   s     r   r#   zRegexp.__call__  s    /2r   c                p    | j                   j                  |      t        | j                  |            |S r    )ry   r   r
   rp   r!   s     r   r#   zRegexp.__call__  s2    ::E"*!$"4"4U";<<r   )r   )ry   zstr | bytes | typing.Patternr   intr   rE   r$   )r"   zstr | bytesr%   r&   rz   )r"   r   r%   r   )r   r)   r*   r+   rh   r3   r   rp   r>   overloadr#   r   r   r   r   r     su     @O
 
3
 !
3+
3 
3
 
3'H __. .__2 2r   r   c                  :    e Zd ZdZdZddd	dZd
dZddZddZy)	Predicatea  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.Nr.   c               J    || _         |xs | j                  | _        || _        y r    )methodrh   r   r9   )r   r   r   r9   s       r   r3   zPredicate.__init__  s"    2d22
r   c                :    d| j                   d| j                  S )Nzmethod=z	, kwargs=)r   r9   r   s    r   r   zPredicate._repr_args  s    y@@r   c                P    | j                   j                  || j                        S )N)rm   r   )r   ro   r   r!   s     r   rp   zPredicate._format_error  s     zz  uT[[ AAr   c                    t        || j                        } |di | j                  st        | j	                  |            |S )Nr   )getattrr   r9   r
   rp   )r   r"   r   s      r   r#   zPredicate.__call__  s<    ,$$!$"4"4U";<<r   )r   r&   r   rE   r$   )r"   r(   r%   r&   r'   r   r   r   r   r   r     s'    	 'O;? 
ABr   r   c                  :    e Zd ZdZdZddd	dZd
dZd
dZddZy)NoneOfzValidator 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   Nr.   c                   || _         dj                  d | j                   D              | _        |xs | j                  | _        y )Nr   c              3  2   K   | ]  }t        |        y wr    r&   ).0eachs     r   	<genexpr>z"NoneOf.__init__.<locals>.<genexpr>#  s     $I4SY$I   )iterablerQ   values_textrh   r   )r   r   r   s      r   r3   zNoneOf.__init__!  s6     99$I4==$II2d22
r   c                     d| j                   S )Nz	iterable=)r   r   s    r   r   zNoneOf._repr_args&  s    4==+,,r   c                P    | j                   j                  || j                        S )N)rm   values)r   ro   r   r!   s     r   rp   zNoneOf._format_error)  s"    zz  uT5E5E FFr   c                z    	 || j                   v rt        | j                  |            	 |S # t        $ r Y |S w xY wr    )r   r
   rp   	TypeErrorr!   s     r   r#   zNoneOf.__call__,  sN    	%%d&8&8&?@@ &
   		s   (- 	::)r   typing.Iterabler   rE   r$   r'   r   r   r   r   r   r     s&     'OIM 3
-Gr   r   c                  Z    e Zd ZdZdZ	 d
dd	 	 	 	 	 ddZddZddZddZe	f	 	 	 dd	Z
y)OneOfaP  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}.Nr.   c                   || _         dj                  d | j                   D              | _        ||ng | _        dj                  d | j                  D              | _        |xs | j
                  | _        y )Nr   c              3  2   K   | ]  }t        |        y wr    r   )r   choices     r   r   z!OneOf.__init__.<locals>.<genexpr>I  s     %Mfc&k%Mr   c              3  2   K   | ]  }t        |        y wr    r   )r   labels     r   r   z!OneOf.__init__.<locals>.<genexpr>K  s     $IESZ$Ir   )choicesrQ   choices_textlabelslabels_textrh   r   )r   r   r   r   s       r   r3   zOneOf.__init__A  sa      II%M%MM & 2f99$IT[[$II2d22
r   c                :    d| j                   d| j                  S )Nzchoices=z	, labels=)r   r   r   s    r   r   zOneOf._repr_argsN  s    $,,)4;;/BBr   c                f    | j                   j                  || j                  | j                        S )N)rm   r   r   )r   ro   r   r   r!   s     r   rp   zOneOf._format_errorQ  s1    zz  !2!24;K;K ! 
 	
r   c                    	 || j                   vrt        | j                  |            	 |S # t        $ r }t        | j                  |            |d }~ww xY wr    )r   r
   rp   r   )r   r"   r   s      r   r#   zOneOf.__call__V  sb    	HDLL(%d&8&8&?@@ )
   	H!$"4"4U";<%G	Hs   (- 	AAAc                    t              rn
t              t        | j                  | j                  d      }fd|D        S )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  8   K   | ]  \  }} |      |f  y wr    r   )r   r   r   valuegetters      r   r   z OneOf.options.<locals>.<genexpr>p  s     HV$e,Hs   )callabler   r   r   r   )r   r   pairss    ` r   optionszOneOf.options_  s9     &.k%:k
;@WDLL$++DH%HHr   r    )r   r   r   ztyping.Iterable[str] | Noner   rE   r$   r'   )r   z/str | typing.Callable[[typing.Any], typing.Any]r%   z'typing.Iterable[tuple[typing.Any, str]])r   r)   r*   r+   rh   r3   r   rp   r#   r&   r   r   r   r   r   r   6  so     3O
 /33
 !3 3 ,3
 3C

 HKIDI 
1Ir   r   c                  0     e Zd ZdZdZd fdZddZ xZS )ContainsOnlyaG  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    dj                  d |D              }t        | 	  |      S )Nr   c              3  2   K   | ]  }t        |        y wr    r   r   vals     r   r   z-ContainsOnly._format_error.<locals>.<genexpr>       9Cs3x9r   rQ   superrp   r   r"   
value_textr   s      r   rp   zContainsOnly._format_error  '    YY9599
w$Z00r   c                d    |D ]*  }|| j                   vst        | j                  |             |S r    )r   r
   rp   r   r"   r   s      r   r#   zContainsOnly.__call__  s<     	AC$,,&%d&8&8&?@@	A r   r$   r"   typing.Sequence[_T]r%   r  r   r)   r*   r+   rh   rp   r#   __classcell__r   s   @r   r   r   s  s     SO1r   r   c                  0     e Zd ZdZdZd fdZddZ xZS )ContainsNoneOfa6  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    dj                  d |D              }t        | 	  |      S )Nr   c              3  2   K   | ]  }t        |        y wr    r   r   s     r   r   z/ContainsNoneOf._format_error.<locals>.<genexpr>  r   r   r   r  s      r   rp   zContainsNoneOf._format_error  r  r   c                d    |D ]*  }|| j                   v st        | j                  |             |S r    )r   r
   rp   r  s      r   r#   zContainsNoneOf.__call__  s<     	ACdmm#%d&8&8&?@@	A r   r$   r  r	  r  s   @r   r  r    s     NO1r   r  )r+   
__future__r   rR   r>   abcr   r   	itertoolsr   operatorr   r   r	   
exceptionsr
   TypeVarr   r   r-   rG   r|   r   r   r   r   r   r   r   r   r  r   r   r   <module>r     s    3 " 	  # !   'V^^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   