code: def get_default_changepoints_dict(
      changepoints_method, num_days, forecast_horizon_in_days
  ):
      """Get a changepoint dictionary based on the number of days in the observed
      timeseries and forecast horizon length in days to be provided as input to
      `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
      For the "uniform" method, we place the change points at a distance of
      ``max(28, forecast_horizon)``.
      For the "auto" method, we have used some defaults which seem to work for general
      applications::
  
          changepoints_dict = {
              "method": "auto",
              "yearly_seasonality_order": 10,
              "resample_freq": "7D",
              "regularization_strength": 0.8,
              "actual_changepoint_min_distance": "14D",
              "potential_changepoint_distance": "7D",
              "no_changepoint_distance_from_end": "14D"}
  
      If the length of data is smaller than ``2*max(28, forecast_horizon)``,
      the function will return None for all methods.
  
      Parameters
      ----------
      changepoints_method : `str`
          The method to locate changepoints.
          Valid options:
  
              - "uniform". Places changepoints evenly spaced changepoints to allow
              growth to change. The distance between the uniform change points is
              set to be ``max(28, forecast_horizon)``
              - "auto". Automatically detects change points.
              For configuration, see
              `~greykite.algo.changepoint.adalasso.changepoint_detector.ChangepointDetector.find_trend_changepoints`
  
          For more details for both methods, also check the documentation for
          `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
      num_days : `int`
          Number of days appearing in the observed timeseries.
      forecast_horizon_in_days : `float`
          The length of the forecast horizon in days.
  
      Returns
      -------
      changepoints_dict : `dict` or None
          A dictionary with change points information to be used as input to
          `~greykite.algo.forecast.silverkite.forecast_silverkite.SilverkiteForecast.forecast`.
          See that function's documentation for more details.
      """
  
      changepoints_dict = None
      # A reasonable distance defined based on ``forecast_horizon``
      # Here the minimum is set at 28 days
      uniform_distance = max(28, forecast_horizon_in_days)
      # Number of change points for "uniform"
      # Also if this number is zero both methods will return `None`
      changepoint_num = num_days // uniform_distance - 1
  
      if changepoint_num > 0:
          if changepoints_method == "uniform":
              changepoints_dict = {
                  "method": "uniform",
                  "n_changepoints": changepoint_num,
                  "continuous_time_col": TimeFeaturesEnum.ct1.value,
                  "growth_func": lambda x: x,
              }
  
          elif changepoints_method == "auto":
              changepoints_dict = {
                  "method": "auto",
                  "yearly_seasonality_order": 10,
                  "resample_freq": "7D",
                  "regularization_strength": 0.8,
                  "actual_changepoint_min_distance": "14D",
                  "potential_changepoint_distance": "7D",
                  "no_changepoint_distance_from_end": "14D",
              }
  
      return changepoints_dict
  
file_path: greykite/greykite/algo/forecast/silverkite/forecast_silverkite_helper.py
imports: import math
  import warnings
  from typing import List
  from typing import Optional
  import pandas
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.enums import SimpleTimeFrequencyEnum
  from greykite.common.features.timeseries_features import build_time_features_df
  from greykite.common.features.timeseries_features import get_default_origin_for_time_vars
label_desc: Use image node_id 2 for calling a global function with example usage: get_default_changepoints_dict(changepoints_method, num_days, forecast_horizon_in_days) and returns: changepoints_dict