code: def generate_holiday_events(
      countries,
      holidays_to_model_separately,
      year_start,
      year_end,
      pre_num,
      post_num,
      pre_post_num_dict=None,
      default_category="Other",
  ):
      """Returns holidays within the countries between ``year_start`` and ``year_end``.
      Creates a separate key, value for each item in ``holidays_to_model_separately``.
      The rest are grouped together.
  
      Useful when multiple countries share the same holiday (e.g. New Year's Day),
      to model a single effect for that holiday.
  
      Parameters
      ----------
      countries : `list` [`str`]
          Countries of interest.
      holidays_to_model_separately : `list` [`str`]
          Holidays to model.
      year_start: `int`
          Start year for holidays.
      year_end: `int`
          Ending year for holidays.
      pre_num: `int`
          Days to model a separate effect prior to each holiday
      post_num: `int`
          Days to model a separate effect after each holiday.
      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``.
      default_category: `str`
          Default category name, for holidays in countries not included
          in ``holidays_to_model_separately``.
  
      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``
      """
      # retrieves separate DataFrame for each country, with list of holidays
      holidays_dict = get_holidays(
          countries, year_start=year_start, year_end=year_end
      )
      if (
          len(holidays_dict) == 0
      ):  # requested holidays are not found the countries
          daily_event_df_dict = None
      else:
          # merges country DataFrames, removes duplicate holidays
          holiday_df = dedup_holiday_dict(holidays_dict)
          # creates separate DataFrame for each holiday
          daily_event_df_dict = split_events_into_dictionaries(
              holiday_df,
              holidays_to_model_separately,
              default_category=default_category,
          )
  
          # Removes "'" from keys in `pre_post_num_dict` because they are
          # removed from holiday names by ``split_events_into_dictionaries``.
          if pre_post_num_dict:
              # ``.copy()`` is used below to avoid altering the dictionary keys within iteration on same keys
              keys = pre_post_num_dict.copy().keys()
              for key in keys:
                  new_key = key.replace("'", "")
                  if key not in daily_event_df_dict:
                      pre_post_num_dict[
                          new_key
                      ] = pre_post_num_dict.pop(key)
                  if new_key not in daily_event_df_dict:
                      warnings.warn(
                          f"Requested holiday '{new_key}' is not valid. Valid holidays are: "
                          f"{list(daily_event_df_dict.keys())}",
                          UserWarning,
                      )
  
          shifted_event_dict = add_event_window_multi(
              event_df_dict=daily_event_df_dict,
              time_col=EVENT_DF_DATE_COL,
              label_col=EVENT_DF_LABEL_COL,
              time_delta="1D",
              pre_num=pre_num,
              post_num=post_num,
              pre_post_num_dict=pre_post_num_dict,
          )
  
          daily_event_df_dict.update(shifted_event_dict)
      return daily_event_df_dict
  
file_path: greykite/greykite/algo/forecast/silverkite/forecast_simple_silverkite_helper.py
imports: import warnings
  import pandas
  from greykite.common import constants
  from greykite.common.constants import EVENT_DF_DATE_COL
  from greykite.common.constants import EVENT_DF_LABEL_COL
  from greykite.common.constants import EVENT_INDICATOR
  from greykite.common.features.timeseries_features import add_event_window_multi
  from greykite.common.features.timeseries_features import get_fourier_col_name
  from greykite.common.features.timeseries_features import get_holidays
  from greykite.common.python_utils import split_offset_str
label_desc: Use image node_id 4 for calling a global function with example usage: generate_holiday_events(countries, holidays_to_model_separately, year_start, year_end, pre_num, post_num, pre_post_num_dict, default_category) and returns: daily_event_df_dict