o
    #Õj   ã                   @   s6   d Z ddlZddlZddlZddlZg Zddd„ZdS )z,
decorator to deprecate a function or class
é    NÚ c                    s   ‡ ‡‡‡fdd„}|S )a½  Decorate a function to signify its deprecation.

    This function wraps a method that will soon be removed and does two things:
        - The docstring of the API will be modified to include a notice
          about deprecation."
        - Raises a :class:`~exceptions.DeprecatedWarning` when old API is called.

    Args:
         since(str, optional): The version at which the decorated method is considered deprecated.
         update_to(str, optional): The new API users should use.
         reason(str, optional): The reason why the API is deprecated.
         level(int, optional): The deprecated warning log level. It must be
             an Integer and must be one of 0, 1, 2.
             If `level == 0`, the warning message will not be showed.
             If `level == 1`, the warning message will be showed normally.
             If `level == 2`, it will raise `RuntimeError`.

    Returns:
        decorator: decorated function or class.
    c                    s   ˆS )N)Ú
isinstanceÚstrÚintÚstripÚ
__module__Ú__name__ÚlenÚ
startswithÚformatÚ__doc__Ú	functoolsÚwraps)ÚfuncZ
_update_toÚ_reasonÚwrapper©ÚlevelÚreasonÚsinceÚ	update_to)Z_sincer   ÚmsgúX/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddle/utils/deprecated.pyÚ	decorator1   s   zdeprecated.<locals>.decorator© )r   r   r   r   r   r   r   r   Ú
deprecated   s   Gr   )r   r   r   r   )r   r   ÚsysÚwarningsZpaddleÚ__all__r   r   r   r   r   Ú<module>   s   