
    0Ph5_                     *   d dl mZmZ d dlZd dlZd dlmZ d dlm	Z	m
Z
 d dlmZmZ d dlmZ d dlmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* d d	l+m,Z,  e*egegegegd
d          d|d dd            Z- G d d          Z. G d de          Z/ej0        1                    deeg          d             Z2ej0        1                    deeg          d             Z3d Z4ej0        1                    d eed dd           eeddd          g          d             Z5ej0        1                    dedddd e6d!fedd"d#d e6d$fedd dd e7d%fed dd&d e7d'fedd(dd e7d)fg          d*             Z8d+ Z9d, Z:ej0        1                    d-e;d.fed.fed/fej<        d0fg          d1             Z=d2 Z>ej0        1                    d3 eedd d           eed dd           eeddd#           eh d4           e             ed5           e&             ed6           e              e            g
          d7             Z?ej0        1                    d8 eedd9d&           eed:d;d          f eedd9d&           eed:d;d#          f eedd9d&           eed<d;d          f eedd9d&           eed;dd          f eedd9d&           eed<dd#          f eed9dd           eed:d;d          f eed9dd           eed:d;d#          f eed9dd           eeddd          f eed9dd           eedd:d          f eed9dd           eedd=d#          f eed:d;d           eeddd&          f eed:d;d           eeddd          f eed:d;d           eed>d=d#          f eed:d;d           eed>d=d&          f eed:d;d#           eed?d@d#          f eed:d;d#           eed?d@d          f eeddd           eed dd          f eeddd           eed dd          fg          dA             Z@ej0        1                    d3 e             eeA           e             e"             e$             e%             e             eeddd#          g          dB             ZBej0        1                    d3 e             e             eeA           e"             e$             e%             e             e&             e             ed5           eh d4           eeh dC           eeddd#           eed d@d#           eed dd#           eedd d#           eed dd#           eed dd           eedd d&           ed6           e              e            g          dD             ZCej0        1                    dE eed dd          dFf eed dd#          dGf eh d4          dHf eeDejE        ejF        h          ejF        feGdI fdJdKddgd9d<ggfdK ejH        ddgd9d<gg          fdL eddgd9d<gg          fg	dM e,D             dNdOejI        J                    d           fdPe. e.            fe;dfedQfdRdSdTejK        f e            d(f e            dUf e            ddVz  f e            df e             eLdT          f e            ejK        f e            dWf ed6           e/d X          fdY          dZ             ZMej0        1                    d[ eed dd          ef ed\d]h          ef eedFd^h          efdKefdLe%fdOe$fde"feGefe;efd_efd`e&f ed5          ef ed6          efdaefdTe!fg          db             ZNdc ZOdd ZPde ZQdf ZRdg ZSdh ZTdi ZUdj ZVdk ZWdl ZXdm ZYdn ZZdo Z[dp Z\dq Z]dr Z^ds Z_dt Z`du Zaej0        1                    dvddwg          dx             Zbej0        1                    dyg dz          d{             ZcdS )}    )IntegralRealN)
csr_matrix)config_context
get_config)BaseEstimator_fit_context)LeaveOneOut
deprecated)
HasMethodsHiddenIntervalInvalidParameterErrorMissingValuesOptions
RealNotInt
StrOptions_ArrayLikes	_Booleans
_Callables
_CVObjects_InstancesOf_IterablesNotString_NanConstraint_NoneConstraint_PandasNAConstraint_RandomStates_SparseMatrices_VerboseHelpergenerate_invalid_param_valgenerate_valid_parammake_constraintvalidate_params)CSR_CONTAINERS)abcdTprefer_skip_nested_validation)r)   c                    dS )z/A function to test the validation of functions.N )r&   r'   r(   r)   argskwargss         i/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sklearn/utils/tests/test_param_validation.py_funcr1   )             c                       e Zd ZdZ edegid          d             Z e             edegid          d                         ZdS )_ClasszJA class to test the _InstancesOf constraint and the validation of methods.r&   Tr*   c                     dS )zA validated methodNr-   selfr&   s     r0   _methodz_Class._method4   r2   r3   c                     dS )zA deprecated validated methodNr-   r7   s     r0   _deprecated_methodz_Class._deprecated_method8   r2   r3   N)	__name__
__module____qualname____doc__r$   r   r9   r   r;   r-   r3   r0   r5   r5   1   s        TT_cD6]$GGG! ! HG! Z\\_cD6]$GGG, , HG \, , ,r3   r5   c                   Z    e Zd ZU dZdegiZeed<   d Z e	d          d	d            Z
dS )

_Estimatorz<An estimator to test the validation of estimator parameters.r&   _parameter_constraintsc                     || _         d S Nr&   r7   s     r0   __init__z_Estimator.__init__C   s    r3   Tr*   Nc                     d S rD   r-   )r8   Xys      r0   fitz_Estimator.fitF       r3   NN)r<   r=   r>   r?   r   rB   dict__annotations__rF   r	   rJ   r-   r3   r0   rA   rA   >   sp         FF$'$=D000   \555   65  r3   rA   interval_typec                     t          | ddd          }d|v sJ d|vsJ t          | ddd          }d|vsJ d|v sJ t          | ddd          }d|v sJ d|v sJ t          | ddd          }d|vsJ d|vsJ dS )	z.Check the range of values depending on closed.   leftclosedrightbothneitherN)r   rO   intervals     r0   test_interval_ranger[   K   s     r1V<<<H>>>>Hr1W===HX====r1V<<<H>>>>====r1Y???HXHr3   c                 b   t          | ddd          }ddz  |vsJ ddz  |vsJ t          ddz            |vsJ t          ddz            |vsJ t          | dddz  d          }ddz  |v sJ ddz  |vsJ t          ddz            |v sJ t          ddz            |vsJ ddz  |vsJ dS )	zbCheck that Interval constraint work with large integers.

    non-regression test for #26648.
    r   rR   rX   rT   A      i   N)r   floatrY   s     r0   test_interval_large_integersr`   _   s    q!I>>>Hb5    c6!!!!B<<x''''C==((((q!S&CCCHb5Hc6!!!!B<<8####C==((((d7(""""""r3   c                     t          t          ddd          } t          j        | v sJ t          t          ddd          } t          j         | v sJ t          t          ddd          } t          j        | vsJ t          j         | vsJ dS )zjCheck that inf is included iff a bound is closed and set to None.

    Only valid for real intervals.
    r   NrV   rT   rS   rX   )r   r   npinfrZ   s    r0   test_interval_inf_in_boundsre   t   s    
 ag666H6XdAf555HF7hdD;;;H6!!!!F7(""""""r3   rZ      rS   rT   rW   c                 &    t           j        | vsJ dS )z)Check that np.nan is not in any interval.N)rb   nanrd   s    r0   test_nan_not_in_intervalri      s     6!!!!!!r3   zparams, error, match      ?rR   )typerS   rV   rU   z=Expecting left to be an int for an interval over the integersg       @rX   z>Expecting right to be an int for an interval over the integersz&left can't be None when closed == leftrV   z(right can't be None when closed == rightzright can't be less than leftc                 |    t          j        ||          5  t          di |  ddd           dS # 1 swxY w Y   dS )zNCheck that informative errors are raised for invalid combination of parametersmatchNr-   )pytestraisesr   )paramserrorro   s      r0   test_interval_errorsrt      s    @ 
uE	*	*	*  6                 s   155c                      t          h ddh          } |                     d          sJ |                     d          sJ |                     d          rJ dt          |           v sJ dS )z*Sanity check for the StrOptions constraint>   r&   r'   r(   r(   r   r&   r)   z'c' (deprecated)N)r   is_satisfied_bystroptionss    r0   test_stroptionsrz      s    cU;;;G""3'''''""3'''''&&s+++++W------r3   c                     t          t          ddt          j        hdh          } |                     d          sJ |                     t          j                  sJ |                     d          rJ dt          |           v sJ dS )z'Sanity check for the Options constraintg            ?r   Gz?z-0.5 (deprecated)N)r   r   rb   rc   rv   rw   rx   s    r0   test_optionsr~      s    dT3/TFCCCG""4(((((""26*****&&t,,,,,#g,,......r3   ztype, expected_type_nameintr_   znumpy.ndarrayc                 V    t          |           }t          |          d| dk    sJ dS )z?Check the string representation of the _InstancesOf constraint.zan instance of ''N)r   rw   )rk   expected_type_name
constraints      r0   %test_instances_of_type_human_readabler      s;     d##Jz??F1CFFFFFFFFFr3   c                     t          ddg          }  G d d          } G d d          }|                      |                      sJ |                      |                      rJ t          |           dk    sJ dS )	z Check the HasMethods constraint.r&   r'   c                       e Zd Zd Zd ZdS )test_hasmethods.<locals>._Goodc                     d S rD   r-   r8   s    r0   r&   z test_hasmethods.<locals>._Good.a       Dr3   c                     d S rD   r-   r   s    r0   r'   z test_hasmethods.<locals>._Good.b   r   r3   N)r<   r=   r>   r&   r'   r-   r3   r0   _Goodr      s2        	 	 		 	 	 	 	r3   r   c                       e Zd Zd ZdS )test_hasmethods.<locals>._Badc                     d S rD   r-   r   s    r0   r&   ztest_hasmethods.<locals>._Bad.a   r   r3   N)r<   r=   r>   r&   r-   r3   r0   _Badr      s#        	 	 	 	 	r3   r   z"an object implementing 'a' and 'b'N)r   rv   rw   )r   r   r   s      r0   test_hasmethodsr      s    S#J''J               %%eegg.....))$$&&11111z??BBBBBBBr3   r   >   r&   r'   r(   )numeric_onlyrJ   c                 R    t          |           }|                     |          rJ dS )z>Check that the value generated does not satisfy the constraintNr!   rv   )r   	bad_values     r0   test_generate_invalid_param_valr      s1    " +:66I)))4444444r3   zinteger_interval, real_interval         i   
   c                     t          |          }|                    |          rJ |                     |          rJ t          |           }|                    |          rJ |                     |          rJ dS )ztCheck that the value generated for an interval constraint does not satisfy any of
    the interval constraints.
    r   Nr   )integer_intervalreal_intervalr   s      r0   +test_generate_invalid_param_val_2_intervalsr      s    b +mDDDI,,Y77777//	:::::*6FGGGI,,Y77777//	:::::::r3   c                     t          j        t                    5  t          |            ddd           dS # 1 swxY w Y   dS )zmCheck that the function raises NotImplementedError when there's no invalid value
    for the constraint.
    N)rp   rq   NotImplementedErrorr!   r   s    r0   )test_generate_invalid_param_val_all_validr   W  s    " 
*	+	+ / /":.../ / / / / / / / / / / / / / / / / /s   7;;>   rf   rR   r   c                 R    t          |           }|                     |          sJ dS )z;Check that the value generated does satisfy the constraint.N)r"   rv   )r   values     r0   test_generate_valid_paramr   l  s1    : !,,E%%e,,,,,,,r3   zconstraint_declaration, valuegzG?*   r'   c                     | dz   S )Nrf   r-   )xs    r0   <lambda>r     s
    QU r3   rL   z
array-likesparse matrixc                 4    g | ]}d  |ddgddgg          fS )r   rf   rR   r   r   r-   ).0	containers     r0   
<listcomp>r     sD     

 

 

 ii!Q!Q(899:

 

 

r3   )random_stater   r   )r   Nr|   )booleanF)verboserf   rh   g      i  missingrE   )	cv_objectr   c                 R    t          |           }|                    |          sJ dS )z+Sanity check for the is_satisfied_by methodN)r#   rv   )constraint_declarationr   r   s      r0   test_is_satisfied_byr     s3    L !!788J%%e,,,,,,,r3   z1constraint_declaration, expected_constraint_classoption1option2r}   r   r   r   c                 :    t          |           }|j        |u sJ dS )zICheck that make_constraint dispatches to the appropriate constraint classN)r#   	__class__)r   expected_constraint_classr   s      r0   test_make_constraintr     s-    , !!788J#<<<<<<<r3   c                      t          j        t          d          5  t          d           ddd           dS # 1 swxY w Y   dS )zNCheck that an informative error is raised when an unknown constraint is passedzUnknown constraintrn   znot a valid constraintN)rp   rq   
ValueErrorr#   r-   r3   r0   test_make_constraint_unknownr     s    	z)=	>	>	> 2 201112 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2s   9= =c                  B   t          j        t          d          5  t          dd           ddd           n# 1 swxY w Y   t          j        t          d          5  t          ddgddi ddd           n# 1 swxY w Y   t          j        t          d	          5  t          di ddi ddd           n# 1 swxY w Y   t          j        t          d
          5  t          ddd           ddd           n# 1 swxY w Y   t          j        t          d          5  t          dgg dR ddiddi ddd           n# 1 swxY w Y   t          j        t          d	          5  t          dgg dR ddiddi ddd           dS # 1 swxY w Y   dS )zGCheck that validate_params works no matter how the arguments are passedz"The 'a' parameter of _func must bern   wrongrf   r(   Nz"The 'b' parameter of _func must ber(   "The 'c' parameter of _func must bez"The 'd' parameter of _func must be)r(   r)   r   )r   rR   r   r   er   rf   rR   r   four)rf   )rp   rq   r   r1   r-   r3   r0   test_validate_paramsr     s   	%I
 
 
   	g              
 
%I
 
 
 " " 	7|!q!!!" " " " " " " " " " " " " " "
 
%I
 
 
 # # 	""C>"""# # # # # # # # # # # # # # #
 
%I
 
 
 ! ! 	a1    ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 
%I
 
 
 4 4 	a3///333Q33(3334 4 4 4 4 4 4 4 4 4 4 4 4 4 4
 
%I
 
 
 3 3 	a2)))222v2#q2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3sg   :>> A;;A?A?!B<<C C "DDD'E

EE0FFFc                  b    t          dt          gid          d             }  | dd           dS )zTCheck that no error is raised when there are parameters without
    constraints
    r&   Tr*   c                     d S rD   r-   )r&   r'   s     r0   funcz1test_validate_params_missing_params.<locals>.func  rK   r3   rf   rR   N)r$   r   )r   s    r0   #test_validate_params_missing_paramsr     sG    
 cC5\FFF  GF 	DAJJJJJr3   c                      t                      t                    } t          j        t          d          5   | ddd           ddd           n# 1 swxY w Y   t          j        t          d          5  t          j        t          d          5   | ddd	           ddd           n# 1 swxY w Y   ddd           dS # 1 swxY w Y   dS )
z5Check that validate_params functions can be decoratedzFunction _func is deprecatedrn   rf   rR   r   r   Nr   r   )r   r1   rp   warnsFutureWarningrq   r   )decorated_functions    r0    test_decorate_validated_functionr     s   %e,,	m+I	J	J	J & &1a1%%%%& & & & & & & & & & & & & & & 
m+I	J	J	J 0 0]!)N
 
 
 	0 	0 q!w////	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0sG   AAA9CB0$C0B4	4C7B4	8CCCc                     t          j        t          d          5  t                                          d           ddd           n# 1 swxY w Y   t          j        t          d          5  t          j        t          d          5  t                                          d           ddd           n# 1 swxY w Y   ddd           dS # 1 swxY w Y   dS )z-Check that validate_params works with methodsz+The 'a' parameter of _Class._method must bern   r   Nz)Function _deprecated_method is deprecatedz6The 'a' parameter of _Class._deprecated_method must be)rp   rq   r   r5   r9   r   r   r;   r-   r3   r0   test_validate_params_methodr     s   	%R
 
 
 " " 	!!!" " " " " " " " " " " " " " " 
m+V	W	W	W 1 1]!J
 
 
 	1 	1 HH''000		1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1sG   "A

AA0C"B:.C:B>	>CB>	CCCc                      t          d          } t          j        t          d          5  |                                  ddd           dS # 1 swxY w Y   dS )z9Check that validate_params works with Estimator instancesr   z'The 'a' parameter of _Estimator must bern   N)rA   rp   rq   r   rJ   )ests    r0   test_validate_params_estimatorr   $  s     W

C	%N
 
 
   				                 s   AAAc                      t          j        t          d          5  t          h dddh           ddd           dS # 1 swxY w Y   dS )z@Check that the deprecated parameter must be a subset of options.z#deprecated options must be a subsetrn   >   r&   r'   r(   r&   r)   r   N)rp   rq   r   r   r-   r3   r0   !test_stroptions_deprecated_subsetr   /  s    	z)N	O	O	O ; ;???Sz::::; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;s   ?AAc                  f   t          dt          t                    t          gid          d             }  | dddd            | g d	           t	          j        t          d
          5 } | d           ddd           n# 1 swxY w Y   t          |j                  }d|v sJ d|vsJ dS )zECheck that internal constraints are not exposed in the error message.paramTr*   c                     d S rD   r-   r   s    r0   fz!test_hidden_constraint.<locals>.f8  s	     	r3   rf   rR   r   )r&   r'   r(   r   The 'param' parameterrn   badr   Nzan instance of 'dict'zan instance of 'list')	r$   r   listrM   rp   rq   r   rw   r   r   exc_infoerr_msgs      r0   test_hidden_constraintr   5  s)    	6$<<&'t     AAAAAiiiLLL	%<
 
 
 		               (.!!G"g----"'111111s   -BB
B
c            	      ~   t          dt          dh          t          t          dh                    gid          d             }  | d            | d           t          j        t
          d          5 } | d	
           ddd           n# 1 swxY w Y   t          |j                  }d|v sJ d|vsJ dS )zBCheck that we can have 2 StrOptions constraints, one being hidden.r   autowarnTr*   c                     d S rD   r-   r   s    r0   r   z!test_hidden_stroptions.<locals>.fP  	    
 	r3   r   rn   r   r   N)r$   r   r   rp   rq   r   rw   r   r   s      r0   test_hidden_stroptionsr   M  s/    	:vh''
F80D0D)E)EFG&*   	  AfIIIAfIII	%<
 
 
 		               (.!!GW      s   9BBBc                  z    t          t          d          sJ t          t                      j        d          sJ dS )zCheck that the validate_params decorator properly sets the parameter constraints
    as attribute of the decorated function/method.
    _skl_parameter_constraintsN)hasattrr1   r5   r9   r-   r3   r0   4test_validate_params_set_param_constraints_attributer   f  s?     5677777688#%ABBBBBBBr3   c                      t          ddgid          d             }  | d            | t          j        d                     dS )zCheck that validate_params raise a deprecation message but still passes
    validation when using an int for a parameter accepting a boolean.
    r   r   Tr*   c                     d S rD   r-   r   s    r0   r   z1test_boolean_constraint_deprecated_int.<locals>.fs  rK   r3   FN)r$   rb   bool_r   s    r0   &test_boolean_constraint_deprecated_intr   n  s`    
 g	{+4PPP  QP AdGGGAbhuoor3   c                  (   t          t          dgddd          dd            } t          j        t          d          5   | d	
           ddd           n# 1 swxY w Y    G d d          } | |            |  |                       dS )z5Check that validation can be skipped for a parameter.Nno_validationparam1param2Tr*   c                     d S rD   r-   r   s     r0   r   ztest_no_validation.<locals>.f  r   r3   zThe 'param1' parameterrn   r   )r   c                       e Zd ZdS )$test_no_validation.<locals>.SomeTypeN)r<   r=   r>   r-   r3   r0   SomeTyper     s        r3   r   )r   rL   r$   r   rp   rq   r   )r   r   s     r0   test_no_validationr   |  s#    ;/::&*    	  
,4L	M	M	M  	                      AXAXXZZs   AA!Ac                      t          j        d          } t                      }|                    | j                  sJ |                    t          j        g d                    rJ dS )z9Add a specific test for checking support for `pandas.NA`.pandasr   N)rp   importorskipr   rv   NArb   array)pdna_constraints     r0   $test_pandas_na_constraint_with_pd_nar    sg    		X	&	&B'))M((/////,,RXiii-@-@AAAAAAAr3   c                      t                      } |                     g d          sJ |                     t          d                    sJ |                     d          rJ dS )zGCheck that a string does not satisfy the _IterableNotString constraint.r   r   zsome stringN)r   rv   ranger   s    r0   test_iterable_not_stringr    sk    $&&J%%iii00000%%eBii00000))-8888888r3   c                  <   t                      } |                     d          sJ |                     t                                sJ |                     ddgddgfddgddgfg          sJ |                     d          sJ |                     d          rJ dS )zUCheck that the _CVObjects constraint accepts all current ways
    to pass cv objects.r   rf   rR   r   r   Nznot a CV object)r   rv   r
   r   s    r0   test_cv_objectsr    s     J%%a(((((%%kmm44444%%AA'71a&1a&9I&JKKKKK%%d+++++))*;<<<<<<<r3   c                  h     G d dt                     }  | d                                           dS )zCheck that the validation from a scikit-learn estimator inherited by a third
    party estimator does not impose a match between the dict of constraints and the
    parameters of the estimator.
    c                   *     e Zd Z fdZd fd	Z xZS )7test_third_party_estimator.<locals>.ThirdPartyEstimatorc                 Z    || _         t                                          d           d S )Nr   rE   )r'   superrF   )r8   r'   r   s     r0   rF   z@test_third_party_estimator.<locals>.ThirdPartyEstimator.__init__  s+    DFGGq!!!!!r3   Nc                 L    t                                          ||           d S rD   )r  rJ   )r8   rH   rI   r   s      r0   rJ   z;test_third_party_estimator.<locals>.ThirdPartyEstimator.fit  s!    GGKK1r3   rL   )r<   r=   r>   rF   rJ   __classcell__)r   s   @r0   ThirdPartyEstimatorr    sV        	" 	" 	" 	" 	"	 	 	 	 	 	 	 	 	 	r3   r  r   r'   N)rA   rJ   )r  s    r0   test_third_party_estimatorr    sT        j    !  """""r3   c                      t          t          ddd          } |                     d          sJ |                     d          rJ dS )z9Check for the type RealNotInt in the Interval constraint.r   rf   rW   rT   rj   N)r   r   rv   r   s    r0   test_interval_real_not_intr    sR    *a6:::J%%c*****))!,,,,,,,r3   c                     t          dt                    sJ t          dt                    rJ t          t          j        d          t                    sJ t          t          j        d          t                    rJ dS )zCheck for the RealNotInt type.rj   rf   N)
isinstancer   rb   float64int64r-   r3   r0   test_real_not_intr    sp    c:&&&&&!Z(((((bjmmZ00000"(1++z2222222r3   c                  2   t          dt          gid          d             } t          j        t          d          5   | d           d	d	d	           n# 1 swxY w Y   t          d
          5   | d           d	d	d	           d	S # 1 swxY w Y   d	S )z@Check that param validation can be skipped using config_context.r&   Tr*   c                     d S rD   r-   rE   s    r0   r   z%test_skip_param_validation.<locals>.f  rK   r3   The 'a' parameterrn   1rE   Nskip_parameter_validation)r$   r   rp   rq   r   r   r   s    r0   test_skip_param_validationr%    s5    cC5\FFF  GF 
,4G	H	H	H  	C               
$	7	7	7  	C                 s#   AAA2BBBr+   Fc                    t          dt          gid          d             t          dt          gi|           fd            }t          j        t          d          5   |d	
           ddd           n# 1 swxY w Y   | r |d
           dS t          j        t          d          5   |d
           ddd           dS # 1 swxY w Y   dS )z,Check that nested validation can be skipped.r&   Tr*   c                     d S rD   r-   rE   s    r0   r   z&test_skip_nested_validation.<locals>.f  rK   r3   r'   c                      d          S )Ninvalid_param_valuerE   r-   )r'   r   s    r0   gz&test_skip_nested_validation.<locals>.g  s     q())))r3   zThe 'b' parameterrn   r)  r  Nrf   r!  r   )r+   r*  r   s     @r0   test_skip_nested_validationr+    s    cC5\FFF  GF 	se&C  * * * *	 *
 
,4G	H	H	H # #	!""""# # # # # # # # # # # # # # # % 	A]08KLLL 	 	AFFFF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s$   #A<<B B 2CCCzJskip_parameter_validation, prefer_skip_nested_validation, expected_skipped))TTT)TFT)FTT)FFFc                     t          dt          gi|          d             }t          |           5   |d          }ddd           n# 1 swxY w Y   ||k    sJ dS )z5Check interaction between global skip and local skip.r&   r*   c                 *    t                      d         S )Nr$  )r   rE   s    r0   r*  z9test_skip_nested_validation_and_config_context.<locals>.g  s     ||788r3   r#  rf   N)r$   r   r   )r$  r+   expected_skippedr*  actual_skippeds        r0   .test_skip_nested_validation_and_config_contextr0    s     	se4Q  9 9 9 
2K	L	L	L  1               -------s   AAA)r   )dnumbersr   r   numpyrb   rp   scipy.sparser   sklearn._configr   r   sklearn.baser   r	   sklearn.model_selectionr
   sklearn.utilsr   sklearn.utils._param_validationr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   sklearn.utils.fixesr%   r1   r5   rA   markparametrizer[   r`   re   ri   	TypeErrorr   rt   rz   r~   r   ndarrayr   r   r   r   r   r   r   rk   float32r  callabler  randomRandomStaterh   r_   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r%  r+  r0  r-   r3   r0   <module>rB     s]   " " " " " " " "      # # # # # # 6 6 6 6 6 6 6 6 4 4 4 4 4 4 4 4 / / / / / / $ $ $ $ $ $                                                   4 / . . . . . &vTF$88"&  :a : : : :	 :
, 
, 
, 
, 
, 
, 
, 
,
 
 
 
 
 
 
 
 8T*:;;  <;& 8T*:;;# # <;#(# # #  XdAq(((((4tF*S*S*ST " "	 "
  sQ&IIL	
 q3)LLL	
 ta6JJ5	
 q47KK7	
 q2HH,	
+ < = <. . ./ / / 	e	5	w	_%	 G G GC C C( tQv...q$v...tT)444
???##4(((
5
 5 5 5 % HXtQw777HZQv666	

 HXtQw777HZQy999	

 HXtQw777HZAf555	

 HXtQw777HZD888	

 HXtQw777HZD;;;	

 HXq$v666HZQv666	

 HXq$v666HZQy999	

 HXq$v666HZAf555	

 HXq$v666HZr&999	

 HXq$v666HZr)<<<	

 HXr1V444HZq999	

 HXr1V444HZD888	

 HXr1V444HZb;;;	

 HXr1V444HZb999	

 HXr1Y777HZBy999	

 HXr1Y777HZBv666	

 HXq$v666HZAf555	

 HXq$v666HZAf555	
KIL LZ
; 
;[L LZ
; T
	4i888	 / / / 
T	4(((
???##)))$$4i8881b3331d955549555q!I...q$v...tQw///
5
- 6- -7 6- #	$1V	,	,	,d3	(AtI	6	6	6;	OOO	$	$c*	
BJ/	0	0"*=	??#	AA'(	xrx!Q!Q 0112	**q!fq!f%5667 

 

+

 

 

  	  
..q112   	! " 
# $ 
a% & 
s' ( 	) * 	+ , 
- . 
"/ 0 
$1 2 
!T'"3 4 
$5 6 
%%,,'7 8 
"&!9 : 
)$; < 
E		JJOOO,= > 	? # #H- -I# #H- 7	$1V	,	,	,h7	Y	*	+	+Z8	d|	$	$g.	{#	/*	'		:	l	I	N#	D	)	)	)=9	E		J'	j!	 (= =) (=2 2 23 3 3D	 	 	0 0 01 1 1   ; ; ;2 2 20! ! !2C C C    ,B B B9 9 9= = =# # #&- - -3 3 3   84-HH  IH4 P   . . . . .r3   