o
    ß—¦i5  ã                   @   sF   U d dl Z d dlmZmZ ddlmZ G dd„ dƒZeƒ Zeed< dS )é    N)ÚAnyÚDicté   )ÚExactWeakKeyDictionaryc                   @   sl   e Zd Zddd„Zdejdefdd„Zdejdee	e
f fdd	„Zdejdee	e
f fd
d„Zddd„ZdS )ÚCodeContextDictÚreturnNc                 C   s   t ƒ | _d S ©N)r   Úcode_context©Úself© r   úX/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/torch/_dynamo/code_context.pyÚ__init__   s   zCodeContextDict.__init__Úcodec                 C   s
   || j v S r   )r	   )r   r   r   r   r   Úhas_context   s   
zCodeContextDict.has_contextc                 C   s&   | j  |¡}|d u ri }|| j |< |S r   )r	   Úget©r   r   Úctxr   r   r   Úget_context   s
   
zCodeContextDict.get_contextc                 C   s   |   |¡}| j t|ƒ¡ |S r   )r   r	   Ú
_remove_idÚidr   r   r   r   Úpop_context   s   
zCodeContextDict.pop_contextc                 C   s   | j  ¡  d S r   )r	   Úclearr
   r   r   r   r      s   zCodeContextDict.clear)r   N)Ú__name__Ú
__module__Ú__qualname__r   ÚtypesÚCodeTypeÚboolr   r   Ústrr   r   r   r   r   r   r   r   r      s    
r   r	   )	r   Útypingr   r   Úutilsr   r   r	   Ú__annotations__r   r   r   r   Ú<module>   s
   
 