code: def test_2D__gradient_id(l1_ratio):
      img = np.array([[1, 3], [4, 2]])
  
      gid = gradient_id(img, l1_ratio)
  
      assert_array_equal(gid.shape, [img.ndim + 1] + list(img.shape))
      assert_array_equal(l1_ratio * img, gid[-1])
  
file_path: nilearn/nilearn/decoding/tests/test_objective_functions.py
imports: import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_equal
  from scipy.optimize import check_grad
  from nilearn.decoding._objective_functions import divergence_id, gradient_id, logistic_loss, logistic_loss_grad
  from nilearn.decoding.space_net import BaseSpaceNet
label_desc: Use image node_id 3 for calling a global function with example usage: test_2D__gradient_id(l1_ratio) without return types