o
    闦i                     @   s   d Z ddlZddlZddlZddlmZmZ ddlm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dZdS )z"Utility for deprecating functions.    N)CallableTypeVar)	ParamSpec_T_Psince
removed_ininstructionsreturnc                    s.   dt ttf dt ttf f 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.
    functionr
   c              	      s   t  dtjdtjdtf fdd} jpd}td d d	 d
}|	dd}t
|dkrG|\}}t|}|d||g}n	|d }|d|g}d||_|S )Nargskwargsr
   c                     sB   t jd j d j d d d dtdd  | i |S )N'.z' is deprecated in version z and will be removed in z	. Please    )category
stacklevel)warningswarn
__module____name__FutureWarning)r   r   )r   r	   r   r    U/home/ubuntu/transcripts/venv/lib/python3.10/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wrapsr   r   r   r   __doc__textwrapdedentsplitlenjoin)r   r   	docstringdeprecation_notesummary_and_bodysummarybodynew_docstring_partsr	   r   r   )r   r   	decorator   s*   &
	

zdeprecated.<locals>.decorator)r   r   r   )r   r   r	   r,   r   r+   r   
deprecated   s   *,r-   )r   r   r    r   typingr   r   typing_extensionsr   r   r   strr-   r   r   r   r   <module>   s"    