
    -i                     d   S SK r S SKJr  S SKJr  S SKrS SKJrJr  S SK	J
r
JrJr  \R                  " S5      rS rS rS S	 jrS!S
\\   S\4S jjr\R(                  R+                  S\" 5       5      S 5       r\R(                  R+                  S\" 5       5      S 5       r\S:X  Ga
  S SKrS SKr\R6                  " SS9r\R;                  SSS9  \R=                  5       r\RA                  \RB                  5      r"\RB                  RG                  S5      r$\%" \$5      S:  a!  \ RL                  " S\$S   5      (       a  \$S   r'OSr'\(" \" \"S   \'5      5      \"S'   \"S   (       a,  \" \"\RB                  S9r)\*" \)5        \RV                  " S5        g\*" SRY                  \RB                  5      5        gg)"    N)	signature)Optional)enable_halving_search_cvenable_iterative_imputer)all_displaysall_estimatorsall_functionsznumpydoc.validatec               #     #    [        5       n [        5       nX-    H  u  p#UR                  S5      (       a  M  / n[        U5       H_  nUR                  S5      (       a  M  [	        X25      n[        US5      (       d  [        U[        5      (       d  MN  UR                  U5        Ma     UR                  S 5        [        U[        S9 H  nX64v   M
     M     g 7f)N___call__)key)r   r   
startswithdirgetattrhasattr
isinstancepropertyappendsortedstr)
estimatorsdisplaysnameKlassmethods
method_objmethods          P/var/www/html/venv/lib/python3.13/site-packages/sklearn/tests/test_docstrings.pyget_all_methodsr      s     !J~H!,??3JDs## -Jz:..*Z2R2Rt$  	tW#.F- / -s   BCACc               #      #    [        5       n U  H4  u  pSUR                  ;  d  M  UR                   SUR                   3v   M6     g 7f)Nzutils.fixes.)r	   
__module____name__)	functionsr   funcs      r   get_all_functions_namesr&   %   s>     I/__%Qt}}o66 s
    A"Ac              #      #    U  HK  u  p4US;   a  M  US;   a(  Ub%  Ub"  [        X!5      n[        U[        5      (       a  M;  Ub  US;   a  MF  X44v   MM     g7f)zY
Ignore some errors based on the method type.

These rules are specific for scikit-learn.)RT02GL01GL02)PR02GL08N)EX01SA01ES01)r   r   r   )errorsr   r   codemessager   s         r   filter_errorsr3   -   sl     
   ++ ##(9f>P /J*h// $*B"BmK  s   AAr   returnc                 z   Uc(  [        US5      (       a  SnOUc  [        S5      e[        eUb3  [        X5      n [	        [        U5      5      nUR                  S-   U-   nOSnUnSSR                  [	        U S   5      XT-   U S   S	S
R                  S U S    5       5      /5      -   nU$ ! [         a    Sn Njf = f)aJ  Pretty print original docstring and the obtained errors

Parameters
----------
res : dict
    result of numpydoc.validate.validate
Klass : {Estimator, Display, None}
    estimator object or None
method : str
    if estimator is not None, either the method name or None.

Returns
-------
str
   String representation of the error.
__init__z0At least one of Klass, method should be providedzM
Parsing of the method signature failed, possibly because this is a property.r!    z

file	docstringz# Errors
c              3   H   #    U  H  u  pS R                  X5      v   M     g7f)z	 - {}: {}N)format).0r1   r2   s      r   	<genexpr>repr_errors.<locals>.<genexpr>   s#      GTmd""411}s    "r0   )	r   
ValueErrorNotImplementedErrorr   r   r   	TypeErrorr#   join)resr   r   objobj_signatureobj_namemsgs          r   repr_errorsrI   Z   s    " ~5*%%F]OPP%%e$		#/M >>C'&0
6;;F$II GJ8} 	

 
C J/  	7 	s   B+ +B:9B:function_namec                     [         R                  U 5      n[        [        US   SS95      US'   US   (       a  [	        USU  3S9n[        U5      eg)z)Check function docstrings using numpydoc.r0   functionr   zTested function: N)numpydoc_validationvalidatelistr3   rI   r@   )rJ   requestrD   rH   s       r   test_function_docstringrR      sW     
&
&}
5Cs8}ZHICM
8}#(9-&IJo     zKlass, methodc                    U R                   nX0R                  /nUb  UR                  U5        SR                  U5      n[        R                  U5      n[        [        US   XS95      US'   US   (       a  [        XPU5      n[        U5      eg )Nr!   r0   )r   )
r"   r#   r   rC   rN   rO   rP   r3   rI   r@   )r   r   rQ   base_import_pathimport_pathrD   rH   s          r   test_docstringrW      s    ''#^^4K6"((;'K

&
&{
3Cs8}fJKCM
8}#f-o rS   __main__z!Validate docstring with numpydoc.)descriptionrV   zImport path to validate)helpr!      z(?:[A-Z][a-z]*)+r0   rM      z#All docstring checks passed for {}!)N)NN)-reinspectr   typingr   pytestsklearn.experimentalr   r   sklearn.utils.discoveryr   r   r	   importorskiprN   r   r&   r3   r   rI   markparametrizerR   rW   r#   argparsesysArgumentParserparseradd_argument
parse_argsargsrO   rV   rD   splitimport_path_sectionslenmatchr   rP   rH   printexitr<    rS   r   <module>rv      s   	    P O))*=>  (7*Z4# 4# 4n *A*CD	 E	 /*;< =$ z$$1TUF
,EFD

&
&t'7'7
8C++11#6
  A%"((1"5+ + &b)s8}f=>CM
8}#d&6&67c
3::4;K;KLM? rS   