Ë
    8Ò^j  ã                   ól   — 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	y)é    N)Ú__version__)Ú
get_config)Úparse_versionc                   ó   — e Zd ZdZd„ Zd„ Zy)Ú
_IDCounterz&Generate sequential ids with a prefix.c                 ó    — || _         d| _        y )Nr   )ÚprefixÚcount)Úselfr	   s     úh/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/sklearn/utils/_repr_html/base.pyÚ__init__z_IDCounter.__init__   s   € ØˆŒØˆ�
ó    c                 ób   — | xj                   dz  c_         | j                  › d| j                   › �S )Né   ú-)r
   r	   ©r   s    r   Úget_idz_IDCounter.get_id   s(   € Ø�
Š
�a‰�
Ø—+‘+�˜a §
¡
˜|Ð,Ð,r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   © r   r   r   r      s   „ Ù0òó-r   r   c                   óR   — e Zd ZdZdZdZed„ «       Zej                  d„ «       Zd„ Z	y)Ú_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   s_   € ä'¬Ó4ˆØ×ÑÐ&Ø,×2Ñ2Ð3°1°_×5JÑ5JÐ4KÐL‰KàˆKÜØØ!à+¨K¨=ð 9;ð ;ó	
ð 	
r   c                 ó   — t        | d|«       y )Nr   )Úsetattr)r   Úvalues     r   r%   z._HTMLDocumentationLinkMixin._doc_link_template]   s   € ä�Ð+¨UÕ3r   c                 óÒ  — | j                   j                  j                  d«      d   | j                  k7  ry| j                  €|| j                   j
                  }dj                  t        j                  d„ | j                   j                  j                  d«      «      «      }| j                  j                  ||¬«      S  | j                  j                  di | j	                  «       ¤Ž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   Ú c                 ó&   — | j                  d«       S )NÚ_)Ú
startswith)Úparts    r   ú<lambda>z;_HTMLDocumentationLinkMixin._get_doc_link.<locals>.<lambda>x   s   €  T§_¡_°SÓ%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Ñ6KÒKØà×-Ñ-Ð5Ø!Ÿ^™^×4Ñ4ˆNð  #Ÿx™xÜ×#Ñ#Ù9Ø—N‘N×-Ñ-×3Ñ3°CÓ8óó Ðð ×*Ñ*×1Ñ1Ø!1À.ð 2ó ð ð .ˆt×&Ñ&×-Ñ-ÑU°×0RÑ0RÓ0TÑUÐUr   )
r   r   r   r   r4   r5   Úpropertyr%   Úsetterr:   r   r   r   r   r      sH   „ ñ0ðd !ÐØ$(Ð!àñ
ó ð
ð ×Ññ4ó ð4óVr   r   c                   ó,   — e Zd ZdZed„ «       Zd„ Zd„ Zy)Ú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                 óP   — t        «       d   dk7  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_‰   s3   € ô ‹<˜	Ñ" iÒ/Ü ðóð ð
 ×$Ñ$Ð$r   c                 ó"   — | j                  «       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                 óf   — dt        | «      i}t        «       d   dk(  r| j                  «       |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_Ÿ   s5   € à¤ T£
Ð+ˆÜ‹<˜	Ñ" iÒ/Ø"&§/¡/Ó"3ˆF�;ÑØˆr   N)r   r   r   r   r;   rD   rC   rK   r   r   r   r>   r>   ‚   s%   „ ñð ñ%ó ð%ò!ór   r>   )
r7   r   r   Úsklearn._configr   Úsklearn.utils.fixesr   r   r   r>   r   r   r   ú<module>rN      s6   ðó å Ý &Ý -÷	-ñ 	-÷hVñ hV÷V"ò "r   