code: def _create_cosine_drift_terms(signals, confounds, high_pass, t_r):
      """Create cosine drift terms, append to confounds regressors."""
      from nilearn.glm.first_level.design_matrix import (
          create_cosine_drift,
      )
  
      frame_times = np.arange(signals.shape[0]) * t_r
      # remove constant, as the signal is mean centered
      cosine_drift = create_cosine_drift(high_pass, frame_times)[:, :-1]
      confounds = _check_cosine_by_user(confounds, cosine_drift)
      return 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 13 for calling a global function with example usage: _create_cosine_drift_terms(signals, confounds, high_pass, t_r) and returns: confounds