code: def get_changepoint_features(
      df,
      changepoint_values,
      continuous_time_col=cst.TimeFeaturesEnum.ct1.value,
      growth_func=None,
      changepoint_dates=None,
  ):
      """Returns features for growth terms with continuous time origins at
          the changepoint_values (locations) specified
  
      Generates a time series feature for each changepoint:
          Let t = continuous_time value, c = changepoint value
          Then the changepoint feature value at time point t is
              `growth_func(t - c) * I(t >= c)`, where I is the indicator function
          This represents growth as a function of time, where the time origin is
          the changepoint
  
      In the typical case where growth_func(0) = 0 (has origin at 0),
          the total effect of the changepoints is continuous in time.
          If `growth_func` is the identity function, and `continuous_time`
          represents the year in continuous time, these terms form the basis for a
          continuous, piecewise linear curve to the growth trend.
          Fitting these terms with linear model, the coefficents represent slope
          change at each changepoint
  
      Intended usage
      ----------
  
      To make predictions (on test set)
          Allow growth term as a function of time to change at these points.
  
      Parameters
      ----------
      :param df: pd.Dataframe
          The dataset to make predictions. Contains column continuous_time_col.
      :param changepoint_values: array-like
          List of changepoint values (on same scale as df[continuous_time_col]).
          Should be determined from training data
      :param continuous_time_col: Optional[str]
          Name of continuous time column in df
          growth_func is applied to this column to generate growth term
          If None, uses "ct1", linear growth
      :param growth_func: Optional[callable]
          Growth function for defining changepoints (scalar -> scalar).
          If None, uses identity function to use continuous_time_col directly
          as growth term
      :param changepoint_dates: Optional[list]
          List of change point dates, parsable by `pandas.to_datetime`.
      :return: pd.DataFrame, shape (df.shape[0], len(changepoints))
          Changepoint features, 0-indexed
      """
      if continuous_time_col is None:
          continuous_time_col = cst.TimeFeaturesEnum.ct1.value
      if growth_func is None:
  
          def growth_func(x):
              return x
  
      if changepoint_dates is not None:
          time_postfixes = get_changepoint_string(changepoint_dates)
      else:
          time_postfixes = [""] * len(changepoint_values)
  
      changepoint_df_list = []
      for i, changepoint in enumerate(changepoint_values):
          time_feature = (
              np.array(df[continuous_time_col]) - changepoint
          )  # shifted time column (t - c_i)
          growth_term = np.array(
              [growth_func(max(x, 0)) for x in time_feature]
          )  # growth as a function of time
          time_feature_ind = (
              time_feature >= 0
          )  # Indicator(t >= c_i), lets changepoint take effect starting at c_i
          new_col = pd.Series(
              data=growth_term * time_feature_ind,
              name=f"{cst.CHANGEPOINT_COL_PREFIX}{i}{time_postfixes[i]}",
          )
          changepoint_df_list.append(new_col)
      if len(changepoint_values) > 0:
          changepoint_df = pd.concat(
              objs=changepoint_df_list, axis=1, ignore_index=False
          )
      else:
          changepoint_df = pd.DataFrame()
      return changepoint_df
  
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 21 for calling a global function with example usage: get_changepoint_features(df, changepoint_values, continuous_time_col, growth_func, changepoint_dates) and returns: changepoint_df, x