code: def graph_net_logistic(
      X,
      y,
      alpha,
      l1_ratio,
      mask,
      init=None,
      max_iter=1000,
      tol=1e-4,
      callback=None,
      verbose=0,
      lipschitz_constant=None,
  ):
      """Compute a solution for the Graph-Net classification problem, \
      with response vector in {-1, 1}^n_samples.
  
      This function invokes the mfista backend (from fista.py) to solve the
      underlying optimization problem.
  
      Returns
      -------
      w : ndarray of shape (n_features,)
         The solution vector (Where `n_features` is the size of the support
         of the mask.)
  
      solver_info : dict
          Solver information for warm starting. See fista.py.mfista(...)
          function for detailed documentation.
  
      objective : array of floats
          Cost function (fval) computed on every iteration.
  
      """
      _, n_features = X.shape
  
      # misc
      model_size = n_features + 1
      l1_weight = alpha * l1_ratio
      grad_weight = alpha * (1 - l1_ratio)
  
      if lipschitz_constant is None:
          lipschitz_constant = _logistic_derivative_lipschitz_constant(
              X, mask, grad_weight
          )
  
          # it's always a good idea to use somethx a bit bigger
          lipschitz_constant *= 1.1
  
      # smooth part of energy, and gradient of
      def f1(w):
          return _logistic_data_loss_and_spatial_grad(
              X, y, w, mask, grad_weight
          )
  
      def f1_grad(w):
          return _logistic_data_loss_and_spatial_grad_derivative(
              X, y, w, mask, grad_weight
          )
  
      # prox of nonsmooth path of energy (account for the intercept)
      def f2(w):
          return np.sum(np.abs(w[:-1])) * l1_weight
  
      def f2_prox(w, step_size, *args, **kwargs):
          return prox_l1_with_intercept(w, step_size * l1_weight), dict(
              converged=True
          )
  
      # total energy (smooth + nonsmooth)
      def total_energy(w):
          return f1(w) + f2(w)
  
      # finally, run the solver proper
      return mfista(
          f1_grad,
          f2_prox,
          total_energy,
          lipschitz_constant,
          model_size,
          dgap_factor=(0.1 + l1_ratio) ** 2,
          callback=callback,
          tol=tol,
          max_iter=max_iter,
          verbose=verbose,
          init=init,
      )
  
file_path: nilearn/nilearn/decoding/space_net_solvers.py
imports: from math import sqrt
  import numpy
  from nilearn.masking import unmask_from_to_3d_array
  from ._objective_functions import divergence, gradient, gradient_id, logistic_loss, logistic_loss_grad, logistic_loss_lipschitz_constant, spectral_norm_squared, squared_loss, squared_loss_grad
  from ._proximal_operators import prox_l1, prox_l1_with_intercept, prox_tvl1, prox_tvl1_with_intercept
  from .fista import mfista
label_desc: Use image node_id 10 for calling a global function with example usage: graph_net_logistic(X, y, alpha, l1_ratio, mask, init, max_iter, tol, callback, verbose, lipschitz_constant) and returns: mfista, _logistic_data_loss_and_spatial_grad, _logistic_data_loss_and_spatial_grad_derivative, unknown, prox_l1_with_intercept,  dict, unknown