code: def _logistic_data_loss_and_spatial_grad_derivative(
      X, y, w, mask, grad_weight
  ):
      """Compute the derivative of _logistic_loss_and_spatial_grad."""
      image_buffer = np.zeros(mask.shape)
      image_buffer[mask] = w[:-1]
      data_section = logistic_loss_grad(X, y, w)
      data_section[:-1] = (
          data_section[:-1]
          - grad_weight * divergence(gradient(image_buffer))[mask]
      )
      return data_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 8 for calling a global function with example usage: _logistic_data_loss_and_spatial_grad_derivative(X, y, w, mask, grad_weight) and returns: data_section