
    9i                     B    S SK r S SKJr  S rS rSS jrSS jrSS jrg)	    N)versionc                     US:X  a-  [         R                  " U 5      [         R                  " U5      :  $ US:X  a-  [         R                  " U 5      [         R                  " U5      :  $ US:X  a-  [         R                  " U 5      [         R                  " U5      :H  $ US:X  a-  [         R                  " U 5      [         R                  " U5      :  $ g! [         a     gf = f)a  
Check version string of an active module against a required version.

If dev/prerelease tags result in TypeError for string-number comparison,
it is assumed that the dependency is satisfied.
Users on dev branches are responsible for keeping their own packages up to
date.
>>==<FT)_versionparse	TypeError)actverr   cmp_ops      d/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/skimage/_shared/version_requirements.py_check_versionr      s    S=>>&)HNN7,CCCt^>>&)X^^G-DDDs]>>&)X^^G-DDDs]>>&)HNN7,CCC s"   2C 2C (2C 2C 
CCc           	      j    [        X R                  S5      S   /S9n[        US[        USS5      5      $ )z<Return module version or None if version can't be retrieved..fromlist__version__VERSIONN)
__import__
rpartitiongetattr)module_namemods     r   get_module_versionr      s7    
[,B,B3,G,K+L
MC3wsIt'DEE    c                 h   U R                  5       S:X  a  [        R                  SS nO [        U 5      nUc  gSSKnUR                  SU5      nUc   S5       eUSUR                  5        nU(       d  S	nUS
;   d   SU S35       eXR                  5       S n[        X!U5      $ ! [         a     gf = f)a  Test if *name* is installed.

Parameters
----------
name : str
    Name of module or "python"
version : str, optional
    Version string to test against.
    If version is not None, checking version
    (must have an attribute named '__version__' or 'VERSION')
    Version may start with =, >=, > or < to specify the exact requirement

Returns
-------
out : bool
    True if `name` is installed matching the optional version.
pythonN   FTr   z[0-9]zInvalid version numberr   )r   r   r   r   zInvalid version condition '')	lowersysr   r   ImportErrorresearchstartr   )namer   r   r%   matchsymbs         r   is_installedr+   $   s    $ zz|xRa	'-F  			'7+ :":: 'D,,S0KD6QR.SS,++-/*ft44!  		s   B$ $
B10B1c                 $   ^ ^^ SSK mUU U4S jnU$ )a  Return decorator that forces a requirement for a function or class.

Parameters
----------
name : str
    Name of module or "python".
version : str, optional
    Version string to test against.
    If version is not None, checking version
    (must have an attribute named '__version__' or 'VERSION')
    Version may start with =, >=, > or < to specify the exact requirement

Returns
-------
func : function
    A decorator that raises an ImportError if a function is run
    in the absence of the input dependency.
r   Nc                 B   >^  TR                  T 5      UU U4S j5       nU$ )Nc                     > [        TT5      (       a  T" U 0 UD6$ ST STR                   ST 3nTb  UST 3-  n[        US-   5      e)N"z" in "z" requires " )r+   
__module__r$   )argskwargsmsgr(   objr   s      r   func_wrapped0require.<locals>.decorator.<locals>.func_wrappedf   sb    D'**D+F++#fS^^$4LG&Qwi=(C!#),,r   )wraps)r5   r6   	functoolsr(   r   s   ` r   	decoratorrequire.<locals>.decoratore   s&    			- 
	- r   )r9   )r(   r   r:   r9   s   `` @r   requirer<   N   s    *  r   c                 \    [        X5      (       d  g[        X R                  S5      S   /S9$ )a  Return a module object of name *module_name* if installed.

Parameters
----------
module_name : str
    Name of module.
version : str, optional
    Version string to test against.
    If version is not None, checking version
    (must have an attribute named '__version__' or 'VERSION')
    Version may start with =, >=, > or < to specify the exact requirement

Returns
-------
mod : module or None
    Module if *module_name* is installed matching the optional version
    or None otherwise.
Nr   r   r   )r+   r   r   )r   r   s     r   
get_moduler>   u   s0    & --k-C-CC-H-L,MNNr   )N)	r#   	packagingr   r	   r   r   r+   r<   r>    r   r   <module>rA      s(    
 )0F'5T$NOr   