
    e!hp&                         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y)    )	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 ]  }	 t        t        d|  d|       |      c S  y# t         $ r}
||d   k(  r|
Y d}
~
;d}
~
ww xY w)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              ^/var/www/html/diagnosisapp-backend/venv/lib/python3.12/site-packages/scipy/_lib/deprecation.py_sub_module_deprecationr       s   0 !!+a/?@!+/k]!F8+?	{ K##.-q 923
 	
 =0)TBDi[^4D E%ax 023 	 k]!F81YK 8%ax 0!]!F81YK 8#}$5k]!F8 L./ 	 MM'$61E! 	=6+ax)HI9UU  	 ,,	s   B==	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   c                  L    t        j                  t                | i |S )Nr   )r   r   r   )argskwargsfunmsgr   s     r   callz'_deprecated.<locals>.wrap.<locals>.callZ   s'    MM#(:%/1'''    )
isinstancetyper   r   RuntimeWarning	functoolswraps__doc__)r'   r)   r(   r   s   ` r   wrapz_deprecated.<locals>.wrapS   s\    c4 MM,SG4'A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y)_DeprecationHelperStrz3
    Helper class used by deprecate_cython_api
    c                      || _         || _        y 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    DMM""r*   c                 t    | 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   s0    }}%MM$--2D%&(
r*   N)__name__
__module____qualname__r0   r;   r>   rB   r2   r*   r   r4   r4   e   s     #r*   r4   c                 (   | j                    d| }|d| d}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.

    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 //"!L>2HXJ./XJ4XJjI$. A 	
AI
"1#l^4
?I;<55;LA#J78FA  9:|9L
f
56 r*    )versiondeprecated_argscustom_messagec                z    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.
    z9Need to specify a version where signature will be changedc                 l   	
 t               	g g 	j                  j                         D ]c  \  }}|j                  t        j
                  k(  rj                  |       5|j                  t        j                  k(  sSj                  |       e 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        |      j                  dd      d   }t        |      |_        |S )Nc                     j                  |       }|r+d| d d}|z  }t        j                  |t        d       y y )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   sS    *77?L'~ 6T%Yb* >)g0BqQ r*   c                  P   t        |       t              z
  }|dk  r |        | i |S t        d |       z
  }dj                  |      }t        j                  d| d
 dt
        d       |j                  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,$)&)) !$K$< = Oyy!23HMM?z J"") +99
 #	 MM#cnnd34 (;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   sP   l>>//1 	)KD%zzY<<<%y555""4(		)	R 
		 	 
	0 '",>	 +, -)15
 ^O+< =$$+9B0 1J 	n$
J</#hnnT1%a(c(r*   )
ValueErrorrb   )funcrW   rX   rY   r(   rz   s    ```  r   _deprecate_positional_argsr}      sK    $ Io.6ceC<PO=~ /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\    (   # - /
 8 7;?D( &;M@Z,T/3BZ,r*   