code: def get_yearly_seasonality_changepoint_dates_from_freq(
      df,
      time_col,
      yearly_seasonality_change_freq,
      min_training_length="183D",
  ):
      """Gets the yearly seasonality changepoint dates from change frequency.
  
      This is an internal function used for varying yearly seasonality effects in
      `~greykite.algo.changepoint.adalasso.changepoint_detector.ChangepointDetector.find_trend_changepoints`
      For a given ``yearly_seasonality_change_freq``, for example "365D", it generates changepoint
      dates according to this frequency within the timeframe of ``df``. The length of data after the last
      changepoint date can not be less than ``least_training_length``.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          The data df.
      time_col : `str`
          The column name for time column in ``df``.
      yearly_seasonality_change_freq : `DateOffset`, `Timedelta` or `str` or `None`
          How often to change the yearly seasonality model, i.e., how often to place yearly seasonality
          changepoints.
          Note that if you use `str` as input, the maximal supported unit is day, i.e.,
          you might use "200D" but not "12M" or "1Y".
      min_training_length : `DateOffset`, `Timedelta` or `str` or `None`, default "183D"
          The minimum length between the last changepoint date and the last date of ``df[time_col]``.
          Changepoints too close to the end will be omitted. Recommended at least half a year.
          Note that if you use `str` as input, the maximal supported unit is day, i.e.,
          you might use "200D" but not "12M" or "1Y".
  
      Returns
      -------
      yearly_seasonality_changepoint_dates : `list` [ `pandas._libs.tslibs.timestamps.Timestamp` ]
          A list of yearly seasonality changepoint dates.
      """
      if yearly_seasonality_change_freq is None:
          return []
      check_freq_unit_at_most_day(
          yearly_seasonality_change_freq,
          "yearly_seasonality_change_freq",
      )
      yearly_seasonality_change_freq = to_offset(
          yearly_seasonality_change_freq
      )
      if yearly_seasonality_change_freq.delta < timedelta(days=365):
          warnings.warn(
              "yearly_seasonality_change_freq is less than a year. It might be too short "
              "to fit accurate yearly seasonality."
          )
      check_freq_unit_at_most_day(
          min_training_length, "least_training_length"
      )
      if min_training_length is not None:
          min_training_length = to_offset(min_training_length)
      else:
          min_training_length = to_offset("0D")
      first_day_in_df = pd.to_datetime(df[time_col].iloc[0])
      last_day_in_df = pd.to_datetime(df[time_col].iloc[-1])
      yearly_seasonality_changepoint_dates = list(
          pd.date_range(
              start=first_day_in_df,
              end=last_day_in_df - min_training_length,
              freq=yearly_seasonality_change_freq,
          )
      )[
          1:
      ]  # do not include the start date
      if len(yearly_seasonality_changepoint_dates) == 0:
          warnings.warn(
              "No yearly seasonality changepoint added. Either data length is too short "
              "or yearly_seasonality_change_freq is too long."
          )
      return yearly_seasonality_changepoint_dates
  
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 18 for calling a global function with example usage: get_yearly_seasonality_changepoint_dates_from_freq(df, time_col, yearly_seasonality_change_freq, min_training_length) and returns: yearly_seasonality_changepoint_dates, list