§
    §éUg9  ã                   óB   — d dl mZmZ d dlmZ  G d„ d¦  «        Zd„ ZdS )é    )Úupdate_wrapperÚwraps)Ú
MethodTypec                   ó&   — e Zd ZdZd„ Zd„ Zdd„ZdS )Ú_AvailableIfDescriptorav  Implements a conditional property using the descriptor protocol.

    Using this class to create a decorator will raise an ``AttributeError``
    if check(self) returns a falsey value. Note that if check raises an error
    this will also result in hasattr returning false.

    See https://docs.python.org/3/howto/descriptor.html for an explanation of
    descriptors.
    c                 óP   — || _         || _        || _        t          | |¦  «         d S ©N)ÚfnÚcheckÚattribute_namer   )Úselfr
   r   r   s       úZ/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/sklearn/utils/_available_if.pyÚ__init__z_AvailableIfDescriptor.__init__   s0   € ØˆŒØˆŒ
Ø,ˆÔõ 	�t˜RÑ Ô Ð Ð Ð ó    c                 óò   — dt          |j        ¦  «        › dt          | j        ¦  «        › �}	 |                      |¦  «        }n"# t          $ r}t          |¦  «        |‚d }~ww xY w|st          |¦  «        ‚d S )NzThis z has no attribute )ÚreprÚ__name__r   r   Ú	ExceptionÚAttributeError)r   ÚobjÚownerÚattr_err_msgÚcheck_resultÚes         r   Ú_checkz_AvailableIfDescriptor._check   s–   € àW•D˜œÑ(Ô(ÐWÐW½DÀÔATÑ<UÔ<UÐWÐWð 	ð	6ØŸ:š: c™?œ?ˆLˆLøÝð 	6ð 	6ð 	6Ý  Ñ.Ô.°AÐ5øøøøð	6øøøð ð 	/Ý  Ñ.Ô.Ð.ð	/ð 	/s   ®A Á
A#ÁAÁA#Nc                 ó¨   ‡ ‡— |�-‰                       |‰¬¦  «         t          ‰ j        |¦  «        }n t          ‰ j        ¦  «        ˆˆ fd„¦   «         }|S )N©r   c                  óX   •— ‰                      | d         ‰¬¦  «          ‰j        | i |¤ŽS )Nr   r   )r   r
   )ÚargsÚkwargsr   r   s     €€r   Úoutz+_AvailableIfDescriptor.__get__.<locals>.out.   s4   ø€ à—’˜D œG¨5�Ñ1Ô1Ð1Ø�t”w Ð/¨Ð/Ð/Ð/r   )r   r   r
   r   )r   r   r   r!   s   ` ` r   Ú__get__z_AvailableIfDescriptor.__get__$   sm   øø€ Øˆ?ð �KŠK˜ 5ˆKÑ)Ô)Ð)Ý˜TœW cÑ*Ô*ˆCˆCõ
 �4”7‰^Œ^ð0ð 0ð 0ð 0ð 0ñ Œ^ð0ð ˆ
r   r	   )r   Ú
__module__Ú__qualname__Ú__doc__r   r   r"   © r   r   r   r      sP   € € € € € ðð ð!ð !ð !ð
/ð 
/ð 
/ðð ð ð ð ð r   r   c                 ó   ‡ — ˆ fd„S )a  An attribute that is available only if check returns a truthy value.

    Parameters
    ----------
    check : callable
        When passed the object with the decorated method, this should return
        a truthy value if the attribute is available, and either return False
        or raise an AttributeError if not available.

    Returns
    -------
    callable
        Callable makes the decorated method available if `check` returns
        a truthy value, otherwise the decorated method is unavailable.

    Examples
    --------
    >>> from sklearn.utils.metaestimators import available_if
    >>> class HelloIfEven:
    ...    def __init__(self, x):
    ...        self.x = x
    ...
    ...    def _x_is_even(self):
    ...        return self.x % 2 == 0
    ...
    ...    @available_if(_x_is_even)
    ...    def say_hello(self):
    ...        print("Hello")
    ...
    >>> obj = HelloIfEven(1)
    >>> hasattr(obj, "say_hello")
    False
    >>> obj.x = 2
    >>> hasattr(obj, "say_hello")
    True
    >>> obj.say_hello()
    Hello
    c                 ó2   •— t          | ‰| j        ¬¦  «        S )N)r   )r   r   )r
   r   s    €r   ú<lambda>zavailable_if.<locals>.<lambda>]   s   ø€ Õ,¨R°ÀrÄ{ÐSÑSÔS€ r   r&   )r   s   `r   Úavailable_ifr*   6   s   ø€ ðN TÐSÐSÐSÐSr   N)Ú	functoolsr   r   Útypesr   r   r*   r&   r   r   ú<module>r-      sv   ðØ +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ø Ð Ð Ð Ð Ð ð.ð .ð .ð .ð .ñ .ô .ð .ðb'Tð 'Tð 'Tð 'Tð 'Tr   