
    &`i1                     @    d dl Z d dlmZ de j        dee         fdZdS )    N)Iterable	dataclassallowed_keysc                 r                                      t          |          }fd|D             }|rFt          d| d j         j         dt	          j                                                             t          j                  |z
  } fd|D             }|rt          d| d          dS )a  
    Validate dataclass by raising an exception if any key not included in
    ``allowed_keys`` differs from the default value.

    A ``ValueError`` will also be raised if any of the ``allowed_keys``
    is not present in ``dataclass.__dict__``.

    Args:
        dataclass: Dict or dataclass to check.
        allowed_keys: dataclass attribute keys that can have a value different than
            the default one.
    c                 &    g | ]}|j         v|S  __dict__).0keydefault_datas     l/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/air/_internal/config.py
<listcomp>z>ensure_only_allowed_dataclass_keys_updated.<locals>.<listcomp>   s&    XXXs,BW7W7W7W7W7W    zKey(s) z are not present in z/. Remove them from `allowed_keys`. Valid keys: c                 L    g | ] }j         |         j         |         k    |!S r   r	   )r   r   r   r   s     r   r   z>ensure_only_allowed_dataclass_keys_updated.<locals>.<listcomp>&   s>       c"l&;C&@@@ 	@@@r   zV are not allowed to be updated in the current context. Remove them from the dataclass.N)	__class__set
ValueError__name__listr
   keys)r   r   keys_not_in_dictprohibited_keysbad_keysr   s   `    @r   *ensure_only_allowed_dataclass_keys_updatedr      s-     &&((L|$$L YXXX|XXX 
@& @ @"+@ @   5 : : < <==@ @
 
 	
 ,/00<?O    "  H
  
.h . . .
 
 	

 
r   )dataclassestypingr   r   strr   r   r   r   <module>r      sX             *
$*
3-*
 *
 *
 *
 *
 *
r   