code: def test_ElasticNet_Lasso_equivalence(sparse_X):
      n_samples, n_features = 50, 100
      X, y = build_dataset(n_samples, n_features, sparse_X=sparse_X)
      alpha_max = norm(X.T @ y, ord=np.inf) / n_samples
  
      alpha = alpha_max / 100.0
      coef_lasso = Lasso(alpha=alpha).fit(X, y).coef_
      coef_enet = ElasticNet(alpha=alpha, l1_ratio=1.0).fit(X, y).coef_
  
      assert_allclose(coef_lasso, coef_enet)
  
      np.random.seed(0)
      weights = abs(np.random.randn(n_features))
      alpha_max = norm(X.T @ y / weights, ord=np.inf) / n_samples
  
      alpha = alpha_max / 100.0
      coef_lasso = Lasso(alpha=alpha, weights=weights).fit(X, y).coef_
      coef_enet = (
          ElasticNet(alpha=alpha, l1_ratio=1.0, weights=weights)
          .fit(X, y)
          .coef_
      )
  
      assert_allclose(coef_lasso, coef_enet)
  
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 2 for calling a global function with example usage: test_ElasticNet_Lasso_equivalence(sparse_X) without return types