
    ¯wg                         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Zy)z"Utility for deprecating functions.    N)CallableTypeVar)	ParamSpec_T_Psince
removed_ininstructionsreturnc                 h     dt         t        t        f   dt         t        t        f   f f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           	          t        j                         dt        j                  dt        j                  dt
        f 	
fd       } j                  xs d}t        j                  d
 d	 d d	      }|j                  d
d      }t        |      dkD  r!|\  }}t        j                  |      }|d
||g}n
|d   }|d
|g}dj                  |      |_        |S )Nargskwargsr   c                      t        j                  dj                   dj                   d d d dt        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   s     \/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/torch/onnx/_deprecation.pywrapperz.deprecated.<locals>.decorator.<locals>.wrapper   sf    MMH''((*;*;)< =,,17 3(\<.C ' T,V,,     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_partsr
   r	   r   s   `       r   	decoratorzdeprecated.<locals>.decorator   s    		"	-277 	-bii 	-B 	- 
#	- $$*	 $??"G $;;E, G$~ &
 %??615 1$,MGT ??4(D#3VWd"K&q)G#3VW"E''"56r   )r   r   r   )r   r	   r
   r/   s   ``` r   
deprecatedr0      s1    *HRV, *"b&1A *X r   )r#   r!   r$   r   typingr   r   typing_extensionsr   r   r   strr0    r   r   <module>r5      so    (    $ ' T]t_:::/2:xB (2r6"223:r   