
    ^Mhp&                         d dl mZmZ d dlZd dlZd dlmZ d dlmZ dgZ	 e
            ZddddZdd
Z G d d          ZddZddddddZdS )    )	Parameter	signatureN)import_module)FunctionDoc_deprecatedz1.16.0)correct_moduledep_versionc                    |	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| 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 )aM  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``.
    dep_version : str, optional
        Version in which deprecated attributes will be removed.
    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.z` will be removed in SciPy z, 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   r	   correct_importattrmessagees              V/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/scipy/_lib/deprecation.py_sub_module_deprecationr       sC   0 !@+@@@@/+//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/ / $/ / 7B/ / EK/ / / 	 M'$61EEEE!  	=)H+)H)H)H)HII9UUUUU 	 	 	 ,,,HHHH	 s   )"C
C0C++C0   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>.callZ   s9    M#(:%/1 1 1 13''''    )
isinstancetyper   r   RuntimeWarning	functoolswraps__doc__)r'   r)   r(   r   s   ` r   wrapz_deprecated.<locals>.wrapS   s    c4   	M4S44'A7 7 7 7 J				( 	( 	( 	( 	( 	( 
		( {r*    )r(   r   r1   s   `` r   r   r   Q   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__i   s    r*   c                 *    t          | j                  S r6   )hashr7   )r9   s    r   __hash__z_DeprecationHelperStr.__hash__m   s    DM"""r*   c                 b    | j         |k    }|r!t          j        | j        t          d           |S )Nr!   r   )r7   r   r   r8   r   )r9   otherress      r   __eq__z_DeprecationHelperStr.__eq__p   s>    }% 	(M$-2D%&( ( ( (
r*   N)__name__
__module____qualname__r0   r;   r>   rB   r2   r*   r   r4   r4   e   sK              # # #    r*   r4   c                 8   | j          d| }|d| d}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   N`z` is deprecated!z` is deprecated, use `z
` instead!
r   FT__pyx_fuse_   )rC   __pyx_capi__popr4   )
r   routine_namenew_namer   old_namedepdocdj	has_fused
fused_names
             r   deprecate_cython_apirU   x   s	   B /22L22H/X///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*    )versiondeprecated_argscustom_messagec                    d}t          |          t                      n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.
    deprecated_args : set of str, optional
        Arguments to deprecate - whether passed by position or keyword.
    custom_message : str, optional
        Custom message to add to deprecation warning and documentation.
    Nz9Need to specify a version where signature will be changedc                    	
 t                     	g g 	j                                        D ]Z\  }}|j        t          j        k    r                    |           0|j        t          j        k    r                    |           [fd
t          j	                    	
fd            }t          |          }t                    z
  }d d| d d}r|d d d	z  }|z  }|d
xx         |gz  cc<   t          |                              dd          d         }t          |          |_        |S )Nc                                          |           }|r,d| d d}|z  }t          j        |t          d           d S d S )Nz
Arguments zV are deprecated, whether passed by position or keyword. They will be removed in SciPy . r   r   )intersectionr   r   r   )r&   r^   r   rY   rX   rW   s      r   warn_deprecated_argszb_deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.warn_deprecated_args   sz    *77??L R* * *%* * * >)g0BqQQQQQQR Rr*   c                     t          |           t                    z
  }|dk    r |            | i |S t          d |                   z
  }d                    |          }t          j        d| d
 dt
          d           |                    t          	j        |                       |            di |S )	Nr   z, z)You are passing as positional arguments: zE. Please change your invocation to use keyword arguments. From SciPy z@, passing these as positional arguments will result in an error.r!   )r   r2   )	lensetjoinr   r   r   updatezip
parameters)r%   r&   
extra_argskwonly_extra_argsargs_msgall_argsrX   fkwonly_argssigrW   r_   s        r   inner_fzU_deprecate_positional_args.<locals>._inner_deprecate_positional_args.<locals>.inner_f   s    TS]]2JQ$$V,,,q$)&))) !$K$< = = Oyy!233HM9 9 9")9 9 9
 #	 	 	 	 MM#cnd33444  (((1;;v;;r*   z
.. deprecated:: z
    Use of argument(s) ``z6`` by position is deprecated; beginning in 
    SciPy z, these will be keyword-only. zArgument(s) ``zX`` are deprecated, whether passed by position or keyword; they will be removed in SciPy r]   zExtended SummaryrH   rJ   )r   rf   itemskindr   POSITIONAL_OR_KEYWORDappendKEYWORD_ONLYr.   r/   r   rb   strsplitr0   )rk   nameparamrn   docrh   
admonitionrj   rl   rm   r_   rY   rX   rW   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(((	R 	R 	R 	R 	R 	R 	R 
			 	 	 	 	 	 	 	 	 	 
		0 '"",,>55 5+5 5 5 5 5
  	1 0O 0 0$+0 0 0 1J 	n$
J</#hhnnT1%%a(c((r*   )
ValueErrorrb   )funcrW   rX   rY   r(   rz   s    ```  r   _deprecate_positional_argsr}      sz    $ Ioo.6ceeeC<P<PO= = = = = = =~ //555++r*   )r!   )NNr6   )inspectr   r   r.   r   	importlibr   scipy._lib._docscraper   __all__object_NoValuer    r   r4   rU   r}   r2   r*   r   <module>r      s   ( ( ( ( ( ( ( (      # # # # # # - - - - - - /
 688 7;? ? ? ? ?D   (       &;M ;M ;M ;M@Z,T/3BZ, Z, Z, Z, Z, Z, Z,r*   