code: def sanitize_confounds(n_time, n_runs, confounds):
      """Check confounds are the correct type.
  
      When passing multiple runs, ensure the
      number of runs matches the sets of confound regressors.
      """
      if confounds is None:
          return confounds
  
      if not isinstance(
          confounds, (list, tuple, str, np.ndarray, pd.DataFrame)
      ):
          raise TypeError(
              f"confounds keyword has an unhandled type: {confounds.__class__}"
          )
  
      if not isinstance(confounds, (list, tuple)):
          confounds = (confounds,)
  
      all_confounds = []
      for confound in confounds:
          confound = _sanitize_confound_dtype(n_time, confound)
          all_confounds.append(confound)
      confounds = np.hstack(all_confounds)
      return _ensure_float(confounds)
  
imports: import warnings
  import numpy
  import pandas
  from scipy import linalg, signal
  from scipy.interpolate import CubicSpline
  from sklearn.utils import as_float_array, gen_even_slices
  from nilearn._utils import fill_doc, stringify_path
  from nilearn._utils.numpy_conversions import as_ndarray, csv_to_array
  from nilearn._utils.param_validation import check_run_sample_masks
label_desc: Use image node_id 17 for calling a global function with example usage: sanitize_confounds(n_time, n_runs, confounds) and returns: _ensure_float, confounds