code: def test_combine_detected_and_custom_trend_changepoints():
      detected_changepoints = ["2020-01-01", "2020-02-05", "2020-07-03"]
      custom_changepoints = ["2020-01-05", "2020-04-13"]
      # tests no ``min_distance``
      combined_changepoints = (
          combine_detected_and_custom_trend_changepoints(
              detected_changepoint_dates=detected_changepoints,
              custom_changepoint_dates=custom_changepoints,
              min_distance=None,
              keep_detected=False,
          )
      )
      assert all(
          combined_changepoints
          == pd.to_datetime(
              [
                  "2020-01-01",
                  "2020-01-05",
                  "2020-02-05",
                  "2020-04-13",
                  "2020-07-03",
              ]
          )
      )
      # tests ``min_distance`` with ``keep_detected=False``
      combined_changepoints = (
          combine_detected_and_custom_trend_changepoints(
              detected_changepoint_dates=detected_changepoints,
              custom_changepoint_dates=custom_changepoints,
              min_distance="5D",
              keep_detected=False,
          )
      )
      assert all(
          combined_changepoints
          == pd.to_datetime(
              ["2020-01-05", "2020-02-05", "2020-04-13", "2020-07-03"]
          )
      )
      # tests ``min_distance`` with ``keep_detected=True``
      combined_changepoints = (
          combine_detected_and_custom_trend_changepoints(
              detected_changepoint_dates=detected_changepoints,
              custom_changepoint_dates=custom_changepoints,
              min_distance="5D",
              keep_detected=True,
          )
      )
      assert all(
          combined_changepoints
          == pd.to_datetime(
              ["2020-01-01", "2020-02-05", "2020-04-13", "2020-07-03"]
          )
      )
      # tests empty input
      combined_changepoints = (
          combine_detected_and_custom_trend_changepoints(
              detected_changepoint_dates=detected_changepoints,
              custom_changepoint_dates=[],
              min_distance="5D",
              keep_detected=False,
          )
      )
      assert all(
          combined_changepoints
          == pd.to_datetime(["2020-01-01", "2020-02-05", "2020-07-03"])
      )
      combined_changepoints = (
          combine_detected_and_custom_trend_changepoints(
              detected_changepoint_dates=[],
              custom_changepoint_dates=custom_changepoints,
              min_distance="5D",
              keep_detected=False,
          )
      )
      assert all(
          combined_changepoints
          == pd.to_datetime(["2020-01-05", "2020-04-13"])
      )
  
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 20 for calling a global function with example usage: test_combine_detected_and_custom_trend_changepoints() without return types