o
    $i1                     @   s0   d dl Z d dlmZ de jdee fddZdS )    N)Iterable	dataclassallowed_keysc              	      s      t|}fdd|D }|r'td| d j j dtj  tj| } fdd|D }|rBt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                    s   g | ]	}| j vr|qS  __dict__.0key)default_datar   U/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/ray/air/_internal/config.py
<listcomp>   s    z>ensure_only_allowed_dataclass_keys_updated.<locals>.<listcomp>zKey(s) z are not present in z/. Remove them from `allowed_keys`. Valid keys: c                    s$   g | ]} j | j | kr|qS r   r   r   r   r   r   r   r   &   s
    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   r   r   *ensure_only_allowed_dataclass_keys_updated   s(   
r   )dataclassestypingr   r   strr   r   r   r   r   <module>   s    