§
    rŠtj  ã                   ó€   — d dl Z d dlmZ d dlmZ d dlmZ  G d„ d¦  «        Z G d„ d¦  «        Z G d	„ d
¦  «        Z	dS )é    N)Ú__version__)Ú
get_config)Úparse_versionc                   ó   — e Zd ZdZd„ Zd„ ZdS )Ú
_IDCounterz&Generate sequential ids with a prefix.c                 ó"   — || _         d| _        d S )Nr   )ÚprefixÚcount)Úselfr	   s     ú[/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sklearn/utils/_repr_html/base.pyÚ__init__z_IDCounter.__init__   s   € ØˆŒØˆŒ
ˆ
ˆ
ó    c                 óD   — | xj         dz  c_         | j        › d| j         › �S )Né   ú-)r
   r	   ©r   s    r   Úget_idz_IDCounter.get_id   s)   € Øˆ
Œ
�a‰ˆ
Œ
Ø”+Ð,Ð, ¤
Ð,Ð,Ð,r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   © r   r   r   r      s8   € € € € € Ø0Ð0ðð ð ð-ð -ð -ð -ð -r   r   c                   óV   — e Zd ZdZdZdZed„ ¦   «         Zej        d„ ¦   «         Zd„ Z	dS )Ú_HTMLDocumentationLinkMixina2	  Mixin class allowing to generate a link to the API documentation.

    This mixin relies on three attributes:
    - `_doc_link_module`: it corresponds to the root module (e.g. `sklearn`). Using this
      mixin, the default value is `sklearn`.
    - `_doc_link_template`: it corresponds to the template used to generate the
      link to the API documentation. Using this mixin, the default value is
      `"https://scikit-learn.org/{version_url}/modules/generated/
      {estimator_module}.{estimator_name}.html"`.
    - `_doc_link_url_param_generator`: it corresponds to a function that generates the
      parameters to be used in the template when the estimator module and name are not
      sufficient.

    The method :meth:`_get_doc_link` generates the link to the API documentation for a
    given estimator.

    This mixin provides all the necessary states for
    :func:`sklearn.utils.estimator_html_repr` to generate a link to the API
    documentation for the estimator HTML diagram.

    Examples
    --------
    If the default values for `_doc_link_module`, `_doc_link_template` are not suitable,
    then you can override them and provide a method to generate the URL parameters:
    >>> from sklearn.base import BaseEstimator
    >>> doc_link_template = "https://address.local/{single_param}.html"
    >>> def url_param_generator(estimator):
    ...     return {"single_param": estimator.__class__.__name__}
    >>> class MyEstimator(BaseEstimator):
    ...     # use "builtins" since it is the associated module when declaring
    ...     # the class in a docstring
    ...     _doc_link_module = "builtins"
    ...     _doc_link_template = doc_link_template
    ...     _doc_link_url_param_generator = url_param_generator
    >>> estimator = MyEstimator()
    >>> estimator._get_doc_link()
    'https://address.local/MyEstimator.html'

    If instead of overriding the attributes inside the class definition, you want to
    override a class instance, you can use `types.MethodType` to bind the method to the
    instance:
    >>> import types
    >>> estimator = BaseEstimator()
    >>> estimator._doc_link_template = doc_link_template
    >>> estimator._doc_link_url_param_generator = types.MethodType(
    ...     url_param_generator, estimator)
    >>> estimator._get_doc_link()
    'https://address.local/BaseEstimator.html'
    ÚsklearnNc                 óŠ   — t          t          ¦  «        }|j        €|j        › d|j        › �}nd}t          | dd|› d�¦  «        S )Nú.ÚdevÚ__doc_link_templatezhttps://scikit-learn.org/z;/modules/generated/{estimator_module}.{estimator_name}.html)r   r   r   ÚmajorÚminorÚgetattr)r   Úsklearn_versionÚversion_urls      r   Ú_doc_link_templatez._HTMLDocumentationLinkMixin._doc_link_templateM   sf   € å'­Ñ4Ô4ˆØÔÐ&Ø,Ô2ÐLÐL°_Ô5JÐLÐLˆKˆKàˆKÝØØ!ð;¨Kð ;ð ;ð ;ñ	
ô 
ð 	
r   c                 ó(   — t          | d|¦  «         d S )Nr   )Úsetattr)r   Úvalues     r   r%   z._HTMLDocumentationLinkMixin._doc_link_template]   s   € å�Ð+¨UÑ3Ô3Ð3Ð3Ð3r   c                 ó”  — | j         j                             d¦  «        d         | j        k    rdS | j        €n| j         j        }d                     t          j        d„ | j         j                             d¦  «        ¦  «        ¦  «        }| j	         
                    ||¬¦  «        S  | j	        j
        di |                      ¦   «         ¤ŽS )aÙ  Generates a link to the API documentation for a given estimator.

        This method generates the link to the estimator's documentation page
        by using the template defined by the attribute `_doc_link_template`.

        Returns
        -------
        url : str
            The URL to the API documentation for this estimator. If the estimator does
            not belong to module `_doc_link_module`, the empty string (i.e. `""`) is
            returned.
        r   r   Ú Nc                 ó.   — |                       d¦  «         S )NÚ_)Ú
startswith)Úparts    r   ú<lambda>z;_HTMLDocumentationLinkMixin._get_doc_link.<locals>.<lambda>x   s   €  T§_¢_°SÑ%9Ô%9Ð!9€ r   )Úestimator_moduleÚestimator_namer   )Ú	__class__r   ÚsplitÚ_doc_link_moduleÚ_doc_link_url_param_generatorr   ÚjoinÚ	itertoolsÚ	takewhiler%   Úformat)r   r1   r0   s      r   Ú_get_doc_linkz)_HTMLDocumentationLinkMixin._get_doc_linka   sÕ   € ð Œ>Ô$×*Ò*¨3Ñ/Ô/°Ô2°dÔ6KÒKÐKØ�2àÔ-Ð5Ø!œ^Ô4ˆNð  #ŸxšxÝÔ#Ø9Ð9Ø”NÔ-×3Ò3°CÑ8Ô8ñô ñ ô  Ðð Ô*×1Ò1Ø!1À.ð 2ñ ô ð ð .ˆtÔ&Ô-ÐUÐU°×0RÒ0RÑ0TÔ0TÐUÐUÐUr   )
r   r   r   r   r4   r5   Úpropertyr%   Úsetterr:   r   r   r   r   r      sy   € € € € € ð0ð 0ðd !ÐØ$(Ð!àð
ð 
ñ „Xð
ð Ôð4ð 4ñ Ôð4ðVð Vð Vð Vð Vr   r   c                   ó4   — e Zd ZdZed„ ¦   «         Zd„ Zd„ ZdS )ÚReprHTMLMixinz×Mixin to handle consistently the HTML representation.

    When inheriting from this class, you need to define an attribute `_html_repr`
    which is a callable that returns the HTML representation to be shown.
    c                 ó^   — t          ¦   «         d         dk    rt          d¦  «        ‚| j        S )a  HTML representation of estimator.
        This is redundant with the logic of `_repr_mimebundle_`. The latter
        should be favored in the long term, `_repr_html_` is only
        implemented for consumers who do not interpret `_repr_mimbundle_`.
        ÚdisplayÚdiagramzW_repr_html_ is only defined when the 'display' configuration option is set to 'diagram')r   ÚAttributeErrorÚ_repr_html_innerr   s    r   Ú_repr_html_zReprHTMLMixin._repr_html_‰   s:   € õ ‰<Œ<˜	Ô" iÒ/Ð/Ý ðñô ð ð
 Ô$Ð$r   c                 ó*   — |                       ¦   «         S )z½This function is returned by the @property `_repr_html_` to make
        `hasattr(estimator, "_repr_html_") return `True` or `False` depending
        on `get_config()["display"]`.
        )Ú
_html_reprr   s    r   rC   zReprHTMLMixin._repr_html_inner˜   s   € ð
 �ŠÑ Ô Ð r   c                 ó†   — dt          | ¦  «        i}t          ¦   «         d         dk    r|                      ¦   «         |d<   |S )z8Mime bundle used by jupyter kernels to display estimatorz
text/plainr@   rA   z	text/html)Úreprr   rF   )r   ÚkwargsÚoutputs      r   Ú_repr_mimebundle_zReprHTMLMixin._repr_mimebundle_Ÿ   s?   € à¥ T¡
¤
Ð+ˆÝ‰<Œ<˜	Ô" iÒ/Ð/Ø"&§/¢/Ñ"3Ô"3ˆF�;ÑØˆr   N)r   r   r   r   r;   rD   rC   rK   r   r   r   r>   r>   ‚   sW   € € € € € ðð ð ð%ð %ñ „Xð%ð!ð !ð !ðð ð ð ð r   r>   )
r7   r   r   Úsklearn._configr   Úsklearn.utils.fixesr   r   r   r>   r   r   r   ú<module>rN      sÜ   ðð Ð Ð Ð à Ð Ð Ð Ð Ð Ø &Ð &Ð &Ð &Ð &Ð &Ø -Ð -Ð -Ð -Ð -Ð -ð	-ð 	-ð 	-ð 	-ð 	-ñ 	-ô 	-ð 	-ðhVð hVð hVð hVð hVñ hVô hVð hVðV"ð "ð "ð "ð "ñ "ô "ð "ð "ð "r   