
    xfL                     >    d dl Z d dlZdgZddZ G d d      ZddZy)	    N_deprecatedc                       fd}|S )z2Deprecate a function by emitting a warning on use.c                      t         t              r!t        j                  d t        d        S t        j                          fd       } j                  |_        |S )NzTrying to deprecate class    category
stacklevelc                  L    t        j                  t                | i |S )Nr   )warningswarnDeprecationWarning)argskwargsfunmsgr	   s     8/usr/lib/python3/dist-packages/scipy/_lib/deprecation.pycallz'_deprecated.<locals>.wrap.<locals>.call   s'    MM#(:%/1'''    )
isinstancetyper   r   RuntimeWarning	functoolswraps__doc__)r   r   r   r	   s   ` r   wrapz_deprecated.<locals>.wrap	   s\    c4 MM,SG4'A7 J			( 
	( {{r    )r   r	   r   s   `` r   r   r      s     Kr   c                   "    e Zd ZdZd Zd Zd Zy)_DeprecationHelperStrz3
    Helper class used by deprecate_cython_api
    c                      || _         || _        y N)_content_message)selfcontentmessages      r   __init__z_DeprecationHelperStr.__init__   s    r   c                 ,    t        | j                        S r    )hashr!   )r#   s    r   __hash__z_DeprecationHelperStr.__hash__#   s    DMM""r   c                 t    | j                   |k(  }|r&t        j                  | j                  t        d       |S )Nr   r   )r!   r   r   r"   r   )r#   otherress      r   __eq__z_DeprecationHelperStr.__eq__&   s0    }}%MM$--2D%&(
r   N)__name__
__module____qualname__r   r&   r)   r-   r   r   r   r   r      s     #r   r   c                 &   | j                    d| }|d|z  }n	d|d|d}||d|z   z  }| j                  }d}d	}	 d| | }	|	|v r&d
}|j                  |	      |t        |	|      <   |dz  }nn3|s|j                  |      |t        ||      <   yy)a>  
    Deprecate an exported cdef function in a public Cython API module.

    Only functions can be deprecated; typedefs etc. cannot.

    Parameters
    ----------
    module : module
        Public Cython API module (e.g. scipy.linalg.cython_blas).
    routine_name : str
        Name of the routine to deprecate. May also be a fused-type
        routine (in which case its all specializations are deprecated).
    new_name : str
        New name to include in the deprecation warning message
    message : str
        Additional text in the deprecation warning message

    Examples
    --------
    Usually, this function would be used in the top-level of the
    module ``.pyx`` file:

    >>> from scipy._lib.deprecation import deprecate_cython_api
    >>> import scipy.linalg.cython_blas as mod
    >>> deprecate_cython_api(mod, "dgemm", "dgemm_new",
    ...                      message="Deprecated in Scipy 1.5.0")
    >>> del deprecate_cython_api, mod

    After this, Cython modules that use the deprecated function emit a
    deprecation warning when they are imported.

    .Nz`%s` is deprecated!`z` is deprecated, use `z
` instead!
r   FT__pyx_fuse_   )r.   __pyx_capi__popr   )
moduleroutine_namenew_namer%   old_namedepdocdj	has_fused
fused_names
             r   deprecate_cython_apirB   .   s    B //"!L>2H&1  H& $. A 	
AI
"1#l^4
?I;<55;LA#J78FA  9:|9L
f
56 r   )r   )NN)r   r   __all__r   r   rB   r   r   r   <module>rD      s'     /( &<Mr   