a
    @Dft                     @  s   U d Z ddlmZ ddlZeeZddlmZ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mZ ddlmZ ddlmZmZmZ erddlmZ dZe	eedf Zded< defdddddddZdS )z

    )annotationsN)TYPE_CHECKINGUnion   )serialize_json)	DOC_NB_JS)Document)Model)Theme   )div_for_render_item)
FromCurdocOutputDocumentFor%standalone_docs_json_and_render_items)	TypeAlias)notebook_contentr   ThemeSourcer	   z
str | Noneztuple[str, str, Document])modelnotebook_comms_targetthemereturnc                 C  s   t | tstdt| g|dd }t| g\}\}W d   n1 sH0    Y  t|}| }|rn||d< tjt	|t	|gd}|||fS )a]   Return script and div that will display a Bokeh plot in a Jupyter
    Notebook.

    The data for the plot is stored directly in the returned HTML.

    Args:
        model (Model) : Bokeh object to render

        notebook_comms_target (str, optional) :
            A target name for a Jupyter Comms object that can update
            the document that is rendered to this notebook div

        theme (Theme, optional) :
            Defaults to the ``Theme`` instance in the current document.
            Setting this to ``None`` uses the default theme or the theme
            already specified in the document. Any other value must be an
            instance of the ``Theme`` class.

    Returns:
        script, div, Document

    .. note::
        Assumes :func:`~bokeh.io.notebook.load_notebook` or the equivalent
        has already been executed.

    z0notebook_content expects a single Model instanceT)Zapply_themeZ
always_newNr   )	docs_jsonZrender_items)

isinstancer	   
ValueErrorr   r   r   to_jsonr   renderr   )r   r   r   Znew_docr   Zrender_itemdivscript r   a/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/bokeh/embed/notebook.pyr   8   s    
.r   ) __doc__
__future__r   logging	getLogger__name__logtypingr   r   Zcore.json_encoderr   Zcore.templatesr   documentr   r   r	   Zthemesr
   elementsr   utilr   r   r   Ztyping_extensionsr   __all__r   __annotations__r   r   r   r   r   <module>   s    
