code: def _clean_nans(scores):
      """
      Fixes Issue #1240: NaNs can't be properly compared, so change them to the
      smallest value of scores's dtype. -inf seems to be unreliable.
      """
      # XXX where should this function be called? fit? scoring functions
      # themselves?
      scores = as_float_array(scores, copy=True)
      scores[np.isnan(scores)] = np.finfo(scores.dtype).min
      return scores
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  from scipy import special, stats
  from scipy.sparse import issparse
  from ..base import BaseEstimator, _fit_context
  from ..preprocessing import LabelBinarizer
  from ..utils import as_float_array, check_array, check_X_y, safe_mask, safe_sqr
  from ..utils._param_validation import Interval, StrOptions, validate_params
  from ..utils.extmath import row_norms, safe_sparse_dot
  from ..utils.validation import check_is_fitted
  from ._base import SelectorMixin
label_desc: Use image node_id 1 for calling a global function with example usage: _clean_nans(scores) and returns: scores