code: def test_input_args_and_kwargs(cb_retval, verbose, dgap_factor, rng):
      p = 125
      noise_std = 1e-1
      sig = np.zeros(p)
      sig[[0, 2, 13, 4, 25, 32, 80, 89, 91, 93, -1]] = 1
      sig[:6] = 2
      sig[-7:] = 2
      sig[60:75] = 1
      y = sig + noise_std * rng.standard_normal(sig.shape)
      X = np.eye(p)
      mask = np.ones((p,)).astype(bool)
      alpha = 0.01
      alpha_ = alpha * X.shape[0]
      l1_ratio = 0.2
      l1_weight = alpha_ * l1_ratio
  
      def f1(w):
          return squared_loss(X, y, w, compute_grad=False)
  
      def f1_grad(w):
          return squared_loss(
              X, y, w, compute_grad=True, compute_energy=False
          )
  
      def f2_prox(w, step_size, *args, **kwargs):
          return prox_l1(w, step_size * l1_weight), dict(converged=True)
  
      def total_energy(w):
          return f1(w) + l1_weight * np.sum(np.abs(w))
  
      best_w, objective, init = mfista(
          f1_grad,
          f2_prox,
          total_energy,
          1.0,
          p,
          dgap_factor=dgap_factor,
          callback=lambda _: cb_retval,
          verbose=verbose,
          max_iter=100,
      )
  
      assert best_w.shape == mask.shape
      assert isinstance(objective, list)
      assert isinstance(init, dict)
      for key in ["w", "t", "dgap_tol", "stepsize"]:
          assert key in init
  
file_path: nilearn/nilearn/decoding/tests/test_fista.py
imports: import numpy
  import pytest
  from nilearn.decoding._objective_functions import logistic_loss, logistic_loss_lipschitz_constant, spectral_norm_squared, squared_loss, squared_loss_grad
  from nilearn.decoding._proximal_operators import prox_l1
  from nilearn.decoding.fista import _check_lipschitz_continuous, mfista
label_desc: Use image node_id 3 for calling a global function with example usage: test_input_args_and_kwargs(cb_retval, verbose, dgap_factor, rng) and returns: squared_loss, squared_loss, prox_l1,  dict, unknown