U
    <c                     @   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 version z	. Please    )category
stacklevel)warningswarn
__module____name__FutureWarning)argskwargs)functionr   r   r    ;/tmp/pip-unpacked-wheel-gikjz4vx/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   