code: def get_changepoint_values_from_config(
      changepoints_dict, time_features_df, time_col=cst.TIME_COL
  ):
      """Applies the changepoint method specified in `changepoints_dict` to return the changepoint values
  
      :param changepoints_dict: Optional[Dict[str, any]]
          Specifies the changepoint configuration.
          "method": str
              The method to locate changepoints. Valid options:
                  "uniform". Places n_changepoints evenly spaced changepoints to allow growth to change.
                  "custom". Places changepoints at the specified dates.
              Additional keys to provide parameters for each particular method are described below.
          "continuous_time_col": Optional[str]
              Column to apply `growth_func` to, to generate changepoint features
              Typically, this should match the growth term in the model
          "growth_func": Optional[func]
              Growth function (scalar -> scalar). Changepoint features are created
              by applying `growth_func` to "continuous_time_col" with offsets.
              If None, uses identity function to use `continuous_time_col` directly
              as growth term
          If changepoints_dict["method"] == "uniform", this other key is required:
              "n_changepoints": int
                  number of changepoints to evenly space across training period
          If changepoints_dict["method"] == "custom", this other key is required:
              "dates": Iterable[Union[int, float, str, datetime]]
                  Changepoint dates. Must be parsable by pd.to_datetime.
                  Changepoints are set at the closest time on or after these dates
                  in the dataset.
      :param time_features_df: pd.Dataframe
          training dataset. contains column "continuous_time_col"
      :param time_col: str
          The column name in `time_features_df` representing time for the time series data
          The time column can be anything that can be parsed by pandas DatetimeIndex
          Used only in the "custom" method.
      :return: np.array
          values of df[continuous_time_col] at the changepoints
      """
      changepoint_values = None
      if changepoints_dict is not None:
          valid_changepoint_methods = ["uniform", "custom"]
          changepoint_method = changepoints_dict.get("method")
          continuous_time_col = changepoints_dict.get(
              "continuous_time_col"
          )
  
          if changepoint_method is None:
              raise Exception("changepoint method must be specified")
  
          if changepoint_method not in valid_changepoint_methods:
              raise NotImplementedError(
                  f"changepoint method {changepoint_method} not recognized. "
                  f"Must be one of {valid_changepoint_methods}"
              )
  
          if changepoint_method == "uniform":
              if changepoints_dict["n_changepoints"] > 0:
                  params = (
                      {"continuous_time_col": continuous_time_col}
                      if continuous_time_col is not None
                      else {}
                  )
                  changepoint_values = (
                      get_evenly_spaced_changepoints_values(
                          df=time_features_df,
                          n_changepoints=changepoints_dict[
                              "n_changepoints"
                          ],
                          **params,
                      )
                  )
          elif changepoint_method == "custom":
              params = {}
              if time_col is not None:
                  params["time_col"] = time_col
              if continuous_time_col is not None:
                  params["continuous_time_col"] = continuous_time_col
              changepoint_values = get_custom_changepoints_values(
                  df=time_features_df,
                  changepoint_dates=changepoints_dict["dates"],
                  **params,
              )
  
      return changepoint_values
  
imports: import math
  from datetime import datetime
  from datetime import timedelta
  import numpy
  import pandas
  import pytz
  from holidays_ext import get_holidays
  from pandas.tseries.frequencies import to_offset
  from scipy.special import expit
  from greykite.common import constants
  from greykite.common.python_utils import split_offset_str
label_desc: Use image node_id 22 for calling a global function with example usage: get_changepoint_values_from_config(changepoints_dict, time_features_df, time_col) and returns: changepoint_values