o
    d                     @  s\  d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 i 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%i d&d'd(d)d*d+d,d-d.d+d/d0d1d2d3d4d5d6d7d8d9dd:d;d<d=d>d?d@dAdBdCdDdEdFdGdHZ
dIdJdKdLdMd dNdOdPdQdR
ZdbdWdXZ	Y	Z	dcddd`daZdS )e    )annotationsN)find_stack_level)Versionbs4z4.9.3Zbloscz1.21.0
bottleneckz1.3.2brotliz0.7.0Zfastparquetz0.6.3Zfsspecz	2021.07.0Zhtml5libz1.1Z
hypothesisz6.34.2Zgcsfsjinja2z3.0.0
lxml.etreez4.6.3Z
matplotlibz3.6.1Znumbaz0.53.1Znumexprz2.7.3Zodfpyz1.4.1Zopenpyxlz3.0.7
pandas_gbqz0.15.0psycopg2z2.8.6Zpymysqlz1.0.2Zpyarrowz7.0.0Z
pyreadstatz1.1.2ZpytestZpyxlsbz1.0.8Zs3fsz	2021.08.0Zscipyz1.7.1snappyz0.6.0
sqlalchemyz1.4.16tablestabulatez0.8.9Zxarrayz0.21.0Zxlrdz2.0.1Z
xlsxwriterz1.4.3Z	zstandardz0.15.2Ztzdataz2022.1z2.2.0z5.15.1)ZqtpyZpyqt5Zbeautifulsoup4Z
BottleneckZbrotlipyZJinja2Zlxmlz
pandas-gbqzpython-snappyZ
SQLAlchemyZpytables)
r   r   r   r   r	   Zodfr
   r   r   r   moduletypes.ModuleTypereturnstrc                 C  sn   t | dd }|d u rt | dd }|d u r*| jdkrdS | jdkr"dS td| j | jdkr5| d }|S )	N__version__Z__VERSION__r    r   zCan't determine version for r   r   )getattr__name__ImportErrorsplit)r   version r   K/app/.heroku/python/lib/python3.10/site-packages/pandas/compat/_optional.pyget_versionF   s   


r   r   raisenameextraerrorsmin_version
str | Nonec                 C  s  |dv sJ t | }|dur|n| }d| d| d| d}zt| }W n ty8   |dkr5t|Y dS w | dd }|| krL|}tj| }	n|}	|durT|nt|}
|
rt	|	}|rt
|t
|
k rd	|
 d
| d| d}|dkrtj|tt d dS |dkrt||S )a9  
    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'``.
    >   ignorer   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_dependency[   sJ   )
r5   )r   r   r   r   )r   r   N)r   r   r    r   r!   r   r"   r#   )
__future__r   r*   r,   typesr/   Zpandas.util._exceptionsr   Zpandas.util.versionr   r.   r(   r   r5   r   r   r   r   <module>   s    	
 !"#+
