code: def test_infinite_weights(fit_intercept):
      n_samples, n_features = 30, 100
      X, y = build_dataset(n_samples, n_features, sparse_X=False)
  
      np.random.seed(42)
      weights = abs(np.random.rand(n_features))
      n_inf = n_features // 5
      inf_indices = np.random.choice(
          n_features, size=n_inf, replace=False
      )
      weights[inf_indices] = np.inf
  
      reg = ElasticNet(
          l1_ratio=0.5,
          tol=1e-8,
          fit_intercept=fit_intercept,
          weights=weights,
      )
      reg.fit(X, y)
  
      assert_equal(reg.coef_[inf_indices], 0)
  
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 6 for calling a global function with example usage: test_infinite_weights(fit_intercept) without return types