code: def _squared_loss_and_spatial_grad_derivative(
      X, y, w, mask, grad_weight
  ):
      """Compute the derivative of _squared_loss_and_spatial_grad.
  
      Parameters
      ----------
      X : ndarray, shape (n_samples, n_features)
          Design matrix.
  
      y : ndarray, shape (n_samples,)
          Target / response vector.
  
      w : ndarray shape (n_features,)
          Unmasked, ravelized weights map.
  
      grad_weight: float
          l1_ratio * alpha
  
      Returns
      -------
      ndarray, shape (n_features,)
          Derivative of _squared_loss_and_spatial_grad function.
      """
      data_section = np.dot(X, w) - y
      image_buffer = np.zeros(mask.shape)
      image_buffer[mask] = w
      return (
          np.dot(X.T, data_section)
          - grad_weight * divergence(gradient(image_buffer))[mask]
      )
  
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 2 for calling a global function with example usage: _squared_loss_and_spatial_grad_derivative(X, y, w, mask, grad_weight) and returns: unknown