code: def as_float_array(X, *, copy=True, force_all_finite=True):
      """Convert an array-like to an array of floats.
  
      The new dtype will be np.float32 or np.float64, depending on the original
      type. The function can create a copy or modify the argument depending
      on the argument copy.
  
      Parameters
      ----------
      X : {array-like, sparse matrix}
          The input data.
  
      copy : bool, default=True
          If True, a copy of X will be created. If False, a copy may still be
          returned if X's dtype is not a floating point type.
  
      force_all_finite : bool or 'allow-nan', default=True
          Whether to raise an error on np.inf, np.nan, pd.NA in X. The
          possibilities are:
  
          - True: Force all values of X to be finite.
          - False: accepts np.inf, np.nan, pd.NA in X.
          - 'allow-nan': accepts only np.nan and pd.NA values in X. Values cannot
            be infinite.
  
          .. versionadded:: 0.20
             ``force_all_finite`` accepts the string ``'allow-nan'``.
  
          .. versionchanged:: 0.23
             Accepts `pd.NA` and converts it into `np.nan`
  
      Returns
      -------
      XT : {ndarray, sparse matrix}
          An array of type float.
      """
      if isinstance(X, np.matrix) or (
          not isinstance(X, np.ndarray) and not sp.issparse(X)
      ):
          return check_array(
              X,
              accept_sparse=["csr", "csc", "coo"],
              dtype=np.float64,
              copy=copy,
              force_all_finite=force_all_finite,
              ensure_2d=False,
          )
      elif sp.issparse(X) and X.dtype in [np.float32, np.float64]:
          return X.copy() if copy else X
      elif X.dtype in [np.float32, np.float64]:  # is numpy array
          return (
              X.copy("F" if X.flags["F_CONTIGUOUS"] else "C")
              if copy
              else X
          )
      else:
          if X.dtype.kind in "uib" and X.dtype.itemsize <= 4:
              return_dtype = np.float32
          else:
              return_dtype = np.float64
          return X.astype(return_dtype)
  
imports: import numbers
  import operator
  import warnings
  from contextlib import suppress
  from functools import reduce, wraps
  from inspect import Parameter, isclass, signature
  import joblib
  import numpy
  import scipy.sparse
  from ..None import get_config
  from ..exceptions import DataConversionWarning, NotFittedError, PositiveSpectrumWarning
  from ..utils._array_api import _asarray_with_order, _is_numpy_namespace, get_namespace
  from ..utils.fixes import ComplexWarning
  from ._isfinite import FiniteStatus, cy_isfinite
  from .fixes import _object_dtype_isnan
label_desc: Use image node_id 5 for calling a global function with example usage: as_float_array(X) and returns: check_array, unknown, unknown, X