o
    h1                     @   s6   d dl Z d dlZd dlZd dlmZ edddZdS )    N)contextmanager	trace.fxt/tmp/magic-tracec              	   c   s"   t  }t j|s$td|  tdd|ddg tdd|g |dd	t|d
| g}tj|tj	dd}	 |j
 }t| d|v rFnq8z'd V  W |tj | }t|j
  |j
  |dkrmtd| d S |tj | }t|j
  |j
  |dkrtd| w )NzDownloading magic_trace to: wgetz-Oz-qzNhttps://github.com/janestreet/magic-trace/releases/download/v1.0.2/magic-tracechmodz+xattachz-pidz-ozutf-8)stderrencodingTAttachedr   zmagic_trace exited abnormally: )osgetpidpathexistsprint
subprocessrunstrPopenPIPEr   readlinesend_signalsignalSIGINTwaitreadclose
ValueError)outputmagic_trace_cachepidargspxr r$   m/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/functorch/dim/magic_trace.pymagic_trace   sH   	


r&   )r   r   )r   r   r   
contextlibr   r&   r$   r$   r$   r%   <module>   s   