
     h                     <    d dl Z d dlZdgZ G d d          Zd ZdS )    N
deprecatedc                   2    e Zd ZdZd	dZd Zd Zd Zd ZdS )
r   a  Decorator to mark a function or class as deprecated.

    Issue a warning when the function is called/the class is instantiated and
    adds a warning to the docstring.

    The optional extra argument will be appended to the deprecation message
    and the docstring. Note: to use this with the default value for extra, put
    in an empty of parentheses:

    >>> from sklearn.utils import deprecated
    >>> deprecated()
    <sklearn.utils.deprecation.deprecated object at ...>

    >>> @deprecated()
    ... def some_function(): pass

    Parameters
    ----------
    extra : str, default=''
          To be added to the deprecation messages.
     c                     || _         d S )N)extra)selfr   s     U/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/sklearn/utils/deprecation.py__init__zdeprecated.__init__"   s    


    c                     t          |t                    r|                     |          S t          |t                    r|                     |          S |                     |          S )zPCall method

        Parameters
        ----------
        obj : object
        )
isinstancetype_decorate_classproperty_decorate_property_decorate_fun)r   objs     r	   __call__zdeprecated.__call__%   sf     c4   	+'',,,X&& 
	+ **3///%%c***r   c                     d|j         z  | j        rd| j        z  z  |j        fd}||_        d|_         |_        |S )NzClass %s is deprecated; %sc                  J    t          j        t                      | i |S N)categorywarningswarnFutureWarning)argskwargsinitmsgs     r	   wrappedz+deprecated._decorate_class.<locals>.wrappedB   s-    M#66664((((r   r
   )__name__r   r
   deprecated_original)r   clsr"   r    r!   s      @@r	   r   zdeprecated._decorate_class:   sp    &5: 	'6DJ&&C |	) 	) 	) 	) 	) 	) %&*#
r   c                     dj         z  | j        rd| j        z  z  t          j                  fd            }|_        |S )zDecorate function funzFunction %s is deprecatedr   c                  J    t          j        t                      | i |S r   r   )r   r   funr!   s     r	   r"   z)deprecated._decorate_fun.<locals>.wrappedT   s-    M#66663''''r   )r#   r   	functoolswraps__wrapped__)r   r(   r"   r!   s    ` @r	   r   zdeprecated._decorate_funM   so     *CL8: 	'6DJ&&C				( 	( 	( 	( 	( 
		( "r   c                 r    | j         t          t          j                  fd                        }|S )Nc                  T    t          j        t                      j        | i |S r   )r   r   r   fget)r   r   r!   props     r	   r"   z.deprecated._decorate_property.<locals>.wrappedb   s1     M#666649d-f---r   )r   r   r)   r*   )r   r/   r"   r!   s    ` @r	   r   zdeprecated._decorate_property_   sO    j					. 	. 	. 	. 	. 
	 
	. r   N)r   )	r#   
__module____qualname____doc__r
   r   r   r   r    r   r	   r   r      sn         2   + + +*  &  $	 	 	 	 	r   c                 r    t          | dg           }|g }dd                    d |D                       v }|S )z>Helper to check if func is wrapped by our deprecated decorator__closure__Nr   r   c                 P    g | ]#}t          |j        t                    |j        $S r3   )r   cell_contentsstr).0cs     r	   
<listcomp>z"_is_deprecated.<locals>.<listcomp>q   s+    OOOQj#.N.NOOOOr   )getattrjoin)funcclosuresis_deprecateds      r	   _is_deprecatedrA   k   sQ    t]B//H BGGOO(OOO% % M r   )r   r)   __all__r   rA   r3   r   r	   <module>rC      sm         .` ` ` ` ` ` ` `F    r   