code: def test_expand_holiday_df_with_suffix(holiday_df):
      """Tests `expand_holiday_df_with_suffix` function."""
      # Tests the case when no change is made.
      expanded_holiday_df = (
          HolidayGrouper.expand_holiday_df_with_suffix(
              holiday_df=holiday_df,
              holiday_date_col=EVENT_DF_DATE_COL,
              holiday_name_col=EVENT_DF_LABEL_COL,
              holiday_impact_pre_num_days=0,
              holiday_impact_post_num_days=0,
              holiday_impact_dict=None,
              get_suffix_func=None,
          )
          .sort_values(by=[EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL])
          .reset_index(drop=True)
      )
  
      assert_equal(expanded_holiday_df, holiday_df)
  
      # When unknown holidays are present in `holiday_impact_dict`, result remains the same.
      expanded_holiday_df = (
          HolidayGrouper.expand_holiday_df_with_suffix(
              holiday_df=holiday_df,
              holiday_date_col=EVENT_DF_DATE_COL,
              holiday_name_col=EVENT_DF_LABEL_COL,
              holiday_impact_pre_num_days=0,
              holiday_impact_post_num_days=0,
              holiday_impact_dict={"unknown": [1, 1]},
              get_suffix_func=None,
          )
          .sort_values(by=[EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL])
          .reset_index(drop=True)
      )
  
      assert_equal(expanded_holiday_df, holiday_df)
  
      # Tests the case when only neighboring days are added and only through `holiday_impact_pre_num_days` and
      # `holiday_impact_post_num_days`.
      expanded_holiday_df = (
          HolidayGrouper.expand_holiday_df_with_suffix(
              holiday_df=holiday_df,
              holiday_date_col=EVENT_DF_DATE_COL,
              holiday_name_col=EVENT_DF_LABEL_COL,
              holiday_impact_pre_num_days=1,
              holiday_impact_post_num_days=2,
              holiday_impact_dict=None,
              get_suffix_func=None,
          )
          .sort_values(by=[EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL])
          .reset_index(drop=True)
      )
  
      # Spot checks a few events are being correctly added.
      assert (
          "Christmas Day_minus_1"
          in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
      assert (
          "New Year's Day_plus_2"
          in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
  
      # Checks the expected total number of events.
      expected_diff = len(holiday_df) * (1 + 2)
      assert len(expanded_holiday_df) - len(holiday_df) == expected_diff
  
      # Tests the case when only neighboring days are added and only through `holiday_impact_dict`.
      expanded_holiday_df = (
          HolidayGrouper.expand_holiday_df_with_suffix(
              holiday_df=holiday_df,
              holiday_date_col=EVENT_DF_DATE_COL,
              holiday_name_col=EVENT_DF_LABEL_COL,
              holiday_impact_pre_num_days=0,
              holiday_impact_post_num_days=0,
              holiday_impact_dict=HOLIDAY_IMPACT_DICT,
              get_suffix_func=None,
          )
          .sort_values(by=[EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL])
          .reset_index(drop=True)
      )
  
      # Spot checks a few events are being correctly added.
      assert (
          "Christmas Day_minus_4"
          in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
      assert (
          "New Year's Day_plus_4"
          in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
  
      # Checks the expected total number of events.
      expected_diff = 0
      for event, (pre, post) in HOLIDAY_IMPACT_DICT.items():
          count = (holiday_df[EVENT_DF_LABEL_COL] == event).sum()
          additional_days = (pre + post) * count
          expected_diff += additional_days
      assert len(expanded_holiday_df) - len(holiday_df) == expected_diff
  
      # Tests the case when neighboring days are added through `holiday_impact_pre_num_days`,
      # `holiday_impact_post_num_days` and `holiday_impact_dict`.
      expanded_holiday_df = (
          HolidayGrouper.expand_holiday_df_with_suffix(
              holiday_df=holiday_df,
              holiday_date_col=EVENT_DF_DATE_COL,
              holiday_name_col=EVENT_DF_LABEL_COL,
              holiday_impact_pre_num_days=8,
              holiday_impact_post_num_days=0,
              holiday_impact_dict=HOLIDAY_IMPACT_DICT,
              get_suffix_func=None,
          )
          .sort_values(by=[EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL])
          .reset_index(drop=True)
      )
  
      # Spot checks a few events are being correctly added or not added.
      assert (
          "Veterans Day_minus_8"
          in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
      assert (
          "Veterans Day_plus_1"
          not in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
      assert (
          "New Year's Day_plus_4"
          in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
      assert (
          "New Year's Day_minus_8"
          not in expanded_holiday_df[EVENT_DF_LABEL_COL].tolist()
      )
  
      # Checks the expected total number of events.
      expected_diff = (
          len(
              holiday_df[
                  ~holiday_df[EVENT_DF_LABEL_COL].isin(
                      HOLIDAY_IMPACT_DICT.keys()
                  )
              ]
          )
          * 8
      )
      for event, (pre, post) in HOLIDAY_IMPACT_DICT.items():
          count = (holiday_df[EVENT_DF_LABEL_COL] == event).sum()
          additional_days = (pre + post) * count
          expected_diff += additional_days
      assert len(expanded_holiday_df) - len(holiday_df) == expected_diff
  
      # Tests the case when both neighboring days and suffixes are added.
      expanded_holiday_df = (
          HolidayGrouper.expand_holiday_df_with_suffix(
              holiday_df=holiday_df,
              holiday_date_col=EVENT_DF_DATE_COL,
              holiday_name_col=EVENT_DF_LABEL_COL,
              holiday_impact_pre_num_days=0,
              holiday_impact_post_num_days=0,
              holiday_impact_dict=HOLIDAY_IMPACT_DICT,
              get_suffix_func=get_weekday_weekend_suffix,
          )
          .sort_values(by=[EVENT_DF_DATE_COL, EVENT_DF_LABEL_COL])
          .reset_index(drop=True)
      )
  
      # Checks an instance where New Year's Day falls on Friday.
      idx = expanded_holiday_df["event_name"].str.contains(
          "New Year's Day_WD_plus_1_WE"
      )
      assert expanded_holiday_df.loc[idx, EVENT_DF_DATE_COL].values[
          0
      ] == pd.to_datetime("2010-01-02")
      assert expanded_holiday_df.loc[idx, EVENT_DF_DATE_COL].values[
          1
      ] == pd.to_datetime("2016-01-02")
  
      # Checks an instance where Christmas Day falls on Sunday and is observed on Monday.
      idx = expanded_holiday_df["event_name"].str.contains(
          "Christmas Day_WE_plus_1_WD"
      )
      assert expanded_holiday_df.loc[idx, EVENT_DF_DATE_COL].values[
          0
      ] == pd.to_datetime("2011-12-26")
      assert expanded_holiday_df.loc[idx, EVENT_DF_DATE_COL].values[
          1
      ] == pd.to_datetime("2016-12-26")
  
      # Checks an instance where Labor Day always fall on Monday for all years.
      idx = expanded_holiday_df["event_name"].str.contains(
          "Labor Day_WD_minus_1_WE"
      )
      assert idx.sum() == 7
  
      # Tests unknown `get_suffix_func`.
      with pytest.raises(NotImplementedError, match="is not supported"):
          HolidayGrouper.expand_holiday_df_with_suffix(
              holiday_df=holiday_df,
              holiday_date_col=EVENT_DF_DATE_COL,
              holiday_name_col=EVENT_DF_LABEL_COL,
              holiday_impact_pre_num_days=0,
              holiday_impact_post_num_days=0,
              holiday_impact_dict=None,
              get_suffix_func="unknown",
          )
  
file_path: greykite/greykite/tests/algo/common/test_holiday_grouper.py
imports: import pandas
  import pytest
  from greykite.algo.common.holiday_grouper import HolidayGrouper
  from greykite.algo.common.holiday_utils import HOLIDAY_NAME_COL
  from greykite.algo.common.holiday_utils import get_weekday_weekend_suffix
  from greykite.common.constants import EVENT_DF_DATE_COL
  from greykite.common.constants import EVENT_DF_LABEL_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.data_loader import DataLoader
  from greykite.common.features.timeseries_features import get_holidays
  from greykite.common.python_utils import assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_expand_holiday_df_with_suffix(holiday_df) without return types