code: def test_adaptive_lasso_cv():
      # test "ridge" as initial estimator
      x = np.random.randn(20, 5)
      y = np.random.randn(20)
      intercept, coef = adaptive_lasso_cv(
          x=x, y=y, initial_coef="ridge"
      )
      assert coef.shape[0] == 5
      assert intercept is not None
      # test "lasso" as initial estimator
      intercept, coef = adaptive_lasso_cv(
          x=x, y=y, initial_coef="lasso"
      )
      assert coef.shape[0] == 5
      assert intercept is not None
      # test "ols" as initial estimator
      intercept, coef = adaptive_lasso_cv(x=x, y=y, initial_coef="ols")
      assert coef.shape[0] == 5
      assert intercept is not None
      # test `numpy.array` as initial estimator
      initial_coef = np.array([1, 2, 3, 4, 5])
      intercept, coef = adaptive_lasso_cv(
          x=x, y=y, initial_coef=initial_coef
      )
      assert coef.shape[0] == 5
      assert intercept is not None
      # test given lambda for adaptive lasso
      intercept, coef = adaptive_lasso_cv(
          x=x, y=y, initial_coef="ridge", regularization_strength=1.0
      )
      assert coef.shape[0] == 5
      assert intercept is not None
      # tests no change point when ``regularization_strength`` == 1.0
      assert (coef != 0).sum() == 0
      _, coef = adaptive_lasso_cv(
          x=x, y=y, initial_coef="ridge", regularization_strength=0.0
      )
      # tests all change points present when ``regularization_strength`` == 0.0
      assert (coef != 0).sum() == 5
      # tests max_min_ratio
      # when we have greater max_min_ratio, the lambda that corresponds to regularization_strength=0.1
      # is smaller, thus we have more nonzero coefficients.
      _, coef1 = adaptive_lasso_cv(
          x=x, y=y, initial_coef="ridge", regularization_strength=0.1
      )
      _, coef2 = adaptive_lasso_cv(
          x=x,
          y=y,
          initial_coef="ridge",
          regularization_strength=0.1,
          max_min_ratio=1e100,
      )
      nonzeros1 = (coef1 != 0).sum()
      nonzeros2 = (coef2 != 0).sum()
      assert nonzeros1 <= nonzeros2
      # tests value error
      with pytest.raises(
          ValueError,
          match="regularization_strength must be between 0.0 and 1.0.",
      ):
          adaptive_lasso_cv(
              x=x, y=y, initial_coef="ridge", regularization_strength=-1
          )
  
imports: from datetime import datetime
  import numpy
  import pandas
  import pytest
  from greykite.algo.changepoint.adalasso.changepoints_utils import adaptive_lasso_cv
  from greykite.algo.changepoint.adalasso.changepoints_utils import build_seasonality_feature_df_from_detection_result
  from greykite.algo.changepoint.adalasso.changepoints_utils import build_seasonality_feature_df_with_changes
  from greykite.algo.changepoint.adalasso.changepoints_utils import build_trend_feature_df_with_changes
  from greykite.algo.changepoint.adalasso.changepoints_utils import check_freq_unit_at_most_day
  from greykite.algo.changepoint.adalasso.changepoints_utils import combine_detected_and_custom_trend_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import compute_fitted_components
  from greykite.algo.changepoint.adalasso.changepoints_utils import compute_min_changepoint_index_distance
  from greykite.algo.changepoint.adalasso.changepoints_utils import estimate_seasonality_with_detected_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import estimate_trend_with_detected_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import filter_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import find_neighbor_changepoints
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_changes_from_beta
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_seasonality_changepoint_df_cols
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_seasonality_changes_from_adaptive_lasso
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_trend_changepoint_dates_from_cols
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_trend_changes_from_adaptive_lasso
  from greykite.algo.changepoint.adalasso.changepoints_utils import get_yearly_seasonality_changepoint_dates_from_freq
  from greykite.algo.changepoint.adalasso.changepoints_utils import plot_change
  from greykite.common.testing_utils import generate_df_for_tests
label_desc: Use image node_id 8 for calling a global function with example usage: test_adaptive_lasso_cv() without return types