code: def is_scalar_nan(x):
      """Tests 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
  
      Returns
      -------
      boolean
  
      Examples
      --------
      >>> 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
      """
      return isinstance(x, numbers.Real) and math.isnan(x)
  
imports: import math
  import numbers
  import warnings
  from typing import List
  import numpy
  import pandas
  from sklearn.base import BaseEstimator
  from ...None import options
  from ...core import enter_mode
  from ...typing import TileableType
  from ...dataframe import DataFrame, Series
  from ...dataframe.core import DATAFRAME_TYPE, SERIES_TYPE
  from ...tensor import tensor
  from ...utils import parse_readable_size
label_desc: Use image node_id 4 for calling a global function with example usage: is_scalar_nan(x) and returns: unknown