code: def test_logistic_path_scores():
      iris = load_iris()
      X, y = iris.data, iris.target
      _, mask = to_niimgs(X, [2, 2, 2])
      mask = get_data(mask).astype(bool)
      alphas = [1.0, 0.1, 0.01]
  
      test_scores, best_w = logistic_path_scores(
          graph_net_logistic,
          X,
          y,
          mask,
          alphas,
          0.5,
          np.arange(len(X)),
          np.arange(len(X)),
          {},
      )[:2]
      test_scores = test_scores[0]
  
      assert len(test_scores) == len(alphas)
      assert X.shape[1] + 1 == len(best_w)
  
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 7 for calling a global function with example usage: test_logistic_path_scores() without return types