code: def check_design_matrix(design_matrix):
      """Check that the provided DataFrame is indeed a valid design matrix \
      descriptor, and returns a triplet of fields.
  
      Parameters
      ----------
      design matrix : pandas DataFrame,
          Describes a design matrix.
  
      Returns
      -------
      frame_times : array of shape (n_frames,),
          Sampling times of the design matrix in seconds.
  
      matrix : array of shape (n_frames, n_regressors), dtype='f'
          Numerical values for the design matrix.
  
      names : array of shape (n_events,), dtype='f'
          Per-event onset time (in seconds)
  
      """
      names = list(design_matrix.keys())
      frame_times = design_matrix.index
      matrix = design_matrix.values
      return frame_times, matrix, names
  
file_path: nilearn/nilearn/glm/first_level/design_matrix.py
imports: import sys
  from warnings import warn
  import numpy
  import pandas
  from nilearn._utils import fill_doc
  from nilearn.glm._utils import full_rank
  from nilearn.glm.first_level.experimental_paradigm import check_events, handle_modulation_of_duplicate_events
  from nilearn.glm.first_level.hemodynamic_models import compute_regressor, orthogonalize
label_desc: Use image node_id 7 for calling a global function with example usage: check_design_matrix(design_matrix) and returns: frame_times,  matrix,  names