code: def test_lars_attributes(datatype, params):
      X, y = fetch_california_housing(return_X_y=True)
      X = X.astype(datatype)
      y = y.astype(datatype)
  
      culars = cuLars(**params)
      culars.fit(X, y)
  
      sklars = skLars(**params)
      sklars.fit(X, y)
  
      assert culars.score(X, y) >= sklars.score(X, y) - 0.01
  
      limit_max_iter = "n_nonzero_coefs" in params
      if limit_max_iter:
          n_iter_tol = 0
      else:
          n_iter_tol = 2
  
      assert abs(culars.n_iter_ - sklars.n_iter_) <= n_iter_tol
  
      tol = 1e-4 if params.pop("fit_intercept", True) else 1e-1
      n = min(culars.n_iter_, sklars.n_iter_)
      assert array_equal(
          culars.alphas_[:n],
          sklars.alphas_[:n],
          unit_tol=tol,
          total_tol=1e-4,
      )
      assert array_equal(culars.active_[:n], sklars.active_[:n])
  
      if limit_max_iter:
          assert array_equal(culars.coef_, sklars.coef_)
  
          if hasattr(sklars, "coef_path_"):
              assert array_equal(
                  culars.coef_path_,
                  sklars.coef_path_[sklars.active_],
                  unit_tol=1e-3,
              )
  
          intercept_diff = abs(culars.intercept_ - sklars.intercept_)
          if abs(sklars.intercept_) > 1e-6:
              intercept_diff /= sklars.intercept_
              assert intercept_diff <= 1e-3
  
file_path: cuml/python/cuml/tests/test_lars.py
imports: import sklearn
  from sklearn.linear_model import Lars
  from sklearn.datasets import fetch_california_housing
  from cuml.testing.utils import array_equal, unit_param, quality_param, stress_param
  from cuml.experimental.linear_model import Lars
  import sys
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
  from test_linear_model import make_regression_dataset
label_desc: Use image node_id 4 for calling a global function with example usage: test_lars_attributes(datatype, params) without return types