code: def test_celer_path(sparse_X, alphas, pb, dtype):
      """Test Lasso path convergence."""
      X, y = build_dataset(
          n_samples=30, n_features=50, sparse_X=sparse_X
      )
      X = X.astype(dtype)
      y = y.astype(dtype)
  
      tol = 1e-6
      if pb == "logreg":
          y = np.sign(y)
          tol_scaled = tol * len(y) * np.log(2)
      else:
          tol_scaled = tol * norm(y) ** 2 / len(y)
      n_samples = X.shape[0]
      if alphas is not None:
          alpha_max = np.max(np.abs(X.T.dot(y))) / n_samples
          n_alphas = 10
          alphas = alpha_max * np.logspace(0, -2, n_alphas)
  
      alphas, _, gaps, _, n_iters = celer_path(
          X,
          y,
          pb,
          alphas=alphas,
          tol=tol,
          return_thetas=True,
          verbose=1,
          return_n_iter=True,
      )
      assert_array_less(gaps, tol_scaled)
      # hack because array_less wants strict inequality
      assert_array_less(0.99, n_iters)
  
imports: import warnings
  from itertools import product
  import numpy
  from numpy.linalg import norm
  from numpy.testing import assert_allclose, assert_array_less, assert_array_equal
  import pytest
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.linear_model import LassoCV, Lasso, lasso_path
  from celer import celer_path
  from celer.dropin_sklearn import Lasso, LassoCV
  from celer.utils.testing import build_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_celer_path(sparse_X, alphas, pb, dtype) without return types