o
    tBh!                     @   s^  d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
mZ ddlmZ eejZeejZeedkrEddlmZ nddlmZ z
dd	lmZmZ W n eyf   dd	lmZmZ Y nw d
d ZG dd dejjZdd ZG dd dZddddZ eedk re Z!nddlm!Z! dd Z"dddZ#ej#j e#_ dd Z$ej$j e$_ dS )zCompatibility fixes for older version of python, numpy and scipy

If you add content to this file, please give the version of the package
at which the fix is no longer needed.
    )update_wrapperN   )config_context
get_config)parsez1.4)lobpcg)line_search_wolfe2line_search_wolfe1c                 C   s   | | kS N )Xr   r   j/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/sklearn/utils/fixes.py_object_dtype_isnan+   s   r   c                   @   s   e Zd ZdZdS )
loguniformaw  A class supporting log-uniform random variables.

    Parameters
    ----------
    low : float
        The minimum value
    high : float
        The maximum value

    Methods
    -------
    rvs(self, size=None, random_state=None)
        Generate log-uniform random variables

    The most useful method for Scikit-learn usage is highlighted here.
    For a full list, see
    `scipy.stats.reciprocal
    <https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.reciprocal.html>`_.
    This list includes all functions of ``scipy.stats`` continuous
    distributions such as ``pdf``.

    Notes
    -----
    This class generates values between ``low`` and ``high`` or

        low <= loguniform(low, high).rvs() <= high

    The logarithmic probability density function (PDF) is uniform. When
    ``x`` is a uniformly distributed random variable between 0 and 1, ``10**x``
    are random variables that are equally likely to be returned.

    This class is an alias to ``scipy.stats.reciprocal``, which uses the
    reciprocal distribution:
    https://en.wikipedia.org/wiki/Reciprocal_distribution

    Examples
    --------

    >>> from sklearn.utils.fixes import loguniform
    >>> rv = loguniform(1e-3, 1e1)
    >>> rvs = rv.rvs(random_state=42, size=1000)
    >>> rvs.min()  # doctest: +SKIP
    0.0010435856341129003
    >>> rvs.max()  # doctest: +SKIP
    9.97403052786026
    N)__name__
__module____qualname____doc__r   r   r   r   r   /   s    r   c                    s   t   fdd}|S )z6Decorator used to capture the arguments of a function.c                     s   t  | |fS r
   )_FuncWrapper)argskwargsfunctionr   r   delayed_functiond   s   z!delayed.<locals>.delayed_function)	functoolswraps)r   r   r   r   r   delayeda   s   r   c                   @   s    e Zd ZdZdd Zdd ZdS )r   z< "Load the global configuration before calling the function.c                 C   s   || _ t | _t| | j  d S r
   )r   r   configr   )selfr   r   r   r   __init__n   s   z_FuncWrapper.__init__c                 O   sD   t di | j | j|i |W  d    S 1 sw   Y  d S )Nr   )r   r   r   )r   r   r   r   r   r   __call__s   s   $z_FuncWrapper.__call__N)r   r   r   r   r   r    r   r   r   r   r   k   s    r   linear)methodc                K   s   t j| |fd|i|S )Ninterpolation)np
percentile)aqr"   r   r   r   r   _percentilez   s   r(   z1.22)r%   c                   C   s(   t tdsd S t tdst t_tjS )NThreadpoolController_sklearn_threadpool_controller)hasattrthreadpoolctlsklearnr)   r*   r   r   r   r   _get_threadpool_controller   s
   


r.   c                 C   s*   t  }|d ur|j| |dS tj| |dS )N)limitsuser_api)r.   limitr,   threadpool_limits)r/   r0   
controllerr   r   r   r2      s   r2   c                  C   s   t  } | d ur|  S t S r
   )r.   infor,   threadpool_info)r3   r   r   r   r5      s   r5   )NN)%r   r   r   r-   numpyr$   scipyscipy.statsr,   _configr   r   externals._packaging.versionr   parse_version__version__
np_version
sp_versionscipy.sparse.linalgr   externals._lobpcgscipy.optimize._linesearchr   r	   ImportErrorscipy.optimize.linesearchr   stats
reciprocalr   r   r   r(   r%   r.   r2   r5   r   r   r   r   <module>   sB    

2



