o
    úÇh  ã                   @   s:   d dl mZmZ dd„ Zdefdd„Zedkredƒ‚d	S )
é    )Ú_compile_graph_to_code_tableÚ_generate_upgraders_graphc                    s>   ‡ fdd„‰ i }| D ]}|d }|d }ˆ |ƒ}|||< q
|S )Nc                    s    t | tƒs| S ‡ fdd„| D ƒS )Nc                    s   g | ]}ˆ |ƒ‘qS © r   )Ú.0Úi©Úlistifyr   úo/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/torch/jit/generate_bytecode.pyÚ
<listcomp>   s    z4format_bytecode.<locals>.listify.<locals>.<listcomp>)Ú
isinstanceÚtuple)Úcontentr   r   r	   r      s   
z format_bytecode.<locals>.listifyr   é   r   )ÚtableÚformatted_tableÚentryÚ
identifierr   r   r   r	   Úformat_bytecode   s   
r   Úreturnc                  C   s@   g } t ƒ }| ¡ D ]\}}t||ƒ}|t|ƒi}|  |¡ q	| S )N)r   Úitemsr   r   Úappend)Úyaml_contentÚupgraders_graph_mapÚupgrader_nameÚupgrader_graphÚbytecode_tabler   r   r   r	   Úgenerate_upgraders_bytecode   s   
r   Ú__main__z)This file is not meant to be run directlyN)Útorch._Cr   r   r   Úlistr   Ú__name__ÚRuntimeErrorr   r   r   r	   Ú<module>   s   
ÿ