
    0Fie                    2   d dl mZ d dl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Zd dlmZ d dlmZ ej                            ed	
          s( ej        de de d            ede de           ej        dk     rd dlmZ nd dlmZ ddZdS )    )annotationsN)Application)FunctionHandler)BokehTornado)create_hosts_allowlist)BOKEH_VERSION)BOKEH_REQUIREMENTT)prereleasesz
Dask needs z# for the dashboard.
You have bokeh=z#.
Continuing without the dashboard.zDask needs z for the dashboard, not bokeh=   )Panel)TabPanel/c                   |pi }|rd|                     d          z   dz   nd}d|i|fd|                                 D             }d |                                D             }t          j                            d                                          }t          |                    d          j        j	                  }t          |f|d|d|S )	Nr   prefixc                D    i | ]\  }}|t          j        |          S  )	functoolspartial).0kvextraservers      :lib/python3.11/site-packages/distributed/dashboard/core.py
<dictcomp>z$BokehApplication.<locals>.<dictcomp>(   s.    UUU1Q	!!VU33UUU    c                N    i | ]"\  }}|t          t          |                    #S r   )r   r   )r   r   r   s      r   r   z$BokehApplication.<locals>.<dictcomp>)   s.    III41aA{?1--..IIIr   z1distributed.scheduler.dashboard.bokeh-applicationallow_websocket_originF)r   	use_indexextra_websocket_origins)stripitemsdaskconfiggetcopyr   pophttp_serverportr   )	applicationsr   r   template_variablesfuncsappskwargsr    r   s	    `      @r   BokehApplicationr/   "   s   +1r.4=S6<<$$$s**#Fv4!34EUUUUU@R@R@T@TUUUEII5;;==IIID[__PQQVVXXF4

+,,f.@.E   7	 
   r   )r   N)
__future__r   r   warningsbokeh.applicationr   #bokeh.application.handlers.functionr   bokeh.server.serverr   bokeh.server.utilr   r#   distributed.dashboard.utilsr   distributed.versionsr	   	specifiercontainswarnImportErrormajorbokeh.modelsr   r   r/   r   r   r   <module>r>      sz   " " " " " "      ) ) ) ) ) ) ? ? ? ? ? ? , , , , , , 4 4 4 4 4 4  5 5 5 5 5 5 2 2 2 2 2 2 "++Mt+LL HM	.) 	. 	.)	. 	. 	.  
 +V'VV}VV  
 .......%%%%%%     r   