
    -e                    ~    d Z ddlmZ ddlZ ej        e          ZddlmZ ddl	m
Z
 ddlmZ dZddZddZddZdS )z& Utilities for checking dependencies

    )annotationsN)import_module)
ModuleType)Any)import_optionalimport_requireduses_pandasmod_namestrreturnModuleType | Nonec                    	 t          |           S # t          $ r Y n/t          $ r# d|  d}t                              |           Y nw xY wdS )a   Attempt to import an optional dependency.

    Silently returns None if the requested module is not available.

    Args:
        mod_name (str) : name of the optional module to try to import

    Returns:
        imported module or None, if import fails

    z"Failed to import optional module ``N)r   ImportError	Exceptionlog	exception)r
   msgs     7lib/python3.11/site-packages/bokeh/util/dependencies.pyr   r   *   sv    X&&&      >8>>>c 4s    
A	)A	A		error_msgr   c                f    	 t          |           S # t          $ r}t          |          |d}~ww xY w)aY   Attempt to import a required dependency.

    Raises a RuntimeError if the requested module is not available.

    Args:
        mod_name (str) : name of the required module to try to import
        error_msg (str) : error message to raise when the module is missing

    Returns:
        imported module

    Raises:
        RuntimeError

    N)r   r   RuntimeError)r
   r   es      r   r   r   A   sD     -X&&& - - -9%%1,-s    
0+0objr   boolc                \    t          |           j        }|duo|                    d          S )zo
    Checks if an object is a ``pandas`` object.

    Use this before conditional ``import pandas as pd``.
    Nzpandas.)type
__module__
startswith)r   modules     r   r	   r	   V   s0     #YY!F>&"3"3I">">>    )r
   r   r   r   )r
   r   r   r   r   r   )r   r   r   r   )__doc__
__future__r   logging	getLogger__name__r   	importlibr   typesr   typingr   __all__r   r   r	    r!   r   <module>r,      s     # " " " " " g!! $ # # # # #               .- - - -*? ? ? ? ? ?r!   