
    V3jL                        d Z ddlmZmZmZmZmZmZ ddlZddl	Z	ddl
m
Z
 ddlZddlmZ ddlmZ g dZ ed      Z ed	      Zd
edededeeeef   geeef   f   fdZdededeeeef   geeef   f   fdZ ededef         Zdddddddeeeee   f      dee   deeeeef         dedee   deegef   fdZy)zHelpful tools for deprecation    )AnyCallableIterableOptionalTypeVarUnionN)	decorator)	DTypeLike)	ParamSpec)moved
deprecated	vectorizePR
moved_fromversionversion_removedreturnc                      dt         t        t        f   dt        j                  dt        j                  dt        f fd}t        |      S )zgMark functions as moved/renamed.

    Using the decorated (old) function will result in a warning.
    funcargskwargsr   c           	          t        j                  dj                  | j                  | j                        t
        d        | |i |S ) Warn the user, and then proceed.zz{:s}
	This function was moved to '{:s}.{:s}' in librosa version {:s}.
	This alias will be removed in librosa version {:s}.   category
stacklevelwarningswarnformat
__module____name__FutureWarning)r   r   r   r   r   r   s      D/DATA/.local/lib/python3.12/site-packages/librosa/util/decorators.py	__wrapperzmoved.<locals>.__wrapper   sM     FDOOT]]G_ #		
 T$V$$    r   r   r   r   r   r	   )r   r   r   r'   s   ``` r&   r   r      sA    %A %qvv % %a % Yr(   c                      dt         t        t        f   dt        j                  dt        j                  dt        f fd}t        |      S )zeMark a function as deprecated.

    Using the decorated (old) function will result in a warning.
    r   r   r   r   c                     t        j                  dj                  | j                  | j                        t
        d        | |i |S )r   z^{:s}.{:s}
	Deprecated as of librosa version {:s}.
	It will be removed in librosa version {:s}.r   r   r   )r   r   r   r   r   s      r&   r'   zdeprecated.<locals>.__wrapper5   sI    >>Df? #	
 T$V$$r(   r)   )r   r   r'   s   `` r&   r   r   -   sA    
%A 
%qvv 
% 
%a 
% Yr(   _F.)boundFotypesdocexcludedcache	signaturer/   r0   r1   r2   r3   c                 "      fd}|S )zWrap a function for use with np.vectorize.

    This function is not quite a decorator, but is used as a wrapper
    to np.vectorize that preserves scalar behavior.
    c                 z    t        j                  |       t        j                  |       fd       }|S )Nr.   c                  h     | i |}t        j                  | d         r|j                         S |S )Nr   )npisscalaritem)r   r   yvecfuncs      r&   _vecz*vectorize.<locals>.__wrapper.<locals>._vec_   s2    ((A{{47#vvxr(   )r7   r   	functoolswraps)functionr<   r;   r2   r0   r1   r/   r3   s     @r&   r'   zvectorize.<locals>.__wrapperU   sG    ,,
 
	"	 
#	 r(    )r/   r0   r1   r2   r3   r'   s   ````` r&   r   r   G   s     ( r(   )__doc__typingr   r   r   r   r   r   r    r=   r	   numpyr7   numpy.typingr
   typing_extensionsr   __all__r   r   strr   r   r,   intboolr   r@   r(   r&   <module>rJ      sU   $ D D     " '
.cNCL  !$ 7: x1~A./ 2  &) x1~A./ . T#s(+,
 9=48#"U3 3345" 
#" xc3h01	"
 " }" rdBh"r(   