Ë
    ÷Q(h‰  ã                   ó:   — d dl mZmZ d dlmZ  G d„ d«      Zd„ Zy)é    )Úupdate_wrapperÚwraps)Ú
MethodTypec                   ó$   — e Zd ZdZd„ Zd„ Zdd„Zy)Ú_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                 óF   — || _         || _        || _        t        | |«       y ©N)ÚfnÚcheckÚattribute_namer   )Úselfr
   r   r   s       úY/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sklearn/utils/_available_if.pyÚ__init__z_AvailableIfDescriptor.__init__   s$   € ØˆŒØˆŒ
Ø,ˆÔô 	�t˜RÕ ó    c                 óØ   — dt        |j                  «      › dt        | j                  «      › �}	 | j                  |«      }|st        |«      ‚y # t        $ r}t        |«      |‚d }~ww xY w)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   st   € à”D˜Ÿ™Ó(Ð)Ð);¼DÀ×ATÑATÓ<UÐ;VÐWð 	ð	6ØŸ:™: c›?ˆLñ Ü  Ó.Ð.ð øô ò 	6Ü  Ó.°AÐ5ûð	6ús   °A Á	A)ÁA$Á$A)Nc                 ó    ‡ ‡— |�+‰ j                  |‰¬«       t        ‰ j                  |«      }|S t        ‰ j                  «      ˆˆ fd„«       }|S )N©r   c                  óT   •— ‰j                  | d   ‰¬«        ‰j                  | i |¤ŽS )Nr   r   )r   r
   )ÚargsÚkwargsr   r   s     €€r   Úoutz+_AvailableIfDescriptor.__get__.<locals>.out1   s-   ø€ à—‘˜D ™G¨5�Ô1Ø�t—w‘w Ð/¨Ñ/Ð/r   )r   r   r
   r   )r   r   r   r!   s   ` ` r   Ú__get__z_AvailableIfDescriptor.__get__'   sT   ù€ Øˆ?ð �K‰K˜ 5ˆKÔ)Ü˜TŸW™W cÓ*ˆCð ˆ
ô �4—7‘7‹^ô0ó ð0ð ˆ
r   r	   )r   Ú
__module__Ú__qualname__Ú__doc__r   r   r"   © r   r   r   r      s   „ ñò!ò
/ô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                 ó4   •— t        | ‰| j                  ¬«      S )N)r   )r   r   )r
   r   s    €r   ú<lambda>zavailable_if.<locals>.<lambda>`   s   ø€ Ô,¨R°ÀrÇ{Á{ÔS€ r   r&   )r   s   `r   Úavailable_ifr*   9   s   ø€ óN TÐSr   N)Ú	functoolsr   r   Útypesr   r   r*   r&   r   r   ú<module>r-      s   ð÷ ,Ý ÷.ñ .ób'Tr   