code: def _generic_time_derivative(
      func, tr, oversampling=50, time_length=32.0, onset=0.0, dt=0.1
  ):
      """Return the time derivative of an hrf for a given function.
  
      Parameters
      ----------
      func : :obj:`function`
          spm_hrf or glover_hrf
  
      tr : float
          :term:`Repetition time<TR>`, in seconds (sampling period).
  
      oversampling : int, default=50
          Temporal oversampling factor.
  
      time_length : float, default=32
          hrf kernel length, in seconds.
  
      onset : float, default=0
          Onset of the response.
  
      dt : float, default=0.1
          Time step for the derivative.
      """
      return _compute_derivative_from_values(
          func(tr, oversampling, time_length, onset),
          func(tr, oversampling, time_length, onset + dt),
          dt=dt,
      )
  
imports: import warnings
  from collections.abc import Iterable
  import numpy
  from scipy.stats import gamma
  from nilearn._utils import fill_doc
label_desc: Use image node_id 5 for calling a global function with example usage: _generic_time_derivative(func, tr, oversampling, time_length, onset, dt) and returns: _compute_derivative_from_values