ó
    Ñ]j  ã                   ó,   • S SK r S SKrS SKJr  S rS rg)é    N)Úsuppressc                 ó¼   • [        U [        R                  5      (       + =(       a7    [        U [        R                  5      =(       a    [        R
                  " U 5      $ )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    ÚS/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sklearn/utils/_missing.pyÚis_scalar_nanr   	   s@   € ô@ �qœ'×*Ñ*Ó+Ô+÷ 	Ü�qœ'Ÿ,™,Ó'÷	ä�JŠJ�q‹Mðó    c                 óh   • [        [        5         SSKJn  XL sSSS5        $ ! , (       d  f       g= f)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%   € ô$ 
”+Õ	Ýàˆw÷ 
×	Ö	ð
 ús   �	#£
1)r	   r   Ú
contextlibr   r   r   © r   r   Ú<module>r      s   ðó Û Ý ò#óLr   