
    a6d                     D    d dl Z d dlmZ d Zd Zd Zd	dZd	dZd	dZ	dS )
    N)versionc           	          t          | t                    s| f} t          j        | k     rNddlm} t          d                     |            d                    d | D                                           d S )Nr   )python_versiona   

You are running scikit-image on an unsupported version of Python.

Unfortunately, scikit-image 0.15 and above no longer work with your installed
version of Python ({}).  You therefore have two options: either upgrade to
Python {}, or install an older version of scikit-image.

For Python 2.7 or Python 3.4, use

 $ pip install 'scikit-image<0.15'

Please also consider updating `pip` and `setuptools`:

 $ pip install pip setuptools --upgrade

Newer versions of these tools avoid installing packages incompatible
with your version of Python.
.c                 ,    g | ]}t          |          S  )str).0vs     Dlib/python3.11/site-packages/skimage/_shared/version_requirements.py
<listcomp>z)ensure_python_version.<locals>.<listcomp>    s    &C&C&C!s1vv&C&C&C    )	
isinstancetuplesysversion_infoplatformr   ImportErrorformatjoin)min_versionr   s     r   ensure_python_versionr      s    k5)) &"o
+%% 	,+++++ $ F>>SXX&C&C{&C&C&CDDEE%G G 	G &%r   c                    	 |dk    r*t          j        |           t          j        |          k    S |dk    r*t          j        |           t          j        |          k    S |dk    r*t          j        |           t          j        |          k    S |dk    r*t          j        |           t          j        |          k     S dS # t          $ r Y dS w xY w)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      r   _check_versionr#   #   s    S==>&))HN7,C,CCCt^^>&))X^G-D-DDDs]]>&))X^G-D-DDDs]]>&))HN7,C,CCC5   tts"   /C /C "/C /C 
CCc           	          t          | |                     d          d         g          }t          |dt          |dd                    S )z<Return module version or None if version can't be retrieved.r   fromlist__version__VERSIONN)
__import__
rpartitiongetattr)module_namemods     r   get_module_versionr/   ;   sR    
[*55c::2>?A A AC3wsIt'D'DEEEr   c                    |                                  dk    rt          j        dd         }n"	 t          |           }n# t          $ r Y dS w xY w|dS ddl}|                    d|          }|
J d            |d|                                         }|sd	}|d
v sJ d| d            ||                                d         }t          |||          S )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 '')	lowerr   r   r/   r   researchstartr#   )namer   r!   r5   matchsymbs         r   is_installedr;   B   s   $ zz||xRaR	'--FF 	 	 	55	t 						'7++  ":   ~~& 	D,,,,1$111 -,,%++--..)fgt444s   ? 
AAc                 "     ddl  fd}|S )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                 N                                      fd            }|S )Nc                      t                    r | i |S d dj         d }|d z  }t          |dz             )N"z" in "z" requires " )r;   
__module__r   )argskwargsmsgr8   objr   s      r   func_wrappedz0require.<locals>.decorator.<locals>.func_wrapped   sq    D'** -sD+F+++G#GGS^GGGG&=w==(C!#),,,r   )wraps)rE   rF   	functoolsr8   r   s   ` r   	decoratorzrequire.<locals>.decorator   sF    				- 	- 	- 	- 	- 	- 
		- r   )rH   )r8   r   rI   rH   s   `` @r   requirerJ   m   s>    * 
 
 
 
 
 
 
 r   c                 |    t          | |          sdS t          | |                     d          d         g          S )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_modulerL      sQ    & W-- tk + 6 6s ; ;B ?@B B B Br   )N)
r   	packagingr   r   r   r#   r/   r;   rJ   rL   r   r   r   <module>rN      s    



 ) ) ) ) ) )G G G:  0F F F(5 (5 (5 (5V" " " "JB B B B B Br   