ó
    Ñ]j‰  ã                   óš   • S SK r S SKrS SKr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 rS r\S	 5       rS
 r " S S\\5      rg)é    N)ÚUserDict)Ú	lru_cache)Úquote)Ú	docscrape)ÚReprHTMLMixinc                 óÊ   • U R                   n[        R                  " U S3U=(       d    S5      nUc  gUR                  S5      n[	        U5       S[	        U5       3nU SU 3$ )z—URL to the relevant section of the docstring using a Text Fragment

https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Fragment/Text_fragments
z	 : (.+)\nÚ Né   z,-z	#:~:text=)Ú__doc__ÚreÚsearchÚgroupr   )Úestimator_classÚ
param_nameÚdoc_linkÚ	docstringÚmÚ
param_typeÚtext_fragments          Ú\/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sklearn/utils/_repr_html/params.pyÚ_generate_link_to_param_docr      sp   € ð
  ×'Ñ'€Iä
�	Š	�Z�L 
Ð+¨Y¯_¸"Ó=€Aà�yð ð —‘˜“€JÜ˜ZÓ(Ð)¨¬E°*Ó,=Ð+>Ð?€MàˆZ�y  Ð0Ð0ó    c                 óè   • [         R                  " U 5      n [        R                  " 5       nSUl        SUl        SUl        [         R                  " UR                  U5      5      nX;   a  SOSnXPUS.$ )z–Categorizes parameters as 'default' or 'user-set' and formats their values.
Escapes or truncates parameter values for display safety and readability.
é   r
   é2   zuser-setÚdefault)r   r   Úparam_value)ÚhtmlÚescapeÚreprlibÚReprÚmaxlistÚmaxtupleÚ	maxstringÚrepr)ÚnameÚvalueÚnon_default_paramsÚrÚcleaned_valuer   s         r   Ú_read_paramsr+   &   s_   € ô �;Š;�tÓ€DÜ�Š‹€AØ€A„IØ€A„JØ€A„KÜ—K’K §¡ u£Ó.€Mà#Ó9‘¸y€Jà$ÈÑWÐWr   c                 ó.   • [         R                  " U 5      $ ©N)r   ÚNumpyDocString)r   s    r   Ú_scrape_estimator_docstringr/   6   s   € ä×#Ò# IÓ.Ð.r   c           	      óö  • SnSnSn[         R                  " U R                  5      nU(       a3  [        U5      =n(       a!  US    Vs0 s H  nUR                  U_M     nnO0 n/ nU  Hí  n	[        X�U	   U R                  5      n
[        U R                  X�R                  5      nUR                  U	S5      =n(       a8  UR                   SUR                   SSR                  UR                  5       3nOSnU R                  (       a#  U(       a  U(       a  UR                  UU
S	   US
9nOU
S	   nUR                  UR                  " S0 U
DSU0D65        Mï     UR                  SR                  U5      S9$ s  snf )zðGenerate HTML representation of estimator parameters.

Creates an HTML table with parameter names and values, wrapped in a
collapsible details element. Parameters are styled differently based
on whether they are default or user-set values.
a/  
        <div class="estimator-table">
            <details>
                <summary>Parameters</summary>
                <table class="parameters-table">
                  <tbody>
                    {rows}
                  </tbody>
                </table>
            </details>
        </div>
    aW  
        <tr class="{param_type}">
            <td><i class="copy-paste-icon"
                 onclick="copyToClipboard('{param_name}',
                          this.parentElement.nextElementSibling)"
            ></i></td>
            <td class="param">{param_display}</td>
            <td class="value">{param_value}</td>
        </tr>
    zÔ
        <a class="param-doc-link"
            rel="noreferrer" target="_blank" href="{link}">
            {param_name}
            <span class="param-doc-description">{param_description}</span>
        </a>
    Ú
ParametersNz: z<br><br>z<br>r   )Úlinkr   Úparam_descriptionÚparam_displayÚ
)Úrows© )ÚinspectÚgetdocr   r/   r&   r+   Únon_defaultr   r   ÚgetÚtypeÚjoinÚdescÚformatÚappend)ÚparamsÚPARAMS_TABLE_TEMPLATEÚPARAM_ROW_TEMPLATEÚ!PARAM_AVAILABLE_DOC_LINK_TEMPLATEÚestimator_class_docsÚstructured_docstringÚparam_docstringÚ	param_mapr6   ÚrowÚparamr2   Úparam_numpydocr3   r4   s                  r   Ú_params_html_reprrL   ;   s“  € ðÐð	Ðð)Ð%ô #Ÿ>š>¨&×*@Ñ*@ÓAÐÞÜ ;Ð<PÓ QÐQÐÕQð $8¸Ò#Eó
â#E�ð × Ñ  /Ò1Ù#Eð 	ð 
ˆ	ð
 ˆ	Ø€DÛˆÜ˜S¨¡+¨v×/AÑ/AÓBˆÜ*¨6×+AÑ+AÀ3ÏÉÓXˆØ&Ÿ]™]¨3°Ó5Ð5ˆ>Õ5à!×&Ñ&Ð' r¨.×*=Ñ*=Ð)>¸hØ—;‘;˜~×2Ñ2Ó3Ð4ð6ñ ð
 !%Ðà�?�?žtÖ(9à=×DÑDØØ  Ñ.Ø"3ð Eð ‰Mð " ,Ñ/ˆMà�‰Ð&×-Ò-ÑS°ÑSÀ]ÒSÖTñ- ð0 !×'Ñ'¨T¯Y©Y°t«_Ð'Ð=Ð=ùò?
s   ÁE6c                   óH   ^ • \ rS rSrSr\rS\" 5       SSS.U 4S jjrSr	U =r
$ )Ú
ParamsDicté‡   a  Dictionary-like class to store and provide an HTML representation.

It builds an HTML structure to be used with Jupyter notebooks or similar
environments. It allows storing metadata to track non-default parameters.

Parameters
----------
params : dict, default=None
    The original dictionary of parameters and their values.

non_default : tuple, default=(,)
    The list of non-default parameters.

estimator_class : type, default=None
    The class of the estimator. It allows to find the online documentation
    link for each parameter.

doc_link : str, default=""
    The base URL to the online documentation for the estimator class.
    Used to generate parameter-specific documentation links in the HTML
    representation. If empty, documentation links will not be generated.
Nr	   )rA   r:   r   r   c                óZ   >• [         TU ]  U=(       d    0 5        X l        X0l        X@l        g r-   )ÚsuperÚ__init__r:   r   r   )ÚselfrA   r:   r   r   Ú	__class__s        €r   rR   ÚParamsDict.__init__¡   s'   ø€ ô 	‰Ñ˜Ÿ 2Ô&Ø&ÔØ.ÔØ �r   )r   r   r:   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   rL   Ú
_html_reprÚtuplerR   Ú__static_attributes__Ú__classcell__)rT   s   @r   rN   rN   ‡   s'   ø† ñð. #€Jð ©%«'À4ÐRT÷!ö !r   rN   )r   r8   r   r    Úcollectionsr   Ú	functoolsr   Úurllib.parser   Úsklearn.externals._numpydocr   Úsklearn.utils._repr_html.baser   r   r+   r/   rL   rN   r7   r   r   Ú<module>rc      sV   ðó Û Û 	Û Ý  Ý Ý å 1Ý 7ò1ò,Xð  ñ/ó ð/òI>ôX !� õ  !r   