code: def test_get_auto_holiday_non_daily_df(df_hourly):
      """Tests automatic holidays for data frequency different from daily."""
  
      # Initializes inputs that will be used in all cases.
      start_year = 2010
      end_year = 2019
      pre_num = 2
      post_num = 2
      holiday_lookup_countries = ["US"]
      pre_post_num_dict = {}
  
      # Constructs `daily_event_df_dict` through `get_auto_holidays` with country list with hourly data.
      daily_event_df_dict_hourly = get_auto_holidays(
          df=df_hourly,
          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=None,
          daily_event_df_dict=None,
          auto_holiday_params=None,
      )
  
      # Aggregates hourly data to daily and checks if the resulted `daily_event_df_dict` is the same
      df_tmp = df_hourly.resample("D", on=TIME_COL).agg(
          {VALUE_COL: np.nanmean}
      )
      df_daily_reconstructed = (
          df_tmp.drop(columns=TIME_COL).reset_index()
          if TIME_COL in df_tmp.columns
          else df_tmp.reset_index()
      )
  
      daily_event_df_dict_daily_reconstructed = get_auto_holidays(
          df=df_daily_reconstructed,
          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=None,
          daily_event_df_dict=None,
          auto_holiday_params=None,
      )
  
      assert_equal(
          daily_event_df_dict_hourly,
          daily_event_df_dict_daily_reconstructed,
      )
  
      # Aggregates hourly data to weekly and check that the correct error will be raised.
      df_tmp = df_hourly.resample("W", on=TIME_COL).agg(
          {VALUE_COL: np.nanmean}
      )
      df_weekly_reconstructed = (
          df_tmp.drop(columns=TIME_COL).reset_index()
          if TIME_COL in df_tmp.columns
          else df_tmp.reset_index()
      )
  
      with pytest.raises(ValueError, match="frequency less than daily"):
          get_auto_holidays(
              df=df_weekly_reconstructed,
              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=None,
              daily_event_df_dict=None,
              auto_holiday_params=None,
          )
  
imports: import numpy
  import pandas
  import pytest
  from greykite.algo.common.holiday_grouper import HolidayGrouper
  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.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 8 for calling a global function with example usage: test_get_auto_holiday_non_daily_df(df_hourly) without return types