code: def _logistic_data_loss_and_spatial_grad(X, y, w, mask, grad_weight):
      """Compute the smooth part of the Graph-Net objective, \
      with logistic loss."""
      grad_buffer = np.zeros(mask.shape)
      grad_buffer[mask] = w[:-1]
      grad_mask = np.array([mask for _ in range(mask.ndim)])
      grad_section = gradient(grad_buffer)[grad_mask]
      return logistic_loss(X, y, w) + 0.5 * grad_weight * np.dot(
          grad_section, grad_section
      )
  
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 7 for calling a global function with example usage: _logistic_data_loss_and_spatial_grad(X, y, w, mask, grad_weight) and returns: unknown