code: def _sanitize_inputs(
      signals, runs, confounds, sample_mask, ensure_finite
  ):
      """Clean up signals and confounds before processing."""
      n_time = len(signals)  # original length of the signal
      n_runs, runs = _sanitize_runs(n_time, runs)
      confounds = sanitize_confounds(n_time, n_runs, confounds)
      sample_mask = _sanitize_sample_mask(
          n_time, n_runs, runs, sample_mask
      )
      signals = _sanitize_signals(signals, ensure_finite)
      return signals, runs, confounds, sample_mask
  
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 16 for calling a global function with example usage: _sanitize_inputs(signals, runs, confounds, sample_mask, ensure_finite) and returns: signals,  runs,  confounds,  sample_mask