a
    ]DfD                     @  s   d Z ddlmZ ddlZeeZddlZddlZddl	Z	dZ
G dd deZG dd deZdd	d
dddddZddddZdS )z Provide Bokeh-specific warning subclasses.

The primary use of these subclasses to to force them to be unconditionally
displayed to users by default.

    )annotationsN)BokehDeprecationWarningBokehUserWarningfind_stack_levelwarnc                   @  s   e Zd ZdZdS )r   z A Bokeh-specific ``DeprecationWarning`` subclass.

    Used to selectively filter Bokeh deprecations for unconditional display.

    N__name__
__module____qualname____doc__ r   r   `/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/bokeh/util/warnings.pyr   .   s   r   c                   @  s   e Zd ZdZdS )r   z{ A Bokeh-specific ``UserWarning`` subclass.

    Used to selectively filter Bokeh warnings for unconditional display.

    Nr   r   r   r   r   r   5   s   r   strztype[Warning] | Nonez
int | NoneNone)messagecategory
stacklevelreturnc                 C  s"   |d u rt  }tj| ||d d S )N)r   )r   warningsr   )r   r   r   r   r   r   r   <   s    r   int)r   c                  C  sR   ddl } tj| j}t }d}|rNt|}||rN|j	}|d7 }q"qNq"|S )z{Find the first place in the stack that is not inside Bokeh.

    Inspired by: pandas.util._exceptions.find_stack_level
    r   N   )
bokehospathdirname__file__inspectcurrentframegetfile
startswithf_back)r   Zpkg_dirframenfnamer   r   r   r   B   s    


r   )NN)r   
__future__r   logging	getLoggerr   logr   r   r   __all__DeprecationWarningr   UserWarningr   r   r   r   r   r   r   <module>   s   

