class_docstr: A derived class of `~greykite.algo.forecast.silverkite.SilverkiteForecast`.
  Provides an alternative interface with simplified configuration parameters.
  Produces the same trained model output and uses the same predict functions.
class_docstr_tok: ["A","derived","class","of","`","~greykite.algo.forecast.silverkite.SilverkiteForecast","`",".","Provides","an","alternative","interface","with","simplified","configuration","parameters",".","Produces","the","same","trained","model","output","and","uses","the","same","predict","functions","."]
docstr: Generates holidays dictionary for input to daily_event_df_dict parameter of silverkite model.
  The main purpose is to provide reasonable defaults for the holiday names and countries
  
  Parameters
  ----------
  auto_holiday : `bool`, default False
      If `True`, an algorithm is used to automatically infer the holiday configuration. Holiday groups will be constructed through
      estimated holiday effects for holidays and their neighboring days.
      For details, see `~greykite.algo.common.holiday_grouper.HolidayGrouper`.
      If `False`, the specified holiday configuration will be used to generate holiday features.
  holiday_lookup_countries : `list` [`str`] or "auto" or None, optional, default "auto"
      The countries that contain the holidays you intend to model.
  
      * If "auto", uses a default list of countries
        that contain the default ``holidays_to_model_separately``.
        See `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.HOLIDAY_LOOKUP_COUNTRIES_AUTO`.
      * If a list, must be a list of country names.
      * If None or an empty list, no holidays are modeled.
  
  holidays_to_model_separately : `list` [`str`] or "auto" or `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.ALL_HOLIDAYS_IN_COUNTRIES` or None, optional, default "auto"  # noqa: E501
      Which holidays to include in the model.
      The model creates a separate key, value for each item in ``holidays_to_model_separately`` and their neighboring
      days. If ``auto_holiday = False``, the other holidays in the countries are grouped together as a single effect.
      If ``auto_holiday = True``, the other holidays will be processed by ``HolidayGrouper`` and assigned to
      holiday groups based on their estimated impact.
  
          * If "auto", uses a default list of important holidays.
            See `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.HOLIDAYS_TO_MODEL_SEPARATELY_AUTO`.
          * If `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.ALL_HOLIDAYS_IN_COUNTRIES`,
            uses all available holidays in ``holiday_lookup_countries``. This can often create a model that has too many parameters,
            and should typically be avoided. This argument is only valid when ``auto_holiday = False``. When ``auto_holiday`` is
            set to `True`, a `ValueError` would be raised.
          * If a list, must be a list of holiday names.
          * If None or an empty list, all holidays in ``holiday_lookup_countries`` are grouped together
            as a single effect.
  
      Use ``holiday_lookup_countries`` to provide a list of countries where these holiday occur.
  start_year : `int`, default 2015
      Year of first training data point, used to generate holiday events.
  end_year : `int`, default 2030
      Year of last forecast data point, used to generate holiday events.
  pre_num : `int`, default 2
      Model holiday effects for ``pre_num`` days before the holiday. When ``auto_holiday = False``,
      this also applies to the holidays passed in through ``daily_event_df_dict``.
  post_num : `int`, default 2
      Model holiday effects for ``post_num`` days after the holiday. When ``auto_holiday = False``,
      this also applies to the holidays passed in through ``daily_event_df_dict``.
  pre_post_num_dict : `dict` [`str`, (`int`, `int`)] or None, default None
      Overrides ``pre_num`` and ``post_num`` for each holiday in
      ``holidays_to_model_separately``.
      For example, if ``holidays_to_model_separately`` contains "Thanksgiving" and "Labor Day",
      this parameter can be set to ``{"Thanksgiving": [1, 3], "Labor Day": [1, 2]}``,
      denoting that the "Thanksgiving" ``pre_num`` is 1 and ``post_num`` is 3, and "Labor Day"
      ``pre_num`` is 1 and ``post_num`` is 2.
      Holidays not specified use the default given by ``pre_num`` and ``post_num``.
  auto_holiday_params : `dict` or None, default None
      This dictionary takes in parameters that can be passed in and used by holiday grouper when
      ``auto_holiday`` is set to `True`. When ``auto_holiday = False``, this will not be used. Please see
      `~greykite.algo.forecast.silverkite.forecast_simple_silverkite.SimpleSilverkiteForecast.__get_silverkite_holidays`
      for more details.
  df : `pandas.DataFrame` or None, default None.
      The timeseries data that will be used by default for automatically inferring holiday configuration. This
       will not be used if external ``df`` is specified through ``auto_holiday_params``.
      This is not used when ``auto_holiday`` is `False`.
  time_col : `str`, default `cst.TIME_COL`
      The column name for timestamps in ``df``. This will not be used if ``time_col`` is specified through
      ``auto_holiday_params``.
      This is not used when ``auto_holiday`` is `False`.
  value_col : `str`, default `cst.VALUE_COL`
      The column name for values in ``df``. This will not be used if ``value_col`` is specified through
      ``auto_holiday_params``.
      This is not used when ``auto_holiday`` is `False`.
  daily_event_df_dict : `dict` [`str`, `pandas.DataFrame`] or None, default None
      A dictionary of data frames, each representing events data for the corresponding key.
      Specifies additional events to include besides the holidays specified by other holiday configurations.
      If ``auto_holiday`` is set to `False`, it will be directly appended to the returned result, and the
      format is the same as in `~greykite.algo.forecast.silverkite.SilverkiteForecast.forecast`.
      If ``auto_holiday`` is set to `True`, it provides a list of holidays that will be processed and
      passed in as inputs for ``HolidayGrouper``.
  
  Returns
  -------
  daily_event_df_dict : `dict` [`str`, `pandas.DataFrame` [EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL]]
      Suitable for use as ``daily_event_df_dict`` parameter in ``forecast_silverkite``.
      Each holiday is modeled as its own effect (not specific to each country).
  
  See Also
  --------
  `~greykite.common.features.timeseries_features.get_available_holiday_lookup_countries`
  to list available countries for modeling.
  
  `~greykite.common.features.timeseries_features.get_available_holidays_across_countries`
  to see available holidays in those countries.
code: def __get_silverkite_holidays(
      self,
      auto_holiday=False,
      holiday_lookup_countries="auto",
      holidays_to_model_separately="auto",
      start_year=2015,
      end_year=2030,
      pre_num=2,
      post_num=2,
      pre_post_num_dict=None,
      auto_holiday_params=None,
      df=None,
      time_col=cst.TIME_COL,
      value_col=cst.VALUE_COL,
      daily_event_df_dict=None,
  ):
      """Generates holidays dictionary for input to daily_event_df_dict parameter of silverkite model.
      The main purpose is to provide reasonable defaults for the holiday names and countries
  
      Parameters
      ----------
      auto_holiday : `bool`, default False
          If `True`, an algorithm is used to automatically infer the holiday configuration. Holiday groups will be constructed through
          estimated holiday effects for holidays and their neighboring days.
          For details, see `~greykite.algo.common.holiday_grouper.HolidayGrouper`.
          If `False`, the specified holiday configuration will be used to generate holiday features.
      holiday_lookup_countries : `list` [`str`] or "auto" or None, optional, default "auto"
          The countries that contain the holidays you intend to model.
  
          * If "auto", uses a default list of countries
            that contain the default ``holidays_to_model_separately``.
            See `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.HOLIDAY_LOOKUP_COUNTRIES_AUTO`.
          * If a list, must be a list of country names.
          * If None or an empty list, no holidays are modeled.
  
      holidays_to_model_separately : `list` [`str`] or "auto" or `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.ALL_HOLIDAYS_IN_COUNTRIES` or None, optional, default "auto"  # noqa: E501
          Which holidays to include in the model.
          The model creates a separate key, value for each item in ``holidays_to_model_separately`` and their neighboring
          days. If ``auto_holiday = False``, the other holidays in the countries are grouped together as a single effect.
          If ``auto_holiday = True``, the other holidays will be processed by ``HolidayGrouper`` and assigned to
          holiday groups based on their estimated impact.
  
              * If "auto", uses a default list of important holidays.
                See `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.HOLIDAYS_TO_MODEL_SEPARATELY_AUTO`.
              * If `~greykite.algo.forecast.silverkite.constants.silverkite_holiday.SilverkiteHoliday.ALL_HOLIDAYS_IN_COUNTRIES`,
                uses all available holidays in ``holiday_lookup_countries``. This can often create a model that has too many parameters,
                and should typically be avoided. This argument is only valid when ``auto_holiday = False``. When ``auto_holiday`` is
                set to `True`, a `ValueError` would be raised.
              * If a list, must be a list of holiday names.
              * If None or an empty list, all holidays in ``holiday_lookup_countries`` are grouped together
                as a single effect.
  
          Use ``holiday_lookup_countries`` to provide a list of countries where these holiday occur.
      start_year : `int`, default 2015
          Year of first training data point, used to generate holiday events.
      end_year : `int`, default 2030
          Year of last forecast data point, used to generate holiday events.
      pre_num : `int`, default 2
          Model holiday effects for ``pre_num`` days before the holiday. When ``auto_holiday = False``,
          this also applies to the holidays passed in through ``daily_event_df_dict``.
      post_num : `int`, default 2
          Model holiday effects for ``post_num`` days after the holiday. When ``auto_holiday = False``,
          this also applies to the holidays passed in through ``daily_event_df_dict``.
      pre_post_num_dict : `dict` [`str`, (`int`, `int`)] or None, default None
          Overrides ``pre_num`` and ``post_num`` for each holiday in
          ``holidays_to_model_separately``.
          For example, if ``holidays_to_model_separately`` contains "Thanksgiving" and "Labor Day",
          this parameter can be set to ``{"Thanksgiving": [1, 3], "Labor Day": [1, 2]}``,
          denoting that the "Thanksgiving" ``pre_num`` is 1 and ``post_num`` is 3, and "Labor Day"
          ``pre_num`` is 1 and ``post_num`` is 2.
          Holidays not specified use the default given by ``pre_num`` and ``post_num``.
      auto_holiday_params : `dict` or None, default None
          This dictionary takes in parameters that can be passed in and used by holiday grouper when
          ``auto_holiday`` is set to `True`. When ``auto_holiday = False``, this will not be used. Please see
          `~greykite.algo.forecast.silverkite.forecast_simple_silverkite.SimpleSilverkiteForecast.__get_silverkite_holidays`
          for more details.
      df : `pandas.DataFrame` or None, default None.
          The timeseries data that will be used by default for automatically inferring holiday configuration. This
           will not be used if external ``df`` is specified through ``auto_holiday_params``.
          This is not used when ``auto_holiday`` is `False`.
      time_col : `str`, default `cst.TIME_COL`
          The column name for timestamps in ``df``. This will not be used if ``time_col`` is specified through
          ``auto_holiday_params``.
          This is not used when ``auto_holiday`` is `False`.
      value_col : `str`, default `cst.VALUE_COL`
          The column name for values in ``df``. This will not be used if ``value_col`` is specified through
          ``auto_holiday_params``.
          This is not used when ``auto_holiday`` is `False`.
      daily_event_df_dict : `dict` [`str`, `pandas.DataFrame`] or None, default None
          A dictionary of data frames, each representing events data for the corresponding key.
          Specifies additional events to include besides the holidays specified by other holiday configurations.
          If ``auto_holiday`` is set to `False`, it will be directly appended to the returned result, and the
          format is the same as in `~greykite.algo.forecast.silverkite.SilverkiteForecast.forecast`.
          If ``auto_holiday`` is set to `True`, it provides a list of holidays that will be processed and
          passed in as inputs for ``HolidayGrouper``.
  
      Returns
      -------
      daily_event_df_dict : `dict` [`str`, `pandas.DataFrame` [EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL]]
          Suitable for use as ``daily_event_df_dict`` parameter in ``forecast_silverkite``.
          Each holiday is modeled as its own effect (not specific to each country).
  
      See Also
      --------
      `~greykite.common.features.timeseries_features.get_available_holiday_lookup_countries`
      to list available countries for modeling.
  
      `~greykite.common.features.timeseries_features.get_available_holidays_across_countries`
      to see available holidays in those countries.
      """
      # Processes `holiday_lookup_countries`.
      if holiday_lookup_countries is None:
          # `None` will not model any holidays when `auto_holiday` is `False`. When `auto_holiday` is `True`, holidays
          # has to be passed in through `holiday_lookup_countries` and/or `daily_event_df_dict`.
          holiday_lookup_countries = []
      elif holiday_lookup_countries == "auto":
          # Countries that contain the default `holidays_to_model_separately`.
          holiday_lookup_countries = (
              self._silverkite_holiday.HOLIDAY_LOOKUP_COUNTRIES_AUTO
          )
      elif not isinstance(holiday_lookup_countries, (list, tuple)):
          raise ValueError(
              f"`holiday_lookup_countries` should be a list, found {holiday_lookup_countries}"
          )
  
      if auto_holiday:
          return get_auto_holidays(
              df=df,
              time_col=time_col,
              value_col=value_col,
              start_year=start_year,
              end_year=end_year,
              pre_num=pre_num,
              post_num=post_num,
              pre_post_num_dict=pre_post_num_dict,
              holiday_lookup_countries=holiday_lookup_countries,
              holidays_to_model_separately=holidays_to_model_separately,
              daily_event_df_dict=daily_event_df_dict,
              auto_holiday_params=auto_holiday_params,
          )
      else:
          # Processes `holidays_to_model_separately`.
          if holidays_to_model_separately is None:
              holidays_to_model_separately = []
          elif holidays_to_model_separately == "auto":
              # important holidays.
              holidays_to_model_separately = (
                  self._silverkite_holiday.HOLIDAYS_TO_MODEL_SEPARATELY_AUTO
              )
          elif (
              holidays_to_model_separately
              == self._silverkite_holiday.ALL_HOLIDAYS_IN_COUNTRIES
          ):
              holidays_to_model_separately = (
                  get_available_holidays_across_countries(
                      countries=holiday_lookup_countries,
                      year_start=start_year - 1,
                      year_end=end_year + 1,
                  )
              )
          elif not isinstance(
              holidays_to_model_separately, (list, tuple)
          ):
              raise ValueError(
                  f"`holidays_to_model_separately` should be a list, found {holidays_to_model_separately}"
              )
  
          holiday_df_dict = generate_holiday_events(
              countries=holiday_lookup_countries,
              holidays_to_model_separately=holidays_to_model_separately,
              year_start=start_year
              - 1,  # subtract 1 just in case, to ensure coverage of all holidays.
              year_end=end_year
              + 1,  # add 1 just in case, to ensure coverage of all holidays.
              pre_num=pre_num,
              post_num=post_num,
              pre_post_num_dict=pre_post_num_dict,
          )
  
          if holiday_df_dict is not None:
              # Adds holidays to the user-specified events,
              # giving preference to user events if there are conflicts.
              daily_event_df_dict = update_dictionary(
                  holiday_df_dict, overwrite_dict=daily_event_df_dict
              )
  
          if not daily_event_df_dict:
              # Sets empty dictionary to 'None'.
              daily_event_df_dict = None
  
          return daily_event_df_dict
  
imports: from datetime import datetime
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Type
  from typing import Union
  import pandas
  from greykite.algo.changepoint.adalasso.changepoint_detector import get_changepoints_dict
  from greykite.algo.forecast.silverkite.auto_config import get_auto_growth
  from greykite.algo.forecast.silverkite.auto_config import get_auto_holidays
  from greykite.algo.forecast.silverkite.auto_config import get_auto_seasonality
  from greykite.algo.forecast.silverkite.constants.silverkite_column import SilverkiteColumn
  from greykite.algo.forecast.silverkite.constants.silverkite_constant import SilverkiteConstant
  from greykite.algo.forecast.silverkite.constants.silverkite_constant import default_silverkite_constant
  from greykite.algo.forecast.silverkite.constants.silverkite_holiday import SilverkiteHoliday
  from greykite.algo.forecast.silverkite.constants.silverkite_time_frequency import SilverkiteTimeFrequencyEnum
  from greykite.algo.forecast.silverkite.forecast_silverkite import SilverkiteForecast
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import cols_interact
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import generate_holiday_events
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import get_event_pred_cols
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import patsy_categorical_term
  from greykite.common import constants
  from greykite.common.constants import GrowthColEnum
  from greykite.common.enums import SimpleTimeFrequencyEnum
  from greykite.common.enums import TimeEnum
  from greykite.common.features.timeseries_features import get_available_holidays_across_countries
  from greykite.common.features.timeseries_features import get_changepoint_features_and_values_from_config
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.common.python_utils import unique_elements_in_list
  from greykite.common.python_utils import update_dictionary
  from greykite.common.time_properties_forecast import get_forecast_time_properties
label_desc: Use image node_id 9 for calling the SimpleSilverkiteForecast obj's underlying member method code with example usage: obj.__get_silverkite_holidays(auto_holiday, holiday_lookup_countries, holidays_to_model_separately, start_year, end_year, pre_num, post_num, pre_post_num_dict, auto_holiday_params, df, time_col, value_col, daily_event_df_dict) and returns: get_auto_holidays, daily_event_df_dict