code: def test_compute_min_changepoint_index_distance():
      # test functionality
      df = pd.DataFrame(
          {
              "ts": pd.date_range(start="2020-01-01", end="2020-01-30"),
              "y": list(range(30)),
          }
      )
      min_index_distance = compute_min_changepoint_index_distance(
          df=df,
          time_col="ts",
          n_changepoints=10,
          min_distance_between_changepoints="5D",
      )
      # two consecutive potential change points have distance 30/10 = 3 days
      # so need min_index_distance 2 to reach the desired distance "5D
      assert min_index_distance == 2
      # test no change points
      min_index_distance = compute_min_changepoint_index_distance(
          df=df,
          time_col="ts",
          n_changepoints=0,
          min_distance_between_changepoints="5D",
      )
      assert min_index_distance == df.shape[0]
      # test non-daily
      min_index_distance = compute_min_changepoint_index_distance(
          df=df,
          time_col="ts",
          n_changepoints=10,
          min_distance_between_changepoints="120H",
      )
      assert min_index_distance == 2  # same as the test above
      # test ValueError
      with pytest.raises(
          ValueError,
          match="In min_distance_between_changepoints, the maximal unit is 'D', "
          "i.e., you may use units no more than 'D' such as"
          "'10D', '5H', '100T', '200S'. The reason is that 'W', 'M' "
          "or higher has either cycles or indefinite number of days, "
          "thus is not parsable by pandas as timedelta.",
      ):
          compute_min_changepoint_index_distance(
              df=df,
              time_col="ts",
              n_changepoints=10,
              min_distance_between_changepoints="W",
          )
  
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 11 for calling a global function with example usage: test_compute_min_changepoint_index_distance() without return types