code: def test_infinite_weights(pb):
      n_samples, n_features = 50, 100
      X, y = build_dataset(n_samples, n_features)
      if pb == "logreg":
          y = np.sign(y)
  
      np.random.seed(1)
      weights = np.abs(np.random.randn(n_features))
      n_inf = n_features // 10
      inf_indices = np.random.choice(
          n_features, size=n_inf, replace=False
      )
      weights[inf_indices] = np.inf
  
      alpha = norm(X.T @ y / weights, ord=np.inf) / n_samples / 100
  
      tol = 1e-8
      _, coefs, dual_gaps = celer_path(
          X, y, pb=pb, alphas=[alpha], weights=weights, tol=tol
      )
  
      if pb == "logreg":
          assert_array_less(dual_gaps[0], tol * n_samples * np.log(2))
      else:
          assert_array_less(dual_gaps[0], tol * norm(y) ** 2 / 2.0)
  
      assert_array_equal(coefs[inf_indices], 0)
  
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 10 for calling a global function with example usage: test_infinite_weights(pb) without return types