code: def test_celer_single_alpha(sparse_X, pb):
      X, y = build_dataset(
          n_samples=20, n_features=100, sparse_X=sparse_X
      )
      tol = 1e-6
  
      if pb == "logreg":
          y = np.sign(y)
          tol_scaled = tol * np.log(2) * len(y)
      else:
          tol_scaled = tol * norm(y) ** 2 / len(y)
  
      alpha_max = norm(X.T.dot(y), ord=np.inf) / X.shape[0]
      _, _, gaps = celer_path(
          X, y, pb, alphas=[alpha_max / 10.0], tol=tol
      )
      assert_array_less(gaps, tol_scaled)
  
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 6 for calling a global function with example usage: test_celer_single_alpha(sparse_X, pb) without return types