o
    ép©in  ã                   @   s,   d dl Z e jee jf ZG dd„ deƒZdS )é    Nc                   @   s    e Zd ZdZdd„ Zdd„ ZdS )Ú
ObjectDictaZ  
    Make a dictionary behave like an object, with attribute-style access.

    Here are some examples of how it can be used:

    o = ObjectDict(my_dict)
    # or like this:
    o = ObjectDict(samples=samples, sample_rate=sample_rate)

    # Attribute-style access
    samples = o.samples

    # Dict-style access
    samples = o["samples"]
    c                 C   s"   z| | W S  t y   t|ƒ‚w ©N)ÚKeyErrorÚAttributeError)ÚselfÚname© r   ú[/home/ubuntu/.local/lib/python3.10/site-packages/torch_audiomentations/utils/object_dict.pyÚ__getattr__   s
   
ÿzObjectDict.__getattr__c                 C   s   || |< d S r   r   )r   r   Úvaluer   r   r	   Ú__setattr__!   s   zObjectDict.__setattr__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   r	   r   	   s    r   )ÚtypingÚDictÚstrÚAnyÚ_ObjectDictBaser   r   r   r   r	   Ú<module>   s   