code: def test_sk_enet_path_equivalence(prune):
      """Test that celer_path matches sklearn enet_path."""
  
      n_samples, n_features = 40, 80
      X, y = build_dataset(n_samples, n_features, sparse_X=False)
  
      tol = 1e-14
      l1_ratio = 0.7
      alpha_max = norm(X.T @ y, ord=np.inf) / n_samples
      params = dict(eps=1e-3, tol=tol, l1_ratio=l1_ratio)
  
      # one alpha
      alpha = alpha_max / 100.0
      alphas1, coefs1, gaps1 = celer_path(
          X,
          y,
          "lasso",
          alphas=[alpha],
          prune=prune,
          max_iter=30,
          **params,
      )
  
      alphas2, coefs2, _ = enet_path(
          X, y, max_iter=10000, alphas=[alpha], **params
      )
  
      assert_equal(alphas1, alphas2)
      assert_array_less(gaps1, tol * norm(y) ** 2 / n_samples)
      assert_allclose(coefs1, coefs2, rtol=1e-3, atol=1e-4)
  
      # many alphas
      n_alphas = 20
      alphas1, coefs1, gaps1 = celer_path(
          X,
          y,
          "lasso",
          n_alphas=n_alphas,
          prune=prune,
          max_iter=30,
          **params,
      )
  
      alphas2, coefs2, _ = enet_path(
          X, y, max_iter=10000, n_alphas=n_alphas, **params
      )
  
      assert_allclose(alphas1, alphas2)
      assert_array_less(gaps1, tol * norm(y) ** 2 / n_samples)
      assert_allclose(coefs1, coefs2, rtol=1e-3, atol=1e-4)
  
file_path: celer/celer/tests/test_enet.py
imports: from itertools import product
  import pytest
  import numpy
  from numpy.linalg import norm
  from numpy.testing import assert_allclose, assert_array_less, assert_equal
  from sklearn.linear_model import enet_path, ElasticNet, ElasticNetCV
  from celer import Lasso, ElasticNet, celer_path, ElasticNetCV
  from celer.utils.testing import build_dataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_sk_enet_path_equivalence(prune) without return types