
    ԋg                    ~    d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	  G d de
      Z G d d	e
      Z G d
 de
      Zy)ztThis file contains custom objects.
These are mostly regular objects with more useful _repr_ and _repr_html_ methods.    )annotations)urlparse)get_environmentget_template)format_dashboard_linkc                      e Zd ZdZd Zy)HasWhatz;A dictionary of all workers and which keys that worker has.c                8    t        d      j                  |       S )Nzhas_what.html.j2)has_whatr   renderselfs    3lib/python3.12/site-packages/distributed/objects.py_repr_html_zHasWhat._repr_html_   s    ./666EE    N__name__
__module____qualname____doc__r    r   r   r	   r	      s    EFr   r	   c                      e Zd ZdZd Zy)WhoHasz9A dictionary of all keys and which workers have that key.c                8    t        d      j                  |       S )Nzwho_has.html.j2)who_hasr   r   s    r   r   zWhoHas._repr_html_   s    -.55d5CCr   Nr   r   r   r   r   r      s    CDr   r   c                      e Zd ZdZd Zy)SchedulerInfoz<A dictionary of information about the scheduler and workers.c                    d }t               }||j                  d<    |j                  d      j                  dd| i| S )Nc                    	 d| v r| d   nt        | d         j                  }t        || d   d         S # t        $ r Y y w xY w)Nhostaddressservices	dashboard)r   hostnamer   KeyError)serverr!   s     r   _format_dashboard_addressz<SchedulerInfo._repr_html_.<locals>._format_dashboard_address   s]     ' 6N!&"34== 
 -T6*3Ek3RSS s   25 	A Aformat_dashboard_addresszscheduler_info.html.j2	schedulerr   )r   filtersr   r   )r   r(   environments      r   r   zSchedulerInfo._repr_html_   sS    		 &':S67H{''(@AHH 


 	
r   Nr   r   r   r   r   r      s
    F
r   r   N)r   
__future__r   urllib.parser   dask.widgetsr   r   distributed.utilsr   dictr	   r   r   r   r   r   <module>r2      sA   U # ! 6 3Fd FDT D
D 
r   