a
    ij2	                     @   s   d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	Z	ddl
Z	edddd	d
ZddddZejeedddZdS )z%Utils to auto-apply `ecolab.inspect`.    N)ip_utils)pyjs_com)core)nodes)resource_utils)returnc                   C   s   t dtd dS )zGAdd a button on each cell outputs to switch output to `ecolab.inspect`.Zpost_run_cellZ__is_auto_inspect__N)r   Zregister_once_post_run_cell_add_inspect r	   r	   ^/home/ghrups/robot-bench/.venv/lib/python3.9/site-packages/etils/ecolab/inspects/auto_utils.pyauto_inspect   s
    r   c                  G   s   ~ t  }|d}tj|}t jdt	  dt
d dt
d dt
d dt
d d|j d}t j| d	S )
z:Callback after cell execution to add the `inspect` button._z
      zauto_activate.csszauto_activate.jsz	theme.csszmain.jsz,

      <script>
        add_auto_activate("z");
      </script>
  N)IPythonget_ipythonZevr   NodeZfrom_objdisplayHTMLr   Z	js_importr   Zresource_importid)argsipZlast_resultrootZhtml_contentr	   r	   r
   r   &   s$    

r   )id_r   c                 C   s   t j| }t|S )zReturns the inspect content.)r   r   Zfrom_idr   Zmain_inspect_html)r   noder	   r	   r
   get_inspect_htmlC   s    r   )__doc__	functoolsZetils.ecolabr   r   Zetils.ecolab.inspectsr   r   r   r   IPython.display	lru_cacher   r   Zregister_js_fnstrr   r	   r	   r	   r
   <module>   s   	