code: def _convolve_regressors(
      events,
      hrf_model,
      frame_times,
      fir_delays=[0],
      min_onset=-24,
      oversampling=50,
  ):
      """Creation of a matrix that comprises \
      the convolution of the conditions onset with a certain hrf model.
  
      Parameters
      ----------
      events : DataFrame instance,
          Events data describing the experimental paradigm
          see nilearn.glm.first_level.experimental_paradigm to check the
          specification for these to be valid paradigm descriptors
  
      hrf_model : {'spm', 'spm + derivative', 'spm + derivative + dispersion',
          'glover', 'glover + derivative', 'glover + derivative + dispersion',
          'fir', None}
          String that specifies the hemodynamic response function
  
      frame_times : array of shape (n_scans,)
          The targeted timing for the design matrix.
  
      fir_delays : array-like of shape (n_onsets,), default=[0]
          In case of FIR design, yields the array of delays
          used in the FIR model (in scans).
  
      min_onset : float, default=-24
          Minimal onset relative to frame_times[0] (in seconds) events
          that start before frame_times[0] + min_onset are not considered.
  
      oversampling : int, default=50
          Oversampling factor used in temporal convolutions.
  
      Returns
      -------
      regressor_matrix : array of shape (n_scans, n_regressors),
          Contains the convolved regressors associated with the
          experimental conditions.
  
      regressor_names : list of strings,
          The regressor names, that depend on the hrf model used
          if 'glover' or 'spm' then this is identical to the input names
          if 'glover + derivative' or 'spm + derivative', a second name is output
              i.e. '#name_derivative'
          if 'spm + derivative + dispersion' or
              'glover + derivative + dispersion',
              a third name is used, i.e. '#name_dispersion'
          if 'fir', the regressos are numbered according to '#name_#delay'
  
      """
      regressor_names = []
      regressor_matrix = None
  
      events_copy = check_events(events)
      cleaned_events = handle_modulation_of_duplicate_events(
          events_copy
      )
  
      trial_type = cleaned_events["trial_type"].values
      onset = cleaned_events["onset"].values
      duration = cleaned_events["duration"].values
      modulation = cleaned_events["modulation"].values
  
      for condition in np.unique(trial_type):
          condition_mask = trial_type == condition
          exp_condition = (
              onset[condition_mask],
              duration[condition_mask],
              modulation[condition_mask],
          )
          reg, names = compute_regressor(
              exp_condition,
              hrf_model,
              frame_times,
              con_id=condition,
              fir_delays=fir_delays,
              oversampling=oversampling,
              min_onset=min_onset,
          )
  
          regressor_names += names
          if regressor_matrix is None:
              regressor_matrix = reg
          else:
              regressor_matrix = np.hstack((regressor_matrix, reg))
      return regressor_matrix, regressor_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 5 for calling a global function with example usage: _convolve_regressors(events, hrf_model, frame_times, fir_delays, min_onset, oversampling) and returns: regressor_matrix,  regressor_names