ó
    Ñ]jöF  ã                   óè   • S SK r S SKJr  S SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr   " S S	5      rS
 r\" S5      r\" S5      r\" 5       r " S S5      r         SS jrS r   SS jrS rg)é    N)Úclosing)Úisclass)ÚStringIO)ÚPath)ÚTemplate)Úconfig_contextc                   ó$   • \ rS rSrSrS rS rSrg)Ú
_IDCounteré   z&Generate sequential ids with a prefix.c                 ó   • Xl         SU l        g )Nr   )ÚprefixÚcount)Úselfr   s     Ú_/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sklearn/utils/_repr_html/estimator.pyÚ__init__Ú_IDCounter.__init__   s   € ØŒØˆ�
ó    c                 ób   • U =R                   S-  sl         U R                   SU R                    3$ )Né   Ú-©r   r   ©r   s    r   Úget_idÚ_IDCounter.get_id   s(   € Ø�
Š
�a‰�
Ø—+‘+�˜a §
¡
˜|Ð,Ð,r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__© r   r   r
   r
      s   † Ù0òõ-r   r
   c                  ó¼   • [        [        5      R                  S-  n [        [        5      R                  S-  nU R                  SS9nUR                  SS9nU SU 3$ )Nzestimator.cssz
params.csszutf-8)ÚencodingÚ
)r   Ú__file__ÚparentÚ	read_text)Úestimator_css_fileÚparams_css_fileÚestimator_cssÚ
params_csss       r   Ú_get_css_styler,      sb   € Üœh›×.Ñ.°Ñ@ÐÜœ8“n×+Ñ+¨lÑ:€Oà&×0Ñ0¸'Ð0ÐB€MØ ×*Ñ*°GÐ*Ð<€Jàˆ_˜B˜z˜lÐ+Ð+r   zsk-container-idzsk-estimator-idc                   ó4   • \ rS rSrSrSSSSSS.S jrS rSrg)	Ú_VisualBlocké)   a÷  HTML Representation of Estimator

Parameters
----------
kind : {'serial', 'parallel', 'single'}
    kind of HTML block

estimators : list of estimators or `_VisualBlock`s or a single estimator
    If kind != 'single', then `estimators` is a list of
    estimators.
    If kind == 'single', then `estimators` is a single estimator.

names : list of str, default=None
    If kind != 'single', then `names` corresponds to estimators.
    If kind == 'single', then `names` is a single string corresponding to
    the single estimator.

name_details : list of str, str, or None, default=None
    If kind != 'single', then `name_details` corresponds to `names`.
    If kind == 'single', then `name_details` is a single string
    corresponding to the single estimator.

name_caption : str, default=None
    The caption below the name. `None` stands for no caption.
    Only active when kind == 'single'.

doc_link_label : str, default=None
    The label for the documentation link. If provided, the label would be
    "Documentation for {doc_link_label}". Otherwise it will look for `names`.
    Only active when kind == 'single'.

dash_wrapped : bool, default=True
    If true, wrapped HTML element will be wrapped with a dashed border.
    Only active when kind != 'single'.
NT)ÚnamesÚname_detailsÚname_captionÚdoc_link_labelÚdash_wrappedc                ó¼   • Xl         X l        Xpl        XPl        X`l        U R                   S;   a"  Uc  S[        U5      -  nUc  S[        U5      -  nX0l        X@l        g )N)ÚparallelÚserial©N)ÚkindÚ
estimatorsr4   r2   r3   Úlenr0   r1   )r   r9   r:   r0   r1   r2   r3   r4   s           r   r   Ú_VisualBlock.__init__N   s_   € ð Œ	Ø$ŒØ(ÔØ(ÔØ,Ôà�9‰9Ð.Ó.Ø‰}Ø¤# j£/Ñ1�ØÑ#Ø&¬¨Z«Ñ8�àŒ
Ø(Õr   c                 ó   • U $ r8   r!   r   s    r   Ú_sk_visual_block_Ú_VisualBlock._sk_visual_block_h   s   € Øˆr   )r4   r3   r:   r9   r2   r1   r0   )r   r   r   r   r   r   r>   r    r!   r   r   r.   r.   )   s#   † ñ"ðR ØØØØõ)õ4r   r.   c                 ó  • U R                  SU SU SU
 S35        [        R                  " U5      nUGb.  [        R                  " [        U5      5      nU(       a  SOSn[        R                  5       nU	(       a!  SnUb  S	U S
3nO	Ub  S	U S
3nSU
 SU	 SU S3n	Uc  SOS[        R                  " U5       S3nSU SU S3nU	(       d  U(       a  SU	 U S3OSnSU SU
 SU U S3nSU SU SU SU
 S[        R                  " U5       S3nU(       a  SR                  UU S3/5      nO$U(       a  SU;  a  SR                  USU S3/5      nU R                  U5        OU R                  S U S35        U R                  S!5        g)"ay  Write labeled html with or without a dropdown with named details.

Parameters
----------
out : file-like object
    The file to write the HTML representation to.
params: str
    If estimator has `get_params` method, this is the HTML representation
    of the estimator's parameters and their values. When the estimator
    does not have `get_params`, it is an empty string.
name : str
    The label for the estimator. It corresponds either to the estimator class name
    for a simple estimator or in the case of a `Pipeline` and `ColumnTransformer`,
    it corresponds to the name of the step.
name_details : str
    The details to show as content in the dropdown part of the toggleable label. It
    can contain information such as non-default parameters or column information for
    `ColumnTransformer`.
name_caption : str, default=None
    The caption below the name. If `None`, no caption will be created.
doc_link_label : str, default=None
    The label for the documentation link. If provided, the label would be
    "Documentation for {doc_link_label}". Otherwise it will look for `name`.
outer_class : {"sk-label-container", "sk-item"}, default="sk-label-container"
    The CSS class for the outer container.
inner_class : {"sk-label", "sk-estimator"}, default="sk-label"
    The CSS class for the inner container.
checked : bool, default=False
    Whether the dropdown is folded or not. With a single estimator, we intend to
    unfold the content.
doc_link : str, default=""
    The link to the documentation for the estimator. If an empty string, no link is
    added to the diagram. This can be generated for an estimator if it uses the
    `_HTMLDocumentationLinkMixin`.
is_fitted_css_class : {"", "fitted"}
    The CSS class to indicate whether or not the estimator is fitted. The
    empty string means that the estimator is not fitted and "fitted" means that the
    estimator is fitted.
is_fitted_icon : str, default=""
    The HTML representation to show the fitted information in the diagram. An empty
    string means that no information is shown.
param_prefix : str, default=""
    The prefix to prepend to parameter names for nested estimators.
z<div class="z"><div class="Ú z sk-toggleable">NÚcheckedÚ z!<span>Online documentation</span>z<span>Documentation for ú</span>z <a class="sk-estimator-doc-link z)" rel="noreferrer" target="_blank" href="z">?z</a>z<div class="caption">ú</div>z
<div><div>z<div>z<label for="z" class="sk-toggleable__label z sk-toggleable__label-arrow">z</label>z><input class="sk-toggleable__control sk-hidden--visually" id="z" type="checkbox" Ú>z#<div class="sk-toggleable__content z" data-param-prefix="ú">ÚPipelinez<pre>z</pre></div>z<label>ú</div></div>)ÚwriteÚhtmlÚescapeÚstrÚ_ESTIMATOR_ID_COUNTERr   Újoin)ÚoutÚparamsÚnamer1   r2   r3   Úouter_classÚinner_classrB   Údoc_linkÚis_fitted_css_classÚis_fitted_iconÚparam_prefixÚchecked_strÚest_idÚ	doc_labelÚname_caption_divÚ	links_divÚ
label_htmlÚfmt_strs                       r   Ú_write_label_htmlr`   l   s  € ðv ‡I�IØ
�{�mð $Ø�-˜qÐ!4Ð 5Ð5Eð	Gôô �;Š;�tÓ€DØÒÜ—{’{¤3 |Ó#4Ó5ˆÞ#*‘i°ˆÜ&×-Ñ-Ó/ˆæØ;ˆIØÑ)Ø6°~Ð6FÀgÐN‘	ØÑ!Ø6°t°f¸GÐD�	à2Ð3FÐ2Gð H;Ø;C¸*ÀCÈ	À{ÐRVðXð ð Ñ#ñ à(¬¯ª°\Ó)BÐ(CÀ6ÐJð 	ð
 (¨ v¨VÐ4DÐ3EÀVÐLÐö ž>ð �H�:˜nÐ-¨VÑ4àð 	ð ˜6˜(Ð"@ÐATÐ@Uð V+Ø+;Ð*<¸Y¸KÀxðQð 	ð MÈVÈHð UØ*˜m¨1¨Z¨Lð 9-Ø-@Ð,Að B"Ü"&§+¢+¨lÓ";Ð!<¸Bð@ð 	ö Ø—g‘g˜w¨6¨(°&Ð(9Ð:Ó;‰GÞ˜z°Ó5Ø—g‘g˜w¨%°¨~¸\Ð(JÐKÓLˆGà�	‰	�'Õà�	‰	�G˜D˜6 Ð*Ô+Ø‡I�IˆnÕr   c                 ó–  • [        U S5      (       a   U R                  5       $ [        U [        5      (       a  [        SX U S9$ U c  [        SU SSS9$ [        U S5      (       aî  [        U 5      (       dÞ  U R                  SS9R                  5        VVs/ s H@  u  p[        US5      (       d  M  [        US5      (       d  M+  [        U5      (       a  M=  X4PMB     nnnU(       am  [        S	U VVs/ s H  u  pBUPM	     snnU VVs/ s H   u  pU S
UR                  R
                   3PM"     snnU VVs/ s H  u  pB[        U5      PM     snnS9$ [        SU U R                  R
                  [        U 5      S9$ ! [         a,    [        SU U R                  R
                  [        U 5      S9s $ f = fs  snnf s  snnf s  snnf s  snnf )z7Generate information about how to display an estimator.r>   Úsingle)r0   r1   ÚNoneÚ
get_paramsF)ÚdeepÚfitr6   z: )Úhasattrr>   Ú	Exceptionr.   Ú	__class__r   rM   Ú
isinstancer   rd   Úitems)Ú	estimatorÚkeyÚestr:   Ú_s        r   Ú_get_visual_blockrp   ß   s½  € äˆyÐ-×.Ñ.ð	Ø×.Ñ.Ó0Ð0ô �)œS×!Ñ!ÜØ�i¸yñ
ð 	
ð 
Ñ	Ü˜H i°vÈFÑSÐSô ˆy˜,×'Ñ'´¸	×0BÑ0Bð &×0Ñ0°eÐ0Ð<×BÑBÔDô
âD‘�Ü�s˜L×)ó ä.5°c¸5×.Aó äJQÐRUÏ,ó ˆS‹JÙDð 	ñ 
ö
 ÜØÙ#-Ô.¢:™˜“¡:Ò.ÙJTÔUÊ*¹h¸c˜#˜˜b §¡×!7Ñ!7Ð 8Ó9É*ÒUÙ5?Ô@²Z©6¨1œc #žh±ZÒ@ñ	ð ô ØØØ×!Ñ!×*Ñ*Ü˜“^ñ	ð øô= ó 	ÜØØØ×)Ñ)×2Ñ2Ü  ›^ñ	ò ð	üó"
ùó /ùÛUùÛ@s;   “E: ÂF3Â.F3ÃF3ÃF3Ã/F9Ä'F?Ä4GÅ:3F0Æ/F0c                 ó\  • U(       a  [        U5      nOSn[        SS9   [        U5      nSSS5        [        US5      (       a  UR                  5       n	OSn	WR                  S;   Ga´  U=(       d    UR
                  n
U
(       a  SOSnU R                  SU S	35        U(       aU  [        US
5      (       a2  [        US5      (       a!  UR                  SU	5      R                  5       nOSn[        U UUUU	UUUS9  UR                  nU R                  SU S	35        [        UR                  UR                  UR                  5      nU H¿  u  nnnU(       a+  [        US5      (       a  U UR                  S5      S    S3nO4[        US5      (       a!  U(       a  UR                  S5      S    S3OSnOUnUS:X  a  [        U UUUUUS9  Mƒ  U R                  S5        [!        SU/SS9n[        U UUUUUS9  U R                  S5        MÁ     U R                  S5        gUR                  S:X  ao  [        US5      (       a  UR                  U	S9R                  5       nOSn[        U UUR                  UR                  UR"                  UR$                  SSUU	UUUS9  gg! , (       d  f       GNx= f)aò  Write estimator to html in serial, parallel, or by itself (single).

For multiple estimators, this function is called recursively.

Parameters
----------
out : file-like object
    The file to write the HTML representation to.
estimator : estimator object
    The estimator to visualize.
estimator_label : str
    The label for the estimator. It corresponds either to the estimator class name
    for simple estimator or in the case of `Pipeline` and `ColumnTransformer`, it
    corresponds to the name of the step.
estimator_label_details : str
    The details to show as content in the dropdown part of the toggleable label.
    It can contain information as non-default parameters or column information for
    `ColumnTransformer`.
is_fitted_css_class : {"", "fitted"}
    The CSS class to indicate whether or not the estimator is fitted or not. The
    empty string means that the estimator is not fitted and "fitted" means that the
    estimator is fitted.
is_fitted_icon : str, default=""
    The HTML representation to show the fitted information in the diagram. An empty
    string means that no information is shown. If the estimator to be shown is not
    the first estimator (i.e. `first_call=False`), `is_fitted_icon` is always an
    empty string.
first_call : bool, default=False
    Whether this is the first time this function is called.
param_prefix : str, default=""
    The prefix to prepend to parameter names for nested estimators.
    For example, in a pipeline this might be "pipeline__stepname__".
rC   T)Úprint_changed_onlyNÚ_get_doc_link)r7   r6   z sk-dashed-wrappedz<div class="sk-itemrG   rd   Ú_get_params_htmlF)rU   rV   rW   rX   z<div class="sk-ÚsplitÚ:r   Ú__r7   )rV   rX   z<div class="sk-parallel-item">)r4   rE   rI   rb   )rU   zsk-itemzsk-estimator)rS   rT   rB   rU   rV   rW   rX   )rp   r   rg   rs   r9   r4   rJ   rt   Ú_repr_html_innerr`   Úzipr:   r0   r1   ru   Ú_write_estimator_htmlr.   r2   r3   )rP   rl   Úestimator_labelÚestimator_label_detailsrV   rW   Ú
first_callrX   Ú	est_blockrU   Údashed_wrappedÚdash_clsrQ   r9   Ú	est_infosrn   rR   r1   Ú
new_prefixÚserial_blocks                       r   rz   rz   
  s§  € öV Ü% iÓ0‰	àˆÜ¨tÓ4Ü)¨)Ó4ˆI÷ 5ô ˆy˜/×*Ñ*Ø×*Ñ*Ó,‰àˆØ‡~�~Ð/Ô/Ø#×= y×'=Ñ'=ˆÞ+9Ñ'¸rˆØ�	‰	Ð'¨ z°Ð4Ô5æÜ�y ,×/Ñ/´GØÐ-÷5ñ 5ð #×3Ñ3°E¸8ÓD×UÑUÓW‘à�äØØØØ'Ø!Ø$7Ø-Ø)ò	ð �~‰~ˆØ�	‰	�O D 6¨Ð,Ô-Ü˜	×,Ñ,¨i¯o©o¸y×?UÑ?UÓVˆ	ã'0Ñ#ˆC��|ö ¤¨¨g× 6Ñ 6à ,˜~¨d¯j©j¸«o¸aÑ.@Ð-AÀÐD‘
Ü˜˜w×'Ñ'æ:> §
¡
¨3£°Ñ 2Ð3°2Ñ6ÀB‘
à)�
à�xÓÜ%ØØØØ Ø(;Ø!+ôð —	‘	Ð:Ô;ä+¨H°s°eÈ%ÑP�Ü%ØØ ØØ Ø(;Ø!+òð —	‘	˜(Ö#ñC (1ðF 	�	‰	�.Õ!Ø	�‰˜8Ó	#Ü�9Ð0×1Ñ1Ø×/Ñ/¸Ð/ÐB×SÑSÓU‰FàˆFäØØØ�O‰OØ×"Ñ"Ø×"Ñ"Ø×$Ñ$Ø!Ø&ØØØ 3Ø)Ø%ó	
ð 
$÷O 5Ö4ús   ŸJÊ
J+c                 ó&  • SSK Jn  SSKJn  [	        U S5      (       d  SnSnO U" U 5        SnSnS	U S
U S3n[        [        5       5       n[        R                  5       n[        [        5      nUR                  US9n	[        U 5      n
SnSU	 SU S[        R                  " U
5       SU S3	nUR                  U5        [!        UU U R"                  R$                  U
SUUS9  ['        [        [)        [*        5      R,                  S-  5      S5       nUR/                  5       nSSS5        SW SU S3nUR                  U5        UR1                  5       nUsSSS5        $ ! U a    SnSn GN=f = f! , (       d  f       NT= f! , (       d  f       g= f)aç  Build a HTML representation of an estimator.

Read more in the :ref:`User Guide <visualizing_composite_estimators>`.

Parameters
----------
estimator : estimator object
    The estimator to visualize.

Returns
-------
html: str
    HTML representation of estimator.

Examples
--------
>>> from sklearn.utils._repr_html.estimator import estimator_html_repr
>>> from sklearn.linear_model import LogisticRegression
>>> estimator_html_repr(LogisticRegression())
'<style>#sk-container-id...'
r   )ÚNotFittedError)Úcheck_is_fittedrf   z<span>Not fitted</span>rC   z<span>Fitted</span>Úfittedz#<span class="sk-estimator-doc-link z">irD   )ÚidzÕIn a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.z<style>z</style><body><div id="zC" class="sk-top-container"><div class="sk-text-repr-fallback"><pre>z	</pre><b>z+</b></div><div class="sk-container" hidden>T)r}   rV   rW   zestimator.jsÚrNz</div></div><script>z
forceTheme('z');</script></body>)Úsklearn.exceptionsr…   Úsklearn.utils.validationr†   rg   r   r   Ú_CONTAINER_ID_COUNTERr   r   Ú
_CSS_STYLEÚ
substituterM   rK   rL   rJ   rz   ri   r   Úopenr   r%   r&   ÚreadÚgetvalue)rl   r…   r†   Ústatus_labelrV   rW   rP   Úcontainer_idÚstyle_templateÚstyle_with_idÚestimator_strÚfallback_msgÚhtml_templateÚfÚscriptÚhtml_endÚhtml_outputs                    r   Úestimator_html_reprr�   —  sÂ  € õ, 2Ý8ä�9˜e×$Ñ$Ø0ˆØ Ñð	%Ù˜IÔ&Ø0ˆLØ"*Ðð .Ð.AÐ-Bð CØˆ>˜ð	"ð ô 
”“Ô	 Ü,×3Ñ3Ó5ˆÜ!¤*Ó-ˆØ&×1Ñ1°\Ð1ÐBˆÜ˜I›ˆð"ð 	ð �m�_ð %à$�~ð &ä—K’K Ó.Ð/¨y¸¸ð G0ð	0ð 	ð 	�	‰	�-Ô ÜØØØ×Ñ×(Ñ(ØØØ 3Ø)ò	
ô ”#”dœ8“n×+Ñ+¨nÑ<Ó=¸sÔCÀqØ—V‘V“XˆF÷ Dð # 6 (Ø˜\˜NÐ*=ð?ð 	ð
 	�	‰	�(Ôà—l‘l“nˆØ÷i 
Ñ	øð ó 	%Ø4ˆLØ"$Óð	%ú÷b DÕCú÷S 
Õ	ús6   ¤E  ÁCFÄE1Ä#3FÅ 
E.Å-E.Å1
E?	Å;FÆ
F)	NNzsk-label-containerzsk-labelFrC   rC   rC   rC   )rC   FrC   )rK   Ú
contextlibr   Úinspectr   Úior   Úpathlibr   Ústringr   Úsklearnr   r
   r,   rŒ   rN   r�   r.   r`   rp   rz   r�   r!   r   r   Ú<module>r¤      sœ   ðó Ý Ý Ý Ý Ý å "÷	-ñ 	-ò,ñ #Ð#4Ó5Ð Ù"Ð#4Ó5Ð ÙÓ€
÷@ñ @ðP ØØ$ØØØØØØôpòf(ðb ØØôJ
óZ]r   