o
    2h<                     @   s&   dddZ dddZ	 	 d	ddZdS )
Fc           	   
   C   s  d| d| d| d|  }t | tr| f| }n@zt| }W n ty*   t|w t||kr5t||D ]!}zt| W q7 ttfyX   |d| dt| 7 }t|w |redd |D }d	}n	d
d |D }d}|r|d| d| d7 }t||S )a'  Transforms non-negative/positive integer/integers into an integer tuple.

    Args:
        value: int or iterable of ints. The value to validate and convert.
        n: int. The size of the tuple to be returned.
        name: string. The name of the argument being validated, e.g. "strides"
            or "kernel_size". This is only used to format error messages.
        allow_zero: bool, defaults to `False`. A `ValueError` will raised
            if zero is received and this argument is `False`.

    Returns:
        A tuple of n integers.
    zThe `z` argument must be a tuple of z integers. Received =zincluding element z	 of type c                 S   s   h | ]}|d k r|qS      .0vr   r   ^/var/www/html/chatgem/venv/lib/python3.10/site-packages/keras/src/utils/argument_validation.py	<setcomp>(       z$standardize_tuple.<locals>.<setcomp>z>= 0c                 S   s   h | ]}|d kr|qS r   r   r   r   r   r   r	   +   r
   z> 0z, including values z that do not satisfy `value `)
isinstanceinttuple	TypeError
ValueErrorlentype)	valuenname
allow_zero	error_msgvalue_tuplesingle_valueunqualified_valuesreq_msgr   r   r   standardize_tuple   sN   
r   c                 C   sP   t | ttfr	| S |  }|rh d}nddh}||vr&td| d| |S )N>   samevalidcausalr   r   z6The `padding` argument must be a list/tuple or one of . Received: )r   listr   lowerr   )r   allow_causalpaddingallowed_valuesr   r   r   standardize_padding8   s   
r&   c                 C   s\   |r| du rdS |rt | rdS t| tr| |v rdS td| d| d| d| d|  
)z0Validates the correctness of a string-based arg.NzUnknown value for `z` argument of z. Allowed values are: r    r   )callabler   strr   )r   allowable_stringscaller_namearg_name
allow_noneallow_callablesr   r   r   validate_string_argI   s   	r.   N)F)FF)r   r&   r.   r   r   r   r   <module>   s
   
 
7