code: def _dual_gap_prox_tvl1(
      input_img_norm, new, gap, weight, l1_ratio=1.0
  ):
      """Compute dual gap of total variation denoising.
  
      See "Total variation regularization for fMRI-based prediction of behavior",
      by Michel et al. (2011) for a derivation of the dual gap
      """
      tv_new = tv_l1_from_gradient(gradient_id(new, l1_ratio=l1_ratio))
      gap = gap.ravel()
      d_gap = (
          np.dot(gap, gap)
          + 2 * weight * tv_new
          - input_img_norm
          + (new * new).sum()
      )
      return 0.5 * d_gap
  
file_path: nilearn/nilearn/decoding/_proximal_operators.py
imports: from math import sqrt
  import numpy
  from ._objective_functions import divergence_id, gradient_id, tv_l1_from_gradient
label_desc: Use image node_id 4 for calling a global function with example usage: _dual_gap_prox_tvl1(input_img_norm, new, gap, weight, l1_ratio) and returns: unknown