code: def build_trend_feature_df_with_changes(
      df, time_col, origin_for_time_vars=None, changepoints_dict="auto"
  ):
      """A function to generate trend features from a given time series df.
  
      The trend features include columns of the format max(0, x-c_i), where c_i is the i-th change point value.
      If changepoints_dict has "method": "uniform", then n_changepoints change points plus the normal growth term are
      generated uniformly over the whole time period. This is recommended.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          The data df.
      time_col : `str'
          The column name of time column in ``df``, entries can be parsed with pd.to_datetime.
      origin_for_time_vars : `float` or `None`, default `None`
          Original continuous time value, if not provided, will be parsed from data.
      changepoints_dict: `str`: "auto" or `dict`, default "auto"
          Change point dictionary, compatible with
          `~greykite.common.features.timeseries_features.get_changepoint_features_and_values_from_config`
          If not provided, default is 100 change points evenly
          distributed over the whole time period.
  
      Returns
      -------
      df :  `pandas.DataFrame`
          Change point feature df with n_changepoints + 1 columns generated.
      """
      df = df.copy()
      # Gets changepoints features from config. Evenly distributed with n_changepoints specified is recommended.
      if origin_for_time_vars is None:
          origin_for_time_vars = get_default_origin_for_time_vars(
              df, time_col
          )
      if changepoints_dict == "auto":
          changepoints_dict = {
              "method": "uniform",
              "n_changepoints": 100,
          }
      changepoints = get_changepoint_features_and_values_from_config(
          df=df,
          time_col=time_col,
          changepoints_dict=changepoints_dict,
          origin_for_time_vars=origin_for_time_vars,
      )
      if changepoints["changepoint_values"] is None:
          # allows n_changepoints = 0
          changepoint_values = np.array([0])
      else:
          changepoint_values = np.concatenate(
              [[0], changepoints["changepoint_values"]]
          )
      growth_func = changepoints["growth_func"]
      features_df = add_time_features_df(
          df=df,
          time_col=time_col,
          conti_year_origin=origin_for_time_vars,
      )
      changepoint_dates = get_changepoint_dates_from_changepoints_dict(
          changepoints_dict=changepoints_dict, df=df, time_col=time_col
      )
      changepoint_dates = [
          pd.to_datetime(df[time_col].iloc[0])
      ] + changepoint_dates
      changepoint_features_df = get_changepoint_features(
          features_df,
          changepoint_values,
          continuous_time_col=TimeFeaturesEnum.ct1.value,
          growth_func=growth_func,
          changepoint_dates=changepoint_dates,
      )
      changepoint_features_df.index = pd.to_datetime(df[time_col])
      return changepoint_features_df
  
imports: import warnings
  from datetime import timedelta
  import numpy
  import pandas
  import plotly.graph_objects
  from pandas.plotting import register_matplotlib_converters
  from pandas.tseries.frequencies import to_offset
  from sklearn.linear_model import Lasso
  from sklearn.linear_model import LassoCV
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model import RidgeCV
  from greykite.common.constants import CHANGEPOINT_COL_PREFIX
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.features.timeseries_features import add_time_features_df
  from greykite.common.features.timeseries_features import build_time_features_df
  from greykite.common.features.timeseries_features import fourier_series_multi_fcn
  from greykite.common.features.timeseries_features import get_changepoint_dates_from_changepoints_dict
  from greykite.common.features.timeseries_features import get_changepoint_features
  from greykite.common.features.timeseries_features import get_changepoint_features_and_values_from_config
  from greykite.common.features.timeseries_features import get_default_origin_for_time_vars
  from greykite.common.python_utils import get_pattern_cols
  from greykite.common.python_utils import unique_elements_in_list
label_desc: Use image node_id 2 for calling a global function with example usage: build_trend_feature_df_with_changes(df, time_col, origin_for_time_vars, changepoints_dict) and returns: changepoint_features_df