code: def test_prox_l1_nonexpansiveness(rng, n_features=10):
      x = rng.standard_normal((n_features, 1))
      tau = 0.3
      s = prox_l1(x.copy(), tau)
      p = x - s  # projection + shrinkage = id
  
      # We should have ||s(a) - s(b)||^2 <= ||a - b||^2 - ||p(a) - p(b)||^2
      # for all a and b (this is strong non-expansiveness
      for (a, b), (pa, pb), (sa, sb) in zip(
          *[itertools.product(z[0], z[0]) for z in [x, p, s]]
      ):
          assert (sa - sb) ** 2 <= (a - b) ** 2 - (pa - pb) ** 2
  
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 1 for calling a global function with example usage: test_prox_l1_nonexpansiveness(rng, n_features) without return types