
    Ug                         d dl mZmZ d dlZd dlZd dlmZ dgZ e            Z	dddZ
ddZ G d	 d
          ZddZddddZdS )    )	Parameter	signatureN)import_module_deprecated)correct_modulec                    |	d|  d| }nd|  }||vrt          d|  d| d| d|  d| d          t          t          |          |d          }|d| d	| d
|  d| d	}n!d|  d| d| d|  d| d|  d| d| d|  d| d}t          j        |t
          d           |D ]L}	 t          t          d|  d|           |          c S # t           $ r}	||d         k    r|	Y d}	~	Ed}	~	ww xY wdS )a  Helper function for deprecating modules that are public but were
    intended to be private.

    Parameters
    ----------
    sub_package : str
        Subpackage the module belongs to eg. stats
    module : str
        Public but intended private module to deprecate
    private_modules : list
        Private replacement(s) for `module`; should contain the
        content of ``all``, possibly spread over several modules.
    all : list
        ``__all__`` belonging to `module`
    attribute : str
        The attribute in `module` being accessed
    correct_module : str, optional
        Module in `sub_package` that `attribute` should be imported from.
        Default is that `attribute` should be imported from ``scipy.sub_package``.
    Nzscipy..z`scipy.z` has no attribute `z`; furthermore, `scipy.z3` is deprecated and will be removed in SciPy 2.0.0.zPlease import `z` from the `z` namespace; the `scipy.z=` namespace is deprecated and will be removed in SciPy 2.0.0.z&` is deprecated along with the `scipy.z` namespace. `scipy.z2` will be removed in SciPy 1.14.0, and the `scipy.z+` namespace will be removed in SciPy 2.0.0.   category
stacklevel)AttributeErrorgetattrr   warningswarnDeprecationWarning)
sub_packagemoduleprivate_modulesall	attributer   correct_importattrmessagees
             U/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/scipy/_lib/deprecation.py_sub_module_deprecationr      s2   , !@+@@@@/+//3k 3 3F 3 3	 3 3#.3 3173 3 3
 
 	
 =00)TBBD3i 3 3^ 3 3%3 3(.3 3 3 	/k / /F / /Y / /%/ /(./ /!/ /$*/ /-6/ / 0;/ / >D/ / / 	 M'$61EEEE!  	=)H+)H)H)H)HII9UUUUU 	 	 	 ,,,HHHH	 s   &"C
C-C((C-   c                       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 r   r   c                  L    t          j        t                      | i |S )Nr   )r   r   r   )argskwargsfunmsgr   s     r   callz'_deprecated.<locals>.wrap.<locals>.callW   s9    M#(:%/1 1 1 13''''    )
isinstancetyper   r   RuntimeWarning	functoolswraps__doc__)r%   r'   r&   r   s   ` r   wrapz_deprecated.<locals>.wrapP   s    c4   	M4S44'A7 7 7 7 J				( 	( 	( 	( 	( 	( 
		( {r(    )r&   r   r/   s   `` r   r   r   N   s)          Kr(   c                   $    e Zd ZdZd Zd Zd ZdS )_DeprecationHelperStrz3
    Helper class used by deprecate_cython_api
    c                 "    || _         || _        d S N)_content_message)selfcontentr   s      r   __init__z_DeprecationHelperStr.__init__f   s    r(   c                 *    t          | j                  S r4   )hashr5   )r7   s    r   __hash__z_DeprecationHelperStr.__hash__j   s    DM"""r(   c                 b    | j         |k    }|r!t          j        | j        t          d           |S )Nr   r   )r5   r   r   r6   r   )r7   otherress      r   __eq__z_DeprecationHelperStr.__eq__m   s>    }% 	(M$-2D%&( ( ( (
r(   N)__name__
__module____qualname__r.   r9   r<   r@   r0   r(   r   r2   r2   b   sK              # # #    r(   r2   c                 6   | j          d| }|d|z  }n	d| d| d}||d|z   z  }| j        }d}d	}	 d| | }	|	|v r.d
}|                    |	          |t          |	|          <   |dz  }nn;|s(|                    |          |t          ||          <   dS dS )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.

    r	   Nz`%s` is deprecated!`z` is deprecated, use `z
` instead!
r   FT__pyx_fuse_   )rA   __pyx_capi__popr2   )
r   routine_namenew_namer   old_namedepdocdj	has_fused
fused_names
             r   deprecate_cython_apirS   u   s   B /22L22H&1IXIIXIII$. A 	
AI414l44
??I;<55;L;LA#J778FAA  M9:|9L9L
f
5
5666M Mr(   )versionc                R    d}t          |          fd}|  ||           S |S )a  Decorator for methods that issues warnings for positional arguments.

    Using the keyword-only argument syntax in pep 3102, arguments after the
    * will issue a warning when passed as a positional argument.

    Parameters
    ----------
    func : callable, default=None
        Function to check arguments on.
    version : callable, default=None
        The version when positional arguments will result in error.
    Nz9Need to specify a version where signature will be changedc                 d    t                     g g j                                        D ]Z\  }}|j        t          j        k    r                    |           0|j        t          j        k    r                    |           [t          j	                    fd            }|S )Nc                     t          |           t                    z
  }|dk    r | i |S d t          d |         | | d                    D             }d                    |          }t          j        d| d dt
          d           |                    t          j        |                       d	i |S )
Nr   c                 "    g | ]\  }}| d | S )=r0   ).0nameargs      r   
<listcomp>zi_deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.inner_f.<locals>.<listcomp>   s6       D# #  r(   z, zYou are passing z^ as a positional argument. Please change your invocation to use keyword arguments. From SciPy z@, passing these as positional arguments will result in an error.r   )r   r0   )lenzipjoinr   r   r   update
parameters)	r#   r$   
extra_argsargs_msgall_argsfkwonly_argssigrT   s	       r   inner_fzU_deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.inner_f   s    TS]]2JQq$)&))) !$[*%=tZKLL?Q!R!R  H yy**HM9x 9 9")9 9 9
 #	 	 	 	 MM#cnd334441;;v;;r(   )
r   rb   itemskindr   POSITIONAL_OR_KEYWORDappendKEYWORD_ONLYr,   r-   )rf   r[   paramri   re   rg   rh   rT   s   `   @@@r    _inner_deprecate_positional_argszD_deprecate_positional_args.<locals>._inner_deprecate_positional_args   s    ll>//11 	) 	)KD%zY<<<%%%%y555""4(((				 	 	 	 	 	 	 	 
		0 r(   )
ValueError)funcrT   r&   rp   s    `  r   _deprecate_positional_argsrs      sT     Ioo$ $ $ $ $L //555++r(   )r   )NNr4   )inspectr   r   r,   r   	importlibr   __all__object_NoValuer   r   r2   rS   rs   r0   r(   r   <module>ry      s    ( ( ( ( ( ( ( (      # # # # # # /
 688 7;= = = = =@   (       &;M ;M ;M ;M@:,T :, :, :, :, :, :, :,r(   