§
    OŠtj÷  ã                   óŽ   — d Z ddlZddlZdZdZd„ Z e¦   «         rdZdZ ej        dej        ¦  «        Zd„ Z	ddddddi dfd	„Z
dS )
z4Tools to assist importing optional external modules.é    Nc                  ó€   — dd l } |                      dd¦  «        }|dv rt          |¦  «        S t          d|z  ¦  «        ‚)Nr   ÚSYMPY_DEBUGÚFalse)ÚTruer   z&unrecognized value for SYMPY_DEBUG: %s)ÚosÚgetenvÚevalÚRuntimeError)r   Ú	debug_strs     úX/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/external/importtools.pyÚ__sympy_debugr      sU   € ð €I€I€IØ—	’	˜-¨Ñ1Ô1€IØÐ%Ð%Ð%Ý�I‰ŒÐåÐCØ$ñ%ñ &ô &ð 	&ó    Tz(\d+ | [a-z]+ | \.)c                 óÚ   — g }t                                | ¦  «        D ]@}|r<|dk    r6	 t          |¦  «        }n# t          $ r Y nw xY w|                     |¦  «         ŒAt          |¦  «        S )Nú.)Ú_component_reÚsplitÚintÚ
ValueErrorÚappendÚtuple)ÚvstringÚ
componentsÚxs      r   Úversion_tupler   !   s‹   € ð €JÝ× Ò  Ñ)Ô)ð !ð !ˆØð 	!��c’�ðÝ˜‘F”F��øÝð ð ð Ø�ðøøøà×Ò˜aÑ Ô Ð øÝ�ÑÔÐs   ¨8¸
AÁAÚ__version__© c	                 ó(  — t           �t           n|pd}t          �t          n|pd}ddl}	|r^t          j        |k     rN|rJ|	                     d| ›dd                     t          t          |¦  «        ¦  «        ›d�t          d	¬
¦  «         dS 	 t          | fi |¤Ž}
|                     dd¦  «        }|D ](}|dk    r |
j        dk    rt          | dz   |z   ¦  «         Œ)nm# t          $ r& |r |	                     d| z  t          d	¬
¦  «         Y dS |$ r7}|r*|	                     | ›dt          |¦  «        ›d�d	¬
¦  «         Y d}~dS d}~ww xY w|rÊt          |
|¦  «        }|� ||Ž }t!          |¦  «        t!          |¦  «        k     r“|r�t#          |t          ¦  «        r|}nTt#          |t$          t&          f¦  «        r)d                     t          t          |¦  «        ¦  «        }nt          |¦  «        }|	                     | ›d|›d�t          d	¬
¦  «         dS |
S )a¨  
    Import and return a module if it is installed.

    If the module is not installed, it returns None.

    A minimum version for the module can be given as the keyword argument
    min_module_version.  This should be comparable against the module version.
    By default, module.__version__ is used to get the module version.  To
    override this, set the module_version_attr keyword argument.  If the
    attribute of the module to get the version should be called (e.g.,
    module.version()), then set module_version_attr_call_args to the args such
    that module.module_version_attr(*module_version_attr_call_args) returns the
    module's version.

    If the module version is less than min_module_version using the Python <
    comparison, None will be returned, even if the module is installed. You can
    use this to keep from importing an incompatible older version of a module.

    You can also specify a minimum Python version by using the
    min_python_version keyword argument.  This should be comparable against
    sys.version_info.

    If the keyword argument warn_not_installed is set to True, the function will
    emit a UserWarning when the module is not installed.

    If the keyword argument warn_old_version is set to True, the function will
    emit a UserWarning when the library is installed, but cannot be imported
    because of the min_module_version or min_python_version options.

    Note that because of the way warnings are handled, a warning will be
    emitted for each module only once.  You can change the default warning
    behavior by overriding the values of WARN_NOT_INSTALLED and WARN_OLD_VERSION
    in sympy.external.importtools.  By default, WARN_NOT_INSTALLED is False and
    WARN_OLD_VERSION is True.

    This function uses __import__() to import the module.  To pass additional
    options to __import__(), use the import_kwargs keyword argument.  For
    example, to import a submodule A.B, you must pass a nonempty fromlist option
    to __import__.  See the docstring of __import__().

    This catches ImportError to determine if the module is not installed.  To
    catch additional errors, pass them as a tuple to the catch keyword
    argument.

    Examples
    ========

    >>> from sympy.external import import_module

    >>> numpy = import_module('numpy')

    >>> numpy = import_module('numpy', min_python_version=(2, 7),
    ... warn_old_version=False)

    >>> numpy = import_module('numpy', min_module_version='1.5',
    ... warn_old_version=False) # numpy.__version__ is a string

    >>> # gmpy does not have __version__, but it does have gmpy.version()

    >>> gmpy = import_module('gmpy', min_module_version='1.14',
    ... module_version_attr='version', module_version_attr_call_args=(),
    ... warn_old_version=False)

    >>> # To import a submodule, you must pass a nonempty fromlist to
    >>> # __import__().  The values do not matter.
    >>> p3 = import_module('mpl_toolkits.mplot3d',
    ... import_kwargs={'fromlist':['something']})

    >>> # matplotlib.pyplot can raise RuntimeError when the display cannot be opened
    >>> matplotlib = import_module('matplotlib',
    ... import_kwargs={'fromlist':['pyplot']}, catch=(RuntimeError,))

    NTFr   z!Python version is too old to use z (r   z or newer required)é   )Ú
stacklevelÚfromlistr   ÚcollectionsÚ
matplotlibz%s module is not installedz module could not be used (ú)z version is too old to use ()ÚWARN_OLD_VERSIONÚWARN_NOT_INSTALLEDÚwarningsÚsysÚversion_infoÚwarnÚjoinÚmapÚstrÚUserWarningÚ
__import__ÚgetÚ__name__ÚImportErrorÚreprÚgetattrr   Ú
isinstancer   Úlist)ÚmoduleÚmin_module_versionÚmin_python_versionÚwarn_not_installedÚwarn_old_versionÚmodule_version_attrÚmodule_version_attr_call_argsÚimport_kwargsÚcatchr&   ÚmodÚ	from_listÚsubmodÚeÚ
modversionÚverstrs                   r   Úimport_modulerE   0   sÒ  € õ^ -=Ð,HÕ(Ð(ØÐ% ð å0BÐ0NÕ,Ð,ØÐ( 5ð ð €O€O€Oð ð ÝÔÐ0Ò0Ð0Øð /Ø—’�à˜˜ §¢­­SÐ2DÑ)EÔ)EÑ FÔ FÐ FÐ FðHõ  ¨Að ñ /ô /ð /ð ˆFðÝ˜Ð1Ð1 =Ð1Ð1ˆð "×%Ò% j°"Ñ5Ô5ˆ	Øð 	2ð 	2ˆFØ˜Ò&Ð&¨3¬<¸<Ò+GÐ+GÝ˜6 C™<¨&Ñ0Ñ1Ô1Ð1øð	2øõ ð ð ð Øð 	"Ø�MŠMÐ6¸Ñ?ÅØ ð ñ "ô "ð "àˆˆØð ð ð Øð 	Ø�MŠMØ6<°f°f½dÀ1¹g¼g¸g¸gÐFØð ñ ô ð ð 	ˆˆˆˆˆøøøøðøøøð ð Ý˜SÐ"5Ñ6Ô6ˆ
Ø(Ð4Ø#˜Ð%BÐCˆJÝ˜Ñ$Ô$¥}Ð5GÑ'HÔ'HÒHÐHØð /åÐ0µ#Ñ6Ô6ð 5Ø/�F�FÝÐ 2µU½D°MÑBÔBð 5Ø ŸXšX¥c­#Ð/AÑ&BÔ&BÑCÔC�F�Fõ !Ð!3Ñ4Ô4�FØ—’Ø06°°¸¸¸ð@å¨Að ñ /ô /ð /ð ˆFà€Js   Â
AC Ã,EÄEÄ,D>Ä>E)Ú__doc__r'   Úrer%   r$   r   ÚcompileÚVERBOSEr   r   rE   r   r   r   ú<module>rJ      s·   ðØ :Ð :à 
€
€
€
Ø 	€	€	€	ð Ð ØÐ ð
&ð 
&ð 
&ð €=�?„?ð ØÐØÐð �”
Ð1°2´:Ñ>Ô>€ðð ð ð .2ÀdØ°$Ø)ÈØ ðKð Kð Kð Kð Kð Kr   