Ë
    7^(h÷  ã                   ó”   — 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
y)
z4Tools to assist importing optional external modules.é    Nc                  óh   — dd l } | j                  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/skyplay_api_hub/venv/lib/python3.12/site-packages/sympy/external/importtools.pyÚ__sympy_debugr      sB   € ó Ø—	‘	˜-¨Ó1€IØÐ%Ñ%Ü�I‹ÐäÐCØ$ñ%ó &ð 	&ó    Tz(\d+ | [a-z]+ | \.)c                 óº   — g }t         j                  | «      D ](  }|sŒ|dk7  sŒ	 t        |«      }|j	                  |«       Œ* t        |«      S # t        $ r Y Œ)w xY w)Nú.)Ú_component_reÚsplitÚintÚ
ValueErrorÚappendÚtuple)ÚvstringÚ
componentsÚxs      r   Úversion_tupler   !   sk   € ð €JÜ× Ñ  Ó)ò !ˆÚ��c“ðÜ˜“F�ð ×Ñ˜aÕ ð!ô �ÓÐøô ò Ùðús   ¥AÁ	AÁAÚ__version__© c	                 ó–  — t         �t         n|xs d}t        �t        n|xs d}ddl}	|rRt        j                  |k  r?|r<|	j                  d| ›ddj                  t        t        |«      «      ›d�t        d	¬
«       y	 t        | fi |¤Ž}
|j                  dd«      }|D ])  }|dk(  sŒ	|
j                  dk(  sŒt        | dz   |z   «       Œ+ 	 |rŸt        |
|«      }|� ||Ž }t!        |«      t!        |«      k  ru|rrt#        |t        «      r|}nAt#        |t$        t&        f«      r dj                  t        t        |«      «      }nt        |«      }|	j                  | ›d|›d�t        d	¬
«       y|
S # t        $ r  |r|	j                  d| z  t        d	¬
«       Y y|$ r.}|r"|	j                  | ›dt        |«      ›d�d	¬
«       Y d}~yd}~ww xY w)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ð ó ñ Ü×ÑÐ0Ò0ÙØ—’â §¡¬¬SÐ2DÓ)EÕ FðHô  ¨Að ô /ð ðÜ˜Ñ1 =Ñ1ˆð "×%Ñ% j°"Ó5ˆ	Øò 	2ˆFØ˜Ó&¨3¯<©<¸<Ó+GÜ˜6 C™<¨&Ñ0Õ1ñ	2ñ Ü˜SÐ"5Ó6ˆ
Ø(Ð4Ù#Ð%BÐCˆJÜ˜Ó$¤}Ð5GÓ'HÒHÙäÐ0´#Ô6Ø/‘FÜÐ 2´U¼D°MÔBØ ŸX™X¤c¬#Ð/AÓ&BÓC‘Fô !Ð!3Ó4�FØ—‘Ú06ºð@ä¨Að ô /ð à€JøôA ò ÙØ�M‰MÐ6¸Ñ?ÄØ ð ô "áØò ÙØ�M‰MÚ6<¼dÀ1½gÐFØð ô ô 	ûðús*   Á>(E. Â'E. Â7E. Å.&GÆGÆ$GÇG)Ú__doc__r'   Úrer%   r$   r   ÚcompileÚVERBOSEr   r   rE   r   r   r   ú<module>rJ      sn   ðÙ :ã 
Û 	ð Ð ØÐ ò
&ñ „?ØÐØÐð �—
‘
Ð1°2·:±:Ó>€òð .2ÀdØ°$Ø)ÈØ ôKr   