code: def test_weights_group_lasso():
      n_samples, n_features = 30, 50
      X, y = build_dataset(n_samples, n_features, sparse_X=True)
  
      groups = 5
      n_groups = n_features // groups
      np.random.seed(0)
      weights = np.abs(np.random.randn(n_groups))
  
      tol = 1e-14
      params = {"n_alphas": 10, "tol": tol, "verbose": 1}
      augmented_weights = np.repeat(weights, groups)
  
      alphas1, coefs1, gaps1 = celer_path(
          X,
          y,
          "grouplasso",
          groups=groups,
          weights=weights,
          eps=1e-2,
          **params,
      )
      alphas2, coefs2, gaps2 = celer_path(
          X.multiply(1 / augmented_weights[None, :]),
          y,
          "grouplasso",
          groups=groups,
          eps=1e-2,
          **params,
      )
  
      assert_allclose(alphas1, alphas2)
      assert_allclose(
          coefs1, coefs2 / augmented_weights[:, None], rtol=1e-3
      )
      assert_array_less(gaps1, tol * norm(y) ** 2 / len(y))
      assert_array_less(gaps2, tol * norm(y) ** 2 / len(y))
  
imports: import pytest
  import itertools
  import numpy
  from numpy.linalg import norm
  from numpy.testing import assert_allclose, assert_array_less, assert_array_equal
  from sklearn.utils.estimator_checks import check_estimator
  from sklearn.linear_model import MultiTaskLassoCV
  from sklearn.linear_model import MultiTaskLasso
  from sklearn.linear_model import lasso_path
  from celer import Lasso, GroupLasso, GroupLassoCV, MultiTaskLasso, MultiTaskLassoCV
  from celer.homotopy import celer_path, mtl_path, _grp_converter
  from celer.group_fast import dnorm_grp
  from celer.utils.testing import build_dataset
label_desc: Use image node_id 10 for calling a global function with example usage: test_weights_group_lasso() without return types