o
    ei                     @  sl  d Z ddlmZ ddlZddlZddlZddlmZmZ ddl	m
Z
 er*ddlmZ edZd6ddZd7ddZeddgdZg dZe
ejd8ddZe
ejd9dd Ze
ejd:d"d#Ze
ejd8d$d%Ze
ejd9d&d'Ze
ejd;d(d)Ze
ejd:d*d+Ze
ejd:d,d-Ze
ejdd.d/d0d1Ze
ejd<d2d3Ze
ejd<d4d5ZdS )=z
Python polyfills for heapq
    )annotationsN)TYPE_CHECKINGTypeVar   )substitute_in_graph)
ModuleType_Tnamesset[str]returndict[str, ModuleType]c                 C  sL   i }t dd | D }ttjD ]}|| v s||r#tj|||< q|S )Nc                 s  s    | ]}|d  V  qdS ).N ).0namer   r   g/var/www/addictedbytheproject.nl/epg/venv/lib/python3.10/site-packages/torch/_dynamo/polyfills/heapq.py	<genexpr>   s    z+_save_and_remove_modules.<locals>.<genexpr>)tuplelistsysmodules
startswithpop)r	   orig_modulesprefixesmodnamer   r   r   _save_and_remove_modules   s   r   r   strblocked	list[str]r   c              	   C  s^   | h|}t |}|D ]}d tj|< qzt| W t | tj| S t | tj| w N)r   r   r   	importlibimport_moduleupdate)r   r   r	   r   r   r   r   r   import_fresh_module!   s   

r$   heapq_heapq)r   )_heapify_max_heappop_max_heapreplace_maxheapifyheappopheappushheappushpopheapreplacemergenlargest	nsmallestheaplist[_T]Nonec                C  
   t | S r    )py_heapqr'   r2   r   r   r   r'   C      
r'   c                 C  r5   r    )r6   r(   r7   r   r   r   r(   H   r8   r(   itemc                 C     t | |S r    )r6   r)   r2   r9   r   r   r   r)   M      r)   c                C  r5   r    )r6   r*   r7   r   r   r   r*   R   r8   r*   c                C  r5   r    )r6   r+   r7   r   r   r   r+   W   r8   r+   c                 C  r:   r    )r6   r,   r;   r   r   r   r,   \   r<   r,   c                 C  r:   r    )r6   r-   r;   r   r   r   r-   a   r<   r-   c                 C  r:   r    )r6   r.   r;   r   r   r   r.   f   r<   r.   Fkeyreversec                 G  s   t j|| |dS )Nr=   )r6   r/   )r>   r?   	iterablesr   r   r   r/   k   s   r/   c                 C     t j| ||dS N)r>   )r6   r0   niterabler>   r   r   r   r0   p      r0   c                 C  rA   rB   )r6   r1   rC   r   r   r   r1   u   rF   r1   )r	   r
   r   r   )r   r   r   r   r   r   )r2   r3   r   r4   )r2   r3   r   r   )r2   r3   r9   r   r   r   )r2   r3   r9   r   r   r4   r    )__doc__
__future__r   r%   r!   r   typingr   r   
decoratorsr   typesr   r   r   r$   r6   __all__r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r   r   r   r   <module>   sH    

	