code: def _convolve_regressors(
      paradigm, hrf_model, frametimes, fir_delays=[0], min_onset=-24
  ):
      """Creation of  a matrix that comprises
      the convolution of the conditions onset with a certain hrf model
  
      Parameters
      ----------
      paradigm: paradigm instance
      hrf_model: string that can be 'canonical',
                 'canonical with derivative' or 'fir'
                 that specifies the hemodynamic response function
      frametimes: array of shape(n_scans)
                  the targeted timing for the design matrix
      fir_delays=[0], optional, array of shape(nb_onsets) or list
                      in case of FIR design, yields the array of delays
                      used in the FIR model
      min_onset: float, optional
          minimal onset relative to frametimes[0] (in seconds)
          events that start before frametimes[0] + min_onset are not considered
  
      Returns
      -------
      rmatrix: array of shape(n_scans, n_regressors),
               contains the convolved regressors
               associated with the experimental condition
      names: list of strings,
             the condition names, that depend on the hrf model used
             if 'canonical' then this is identical to the input names
             if 'canonical with derivative', then two names are produced for
               input name 'name': 'name' and 'name_derivative'
      """
      hnames = []
      rmatrix = None
      if hrf_model == "fir":
          oversampling = 1
      else:
          oversampling = 16
  
      for nc in np.unique(paradigm.con_id):
          onsets = paradigm.onset[paradigm.con_id == nc]
          nos = np.size(onsets)
          if paradigm.amplitude is not None:
              values = paradigm.amplitude[paradigm.con_id == nc]
          else:
              values = np.ones(nos)
          if nos < 1:
              continue
          if paradigm.type == "event":
              duration = np.zeros_like(onsets)
          else:
              duration = paradigm.duration[paradigm.con_id == nc]
          exp_condition = (onsets, duration, values)
          reg, names = compute_regressor(
              exp_condition,
              hrf_model,
              frametimes,
              con_id=nc,
              fir_delays=fir_delays,
              oversampling=oversampling,
              min_onset=min_onset,
          )
          hnames += names
          if rmatrix is None:
              rmatrix = reg
          else:
              rmatrix = np.hstack((rmatrix, reg))
      return rmatrix, hnames
  
file_path: nipy/nipy/modalities/fmri/design_matrix.py
imports: from warnings import warn
  import numpy
  from .hemodynamic_models import _orthogonalize, compute_regressor
label_desc: Use image node_id 5 for calling a global function with example usage: _convolve_regressors(paradigm, hrf_model, frametimes, fir_delays, min_onset) and returns: rmatrix,  hnames