a
    Of                  '   @  s   d dl mZ d dlZd dlZd dlmZ d dlZd dlmZ d dl	m
Z
 erTd dlZddddd	d
ddddddddddddddddddd
dddddd dd!d"dd#d$d%d&&Zd'd(d)d*d+d,d-d.d/d0	Zd1d2d3d4d5Zd<d2d2d2d8d9d:d;ZdS )=    )annotationsN)TYPE_CHECKING)find_stack_level)Versionz0.8.0z4.11.2z1.21.3z1.3.6z0.1.7z	2022.12.0z	2022.11.0z1.1z6.46.1z3.1.2z4.9.2z3.6.3z0.56.4z2.8.4z1.4.1z3.1.0z0.19.0z2.9.6z1.0.2z10.0.1z1.2.0z7.3.2z1.0.10z1.10.0z2.0.0z3.8.0z0.9.0z2.0.1z3.0.5z2022.7z2.3.0z5.15.9)&zadbc-driver-postgresqlzadbc-driver-sqlitebs4Zblosc
bottleneckzdataframe-api-compatZfastparquetZfsspecZhtml5libZ
hypothesisZgcsfsjinja2
lxml.etreeZ
matplotlibZnumbaZnumexprodfpyZopenpyxl
pandas_gbqpsycopg2ZpymysqlZpyarrowZ
pyreadstatZpytestpython-calamineZpyxlsbZs3fsZscipy
sqlalchemytablestabulateZxarrayZxlrdZ
xlsxwriterZ	zstandardZtzdataZqtpyZpyqt5Zbeautifulsoup4Z
BottleneckZJinja2Zlxmlr
   z
pandas-gbqr   Z
SQLAlchemyZpytables)	r   r   r   r	   Zodfr   Zpython_calaminer   r   ztypes.ModuleTypestr)modulereturnc                 C  s>   t | dd }|d u r$td| j | jdkr:| d }|S )N__version__zCan't determine version for r   r   )getattrImportError__name__split)r   version r   P/var/www/ai-form-bot/venv/lib/python3.9/site-packages/pandas/compat/_optional.pyget_versionJ   s    
r    raisez
str | None)nameextraerrorsmin_versionc                 C  s,  |dv sJ t | }|dur"|n| }d| d| d| d}zt| }W n$ typ   |dkrjt|Y dS 0 | dd }|| kr|}tj| }	n|}	|dur|nt|}
|
r(t	|	}|r(t
|t
|
k r(d	|
 d
| d| d}|dkrtj|tt d dS |dkr$t|ndS |S )aI  
    Import an optional dependency.

    By default, if a dependency is missing an ImportError with a nice
    message will be raised. If a dependency is present, but too old,
    we raise.

    Parameters
    ----------
    name : str
        The module name.
    extra : str
        Additional text to include in the ImportError message.
    errors : str {'raise', 'warn', 'ignore'}
        What to do when a dependency is not found or its version is too old.

        * raise : Raise an ImportError
        * warn : Only applicable when a module's version is to old.
          Warns that the version is too old and returns None
        * ignore: If the module is not installed, return None, otherwise,
          return the module, even if the version is too old.
          It's expected that users validate the version locally when
          using ``errors="ignore"`` (see. ``io/html.py``)
    min_version : str, default None
        Specify a minimum version that is different from the global pandas
        minimum version required.
    Returns
    -------
    maybe_module : Optional[ModuleType]
        The imported module, when found and the version is correct.
        None is returned when the package is not found and `errors`
        is False, or when the package's version is too old and `errors`
        is ``'warn'`` or ``'ignore'``.
    >   r   ignorewarnNzMissing optional dependency 'z'. z Use pip or conda to install .r   r   zPandas requires version 'z' or newer of 'z' (version 'z' currently installed).r$   )
stacklevel)INSTALL_MAPPINGget	importlibimport_moduler   r   sysmodulesVERSIONSr   r   warningsr$   UserWarningr   )r   r    r!   r"   package_nameZinstall_namemsgr   parentZmodule_to_getminimum_versionr   r   r   r   import_optional_dependencyU   sJ    (



r4   )r   r   N)
__future__r   r)   r+   typingr   r.   Zpandas.util._exceptionsr   Zpandas.util.versionr   typesr-   r'   r   r4   r   r   r   r   <module>   s|   -   