U
    •Ê¹jñ  ã                   @   s2   d Z ddlZddlZddlZeeedœdd„ZdS )z"Utility for deprecating functions.é    N)ÚsinceÚ
removed_inÚinstructionsc                    s   ‡ ‡‡fdd„}|S )aF  Marks functions as deprecated.

    It will result in a warning when the function is called and a note in the
    docstring.

    Args:
        since: The version when the function was first deprecated.
        removed_in: The version when the function will be removed.
        instructions: The action users should take.
    c              	      sž   t  ˆ ¡‡ ‡‡‡fdd„ƒ}ˆ jp$d}t dˆ› dˆ› dˆ› d�¡}| dd	¡}t|ƒd	kr||\}}t |¡}|d||g}n|d
 }|d|g}d |¡|_|S )Nc                     s>   t jdˆ j› dˆ j› dˆ› dˆ› dˆ› d�tdd� ˆ | |ŽS )Nú'Ú.z' is deprecated in version z and will be removed in z	. Please é   )ÚcategoryÚ
stacklevel)ÚwarningsÚwarnÚ
__module__Ú__name__ÚFutureWarning)ÚargsÚkwargs)Úfunctionr   r   r   © úV/var/www/html/bwave/python/venv/lib/python3.8/site-packages/torch/onnx/_deprecation.pyÚwrapper   s    &ûz.deprecated.<locals>.decorator.<locals>.wrapperÚ z            .. deprecated:: z;
                Deprecated and will be removed in version z.
                Please z.
            z

é   r   )Ú	functoolsÚwrapsÚ__doc__ÚtextwrapÚdedentÚsplitÚlenÚjoin)r   r   Z	docstringZdeprecation_noteZsummary_and_bodyÚsummaryÚbodyZnew_docstring_parts©r   r   r   )r   r   Ú	decorator   s*    
ÿþýÿ	

zdeprecated.<locals>.decoratorr   )r   r   r   r"   r   r!   r   Ú
deprecated   s    ,r#   )r   r   r   r
   Ústrr#   r   r   r   r   Ú<module>   s   