§
    rŠtj  ã                   ó.   — d dl Z d dlZd dlmZ d„ Zd„ ZdS )é    N)Úsuppressc                 ó”   — t          | t          j        ¦  «         o-t          | t          j        ¦  «        ot	          j        | ¦  «        S )a†  Test if x is NaN.

    This function is meant to overcome the issue that np.isnan does not allow
    non-numerical types as input, and that np.nan is not float('nan').

    Parameters
    ----------
    x : any type
        Any scalar value.

    Returns
    -------
    bool
        Returns true if x is NaN, and false otherwise.

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.utils._missing import is_scalar_nan
    >>> is_scalar_nan(np.nan)
    True
    >>> is_scalar_nan(float("nan"))
    True
    >>> is_scalar_nan(None)
    False
    >>> is_scalar_nan("")
    False
    >>> is_scalar_nan([np.nan])
    False
    )Ú
isinstanceÚnumbersÚIntegralÚRealÚmathÚisnan)Úxs    úT/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sklearn/utils/_missing.pyÚis_scalar_nanr   	   sA   € õ@ �q�'Ô*Ñ+Ô+Ð+ð 	Ý�q�'œ,Ñ'Ô'ð	åŒJ�q‰MŒMðó    c                 ór   — t          t          ¦  «        5  ddlm} | |u cddd¦  «         S # 1 swxY w Y   dS )aÞ  Test if x is pandas.NA.

    We intentionally do not use this function to return `True` for `pd.NA` in
    `is_scalar_nan`, because estimators that support `pd.NA` are the exception
    rather than the rule at the moment. When `pd.NA` is more universally
    supported, we may reconsider this decision.

    Parameters
    ----------
    x : any type
        The input value to test.

    Returns
    -------
    boolean
        True if `x` is `pandas.NA`, False otherwise.
    r   )ÚNANF)r   ÚImportErrorÚpandasr   )r   r   s     r   Úis_pandas_nar   /   sŒ   € õ$ 
•+Ñ	Ô	ð ð ØÐÐÐÐÐà�Bˆwðð ð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð
 ˆ5s   •
,¬0³0)r	   r   Ú
contextlibr   r   r   © r   r   ú<module>r      sT   ðð €€€Ø €€€Ø Ð Ð Ð Ð Ð ð#ð #ð #ðLð ð ð ð r   