code: def estimate_seasonality_with_detected_changepoints(
      df,
      time_col,
      value_col,
      seasonality_changepoints,
      seasonality_components_df,
      estimator="ols",
  ):
      """Estimates the seasonality effect with detected change points.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          The data df.
      time_col : `str`
          The column name of the time column in ``df``.
      value_col : `str`
          The column name of the value column in ``df``.
      seasonality_changepoints : `dict`
          The detected seasonality change points dictionary, output from
          `~greykite.algo.changepoint.adalasso.changepoints_utils.get_seasonality_changes_from_adaptive_lasso`
      seasonality_components_df : `pandas.DataFrame`
          The df to generate seasonality design matrix, which is compatible with
          ``seasonality_components_df`` in
          `~greykite.algo.changepoint.adalasso.changepoint_detector.ChangepointDetector.find_seasonality_changepoints`
      estimator : `str`, default "ols"
          "ols" or "ridge", the estimation model for seasonality estimation.
  
      Returns
      -------
      seasonality_estimate : `pandas.Series`
          The estimated seasonality.
      """
      seasonality_df = (
          build_seasonality_feature_df_from_detection_result(
              df=df,
              time_col=time_col,
              seasonality_changepoints=seasonality_changepoints,
              seasonality_components_df=seasonality_components_df,
          )
      )
      estimators = {"ridge": RidgeCV, "ols": LinearRegression}
      estimator = estimators.get(estimator)
      if estimator is None:
          raise ValueError(
              "estimator can only be either 'ridge' or 'ols'."
          )
      non_na_index = ~df[value_col].isnull().values
      model = estimator().fit(
          seasonality_df.values[non_na_index],
          df[value_col].values[non_na_index],
      )
      seasonality_estimate = model.predict(seasonality_df.values)
      seasonality_estimate = pd.Series(seasonality_estimate)
      seasonality_estimate.index = pd.to_datetime(df[time_col])
      return seasonality_estimate
  
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 15 for calling a global function with example usage: estimate_seasonality_with_detected_changepoints(df, time_col, value_col, seasonality_changepoints, seasonality_components_df, estimator) and returns: seasonality_estimate