
    Xh)	                     >    d dl Z d dlZ G d de      Z G d d      Zy)    Nc                       e Zd ZdZy)jupyterlab_deprecationz`Create our own deprecation class, since Python >= 2.7
    silences deprecations by default.
    N)__name__
__module____qualname____doc__     D/var/www/html/myenv/lib/python3.12/site-packages/jupyterlab/utils.pyr   r      s     	r
   r   c                       e Zd ZdZddZd Zy)
deprecateda  Decorator to mark deprecated functions with warning.
    Adapted from `scikit-image/skimage/_shared/utils.py`.

    Parameters
    ----------
    alt_func : str
        If given, tell user what function to use instead.
    behavior : {'warn', 'raise'}
        Behavior during call to deprecated function: 'warn' = warn user that
        function is deprecated; 'raise' = raise error.
    removed_version : str
        The package version in which the deprecated function will be removed.
    Nc                 .    || _         || _        || _        y )N)alt_funcbehaviorremoved_version)selfr   r   r   s       r   __init__zdeprecated.__init__   s      .r
   c                 X    d} j                   d j                    d}d} j                  d j                   }j                  |z   dz   |z   }d| dt        j                         fd       }d	|z   }|j
                  	||_        |S |d
z   |j
                  z   |_        |S )N z Use ``z`` instead.z  and will be removed in version .zFunction ``z`` is deprecatedc                     j                   dk(  r[j                  }t        j                  dt               t        j
                  t        |j                  |j                  dz          nj                   dk(  rt	               | i |S )Nwarnalways   )categoryfilenamelinenoraise)r   __code__warningssimplefilterr   warn_explicitco_filenameco_firstlineno)argskwargs	func_codefuncmsgr   s      r   wrappedz$deprecated.__call__.<locals>.wrapped/   s}    }}& MM	%%h0FG&&3&22$33a7	 '),S11(((r
   z**Deprecated function**.z

    )r   r   r   	functoolswrapsr   )r   r(   alt_msgrmv_msgfunction_descriptionr*   docr)   s   ``     @r   __call__zdeprecated.__call__$   s    ==$k:G+89M9M8NOG#}}w6<wF011AB			) 
	) )72??"!GO  "J.@GOr
   )Nr   N)r   r   r   r   r   r1   r	   r
   r   r   r      s    /
!r
   r   )r+   r    Warningr   r   r	   r
   r   <module>r3      s#     	W 	5 5r
   