o
    `^h                     @   sp  d Z ddlZddlZddlmZ ddlZddlmZ ddl	m
Z
mZ ddlmZ dd	lmZmZ dd
lmZ ddlmZmZmZ ddlmZ ddlmZmZmZmZmZ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) ddl*m+Z+ ddl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6 dZ7e%e7e
j8Z8e%e7G dd de
j9Z9g dZ:dd Z;e%ddd Z<dS )z+Various utilities to help with development.    N)Sequence   )DataConversionWarning   )_joblibmetadata_routing)Bunch)gen_batchesgen_even_slices)estimator_html_repr)_safe_indexingresampleshuffle)	safe_mask)ClassifierTags	InputTagsRegressorTagsTags
TargetTagsTransformerTagsget_tags)compute_class_weightcompute_sample_weight)
deprecated)all_estimators)safe_sqr)murmurhash3_32)
as_float_arrayassert_all_finitecheck_arraycheck_consistent_lengthcheck_random_statecheck_scalarcheck_symmetric	check_X_ycolumn_or_1d	indexablez>deprecated in 1.5 to be removed in 1.7. Use joblib.{} instead.c                   @   s   e Zd ZdS )parallel_backendN)__name__
__module____qualname__ r+   r+   T/home/air/shanriGPT/back/venv/lib/python3.10/site-packages/sklearn/utils/__init__.pyr'   >   s    r'   )"r   r   r   r   r!   r   r   r%   r    r$   r"   r&   r#   r   r'   register_parallel_backendr   r   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   c                 C   s4   | dkrt dt t dkS tdt d|  )NIS_PYPYz1IS_PYPY is deprecated and will be removed in 1.7.PyPyzmodule z has no attribute )warningswarnFutureWarningplatformpython_implementationAttributeErrorr(   )namer+   r+   r,   __getattr__j   s   r7   z;tosequence was deprecated in 1.5 and will be removed in 1.7c                 C   s,   t | tjrt| S t | tr| S t| S )a  Cast iterable x to a Sequence, avoiding a copy if possible.

    Parameters
    ----------
    x : iterable
        The iterable to be converted.

    Returns
    -------
    x : Sequence
        If `x` is a NumPy array, it returns it as a `ndarray`. If `x`
        is a `Sequence`, `x` is returned as-is. If `x` is from any other
        type, `x` is returned casted as a list.
    )
isinstancenpndarrayasarrayr   list)xr+   r+   r,   
tosequenceu   s
   

r>   )=__doc__r3   r0   collections.abcr   numpyr9   
exceptionsr    r   r   _bunchr   	_chunkingr	   r
   _estimator_html_reprr   	_indexingr   r   r   _maskr   _tagsr   r   r   r   r   r   r   class_weightr   r   deprecationr   	discoveryr   extmathr   
murmurhashr   
validationr   r   r   r    r!   r"   r#   r$   r%   r&   msgr-   r'   __all__r7   r>   r+   r+   r+   r,   <module>   s6    $	0'