code: def logistic_loss_lipschitz_constant(X):
      """Compute the Lipschitz constant (upper bound) for the gradient of the \
      logistic sum.
  
      .. code-block::
  
          w -> sum_i log(1+exp(-y_i*(x_i*w + v)))
  
      """
      # N.B: we handle intercept!
      X = np.hstack((X, np.ones((X.shape[0], 1))))
      return spectral_norm_squared(X)
  
file_path: nilearn/nilearn/decoding/_objective_functions.py
imports: from functools import partial
  import numpy
  from scipy import linalg
label_desc: Use image node_id 2 for calling a global function with example usage: logistic_loss_lipschitz_constant(X) and returns: spectral_norm_squared