U
    /e(                     @  s   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mZ d dlZd dlmZ d d	lmZmZ eeek seeekred
e de d ede de ejdk rd dlmZ nd dlmZ dddZdS )    )annotationsN)Application)FunctionHandler)BokehTornado)create_hosts_allowlist)parse)BOKEH_VERSION)MAX_BOKEH_VERSIONMIN_BOKEH_VERSIONz
Dask needs bokeh >= z), < 3 for the dashboard.
You have bokeh==z#.
Continuing without the dashboard.zDask needs bokeh >= z, < 3, not bokeh==   )Panel)TabPanel/c                   s   |pi }|rd| d d nd}d|i|  fdd|  D }dd | D }tjd }t|djj	}t
|f|d|d	|S )
Nr   prefixc                   s    i | ]\}}|t | qS  )	functoolspartial.0kvextraserverr   >/tmp/pip-unpacked-wheel-g426oqom/distributed/dashboard/core.py
<dictcomp>*   s      z$BokehApplication.<locals>.<dictcomp>c                 S  s   i | ]\}}|t t|qS r   )r   r   r   r   r   r   r   +   s      z1distributed.scheduler.dashboard.bokeh-applicationZallow_websocket_originF)r   Z	use_indexextra_websocket_origins)stripitemsdaskconfiggetcopyr   popZhttp_serverportr   )Zapplicationsr   r   Ztemplate_variablesfuncsZappskwargsr   r   r   r   BokehApplication$   s&     r'   )r   N)
__future__r   r   warningsZbokeh.applicationr   Z#bokeh.application.handlers.functionr   Zbokeh.server.serverr   Zbokeh.server.utilr   Zpackaging.versionr   parse_versionr   Zdistributed.dashboard.utilsr   Zdistributed.versionsr	   r
   warnImportErrormajorZbokeh.modelsr   r   r'   r   r   r   r   <module>   s.   
