a
    ;=ic  ã                   @   sF   d dl mZmZ d dlmZ dd„ Zedœdd„ZedkrBed	ƒ‚d
S )é    )Ú_compile_graph_to_code_tableÚ_generate_upgraders_graph)ÚListc                    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   úl/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/torch/jit/generate_bytecode.pyÚ
<listcomp>	   ó    z4format_bytecode.<locals>.listify.<locals>.<listcomp>)Ú
isinstanceÚtuple)Úcontentr   r   r
   r	      s    
z format_bytecode.<locals>.listifyr   é   r   )ÚtableZ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)Zyaml_contentZupgraders_graph_mapZupgrader_nameZupgrader_graphZbytecode_tabler   r   r   r
   Úgenerate_upgraders_bytecode   s    
r   Ú__main__z)This file is not meant to be run directlyN)	Ztorch._Cr   r   Útypingr   r   r   Ú__name__ÚRuntimeErrorr   r   r   r
   Ú<module>   s
   	