code: def _make_data(task="regression", size=4):
      X, y, w, mask = create_graph_net_simulation_data(
          snr=1.0,
          n_samples=10,
          size=size,
          n_points=5,
          random_state=42,
          task=task,
      )
      X_, _ = to_niimgs(X, [size] * 3)
      mask_ = Nifti1Image(mask.astype(float), X_.affine)
      return X, y, w, mask, mask_, X_
  
imports: import numpy
  import pytest
  import scipy
  from nibabel import Nifti1Image
  from numpy.testing import assert_almost_equal
  from scipy import linalg
  from nilearn.decoding._objective_functions import divergence, gradient
  from nilearn.decoding.space_net import BaseSpaceNet
  from nilearn.decoding.space_net_solvers import _graph_net_adjoint_data_function, _graph_net_data_function, _logistic_data_loss_and_spatial_grad, _logistic_data_loss_and_spatial_grad_derivative, _logistic_derivative_lipschitz_constant, _squared_loss_and_spatial_grad, _squared_loss_and_spatial_grad_derivative, _squared_loss_derivative_lipschitz_constant, mfista
  from nilearn.decoding.tests._testing import create_graph_net_simulation_data
  from .test_same_api import to_niimgs
label_desc: Use image node_id 1 for calling a global function with example usage: _make_data(task, size) and returns: X,  y,  w,  mask,  mask_,  X_