code: def test_lasso_vs_graph_net():
      """Test for one of the extreme cases of Graph-Net.
  
      That is, with l1_ratio = 1 (pure Lasso),
      we compare Graph-Net's performance with Scikit-Learn lasso
      """
      size = 4
      X_, y, _, mask = create_graph_net_simulation_data(
          snr=1.0, n_samples=10, size=size, n_points=5, random_state=10
      )
      X, mask = to_niimgs(X_, [size] * 3)
  
      lasso = Lasso(max_iter=100, tol=1e-8)
      graph_net = BaseSpaceNet(
          mask=mask,
          alphas=1.0 * X_.shape[0],
          l1_ratios=1,
          is_classif=False,
          penalty="graph-net",
          max_iter=100,
          verbose=0,
      )
      lasso.fit(X_, y)
      graph_net.fit(X, y)
  
      lasso_perf = 0.5 / y.size * linalg.norm(
          np.dot(X_, lasso.coef_) - y
      ) ** 2 + np.sum(np.abs(lasso.coef_))
      graph_net_perf = 0.5 * ((graph_net.predict(X) - y) ** 2).mean()
      assert_almost_equal(graph_net_perf, lasso_perf, decimal=2)
  
imports: from functools import partial
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_equal
  from scipy import linalg
  from sklearn.datasets import load_iris
  from sklearn.linear_model import Lasso, LogisticRegression
  from sklearn.linear_model._coordinate_descent import _alpha_grid
  from sklearn.metrics import accuracy_score
  from nilearn._utils.param_validation import adjust_screening_percentile
  from nilearn.decoding.space_net import BaseSpaceNet, SpaceNetClassifier, SpaceNetRegressor, _crop_mask, _EarlyStoppingCallback, _space_net_alpha_grid, _univariate_feature_screening, path_scores
  from nilearn.decoding.space_net_solvers import graph_net_logistic, graph_net_squared_loss
  from nilearn.decoding.tests._testing import create_graph_net_simulation_data
  from nilearn.image import get_data
  from .test_same_api import to_niimgs
label_desc: Use image node_id 13 for calling a global function with example usage: test_lasso_vs_graph_net() without return types