code: def test_prox_tvl1_approximates_prox_l1_for_lasso(
      rng,
      ndim,
      weight,
      size=15,
      random_state=42,
      decimal=4,
      dgap_tol=1e-7,
  ):
      l1_ratio = 1.0  # pure LASSO
  
      shape = [size] * ndim
      z = rng.standard_normal(shape)
  
      # use prox_tvl1 approximation to prox_l1
      a = prox_tvl1(
          z.copy(),
          weight=weight,
          l1_ratio=l1_ratio,
          dgap_tol=dgap_tol,
          max_iter=10,
      )[0][-1].ravel()
  
      # use exact closed-form soft shrinkage formula for prox_l1
      b = prox_l1(z.copy(), weight)[-1].ravel()
  
      # results should be close in l-infinity norm
      assert_almost_equal(np.abs(a - b).max(), 0.0, decimal=decimal)
  
imports: import itertools
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal
  from nilearn.decoding._proximal_operators import prox_l1, prox_tvl1
label_desc: Use image node_id 2 for calling a global function with example usage: test_prox_tvl1_approximates_prox_l1_for_lasso(rng, ndim, weight, size, random_state, decimal, dgap_tol) without return types