U
    5d                     @   s0   d Z ddlZddlZG dd deZdd ZdS )zDeprecation utilities    Nc                   @   s   e Zd ZdZdd ZdS )
Deprecatedz9A dummy class to catch usage of deprecated variable namesc                 C   s   dS )Nz<DEPRECATED parameter> )selfr   r   </tmp/pip-unpacked-wheel-8l90aumz/librosa/util/deprecation.py__repr__   s    zDeprecated.__repr__N)__name__
__module____qualname____doc__r   r   r   r   r   r   	   s   r   c                 C   sH   t |tr|S t }|d }tjd|d | |||tdd |S dS )aZ  Handle renamed arguments.

    Parameters
    ----------
    old_name : str
    old_value
        The name and value of the old argument
    new_name : str
    new_value
        The name and value of the new argument
    version_deprecated : str
        The version at which the old name became deprecated
    version_removed : str
        The version at which the old name will be removed

    Returns
    -------
    value
        - ``new_value`` if ``old_value`` of type `Deprecated`
        - ``old_value`` otherwise

    Warnings
    --------
    if ``old_value`` is not of type `Deprecated`

       zu{:s}() keyword argument '{:s}' has been renamed to '{:s}' in version {:}.
	This alias will be removed in version {:}.   )category
stacklevelN)
isinstancer   inspectstackwarningswarnformatDeprecationWarning)Zold_name	old_valuenew_name	new_valueZversion_deprecatedZversion_removedr   Zdep_funcr   r   r   	rename_kw   s     
    r   )r
   r   r   objectr   r   r   r   r   r   <module>   s   