code: def _hrf_kernel(hrf_model, tr, oversampling=16, fir_delays=None):
      """Given the specification of the hemodynamic model and time parameters,
      return the list of matching kernels
  
      Parameters
      ----------
      hrf_model: string, identifier of the hrf model
      tr: the repetition time in seconds
      oversampling: int, temporal oversampling factor to have a smooth hrf
      fir_delays: list of for delays
  
      Returns
      -------
      hkernel: a list of hrf kernels, depending on the specified hrf model
      """
      if hrf_model == "spm":
          hkernel = [spm_hrf(tr, oversampling)]
      elif hrf_model == "spm_time":
          hkernel = [
              spm_hrf(tr, oversampling),
              spm_time_derivative(tr, oversampling),
          ]
      elif hrf_model == "spm_time_dispersion":
          hkernel = [
              spm_hrf(tr, oversampling),
              spm_time_derivative(tr, oversampling),
              spm_dispersion_derivative(tr, oversampling),
          ]
      elif hrf_model == "canonical":
          hkernel = [glover_hrf(tr, oversampling)]
      elif hrf_model == "canonical with derivative":
          hkernel = [
              glover_hrf(tr, oversampling),
              glover_time_derivative(tr, oversampling),
          ]
      elif hrf_model == "fir":
          hkernel = [
              np.hstack(
                  (np.zeros(f * oversampling), np.ones(oversampling))
              )
              for f in fir_delays
          ]
      else:
          raise ValueError("Unknown hrf model")
      return hkernel
  
file_path: nipy/nipy/modalities/fmri/hemodynamic_models.py
imports: import warnings
  import numpy
  from scipy.stats import gamma
label_desc: Use image node_id 11 for calling a global function with example usage: _hrf_kernel(hrf_model, tr, oversampling, fir_delays) and returns: hkernel