def METHOD_NAME(time_granularity: TimeGranularity, date: Union[pd.Timestamp, date]) -> bool:  # noqa: D
    pd_date = pd.Timestamp(date)
    if time_granularity is TimeGranularity.DAY:
        return True
    elif time_granularity is TimeGranularity.WEEK:
        return ISOWeekDay.from_pandas_timestamp(pd_date).is_week_end
    elif time_granularity is TimeGranularity.MONTH:
        return pd_date.is_month_end
    elif time_granularity is TimeGranularity.QUARTER:
        return pd_date.is_quarter_end
    elif time_granularity is TimeGranularity.YEAR:
        return pd_date.is_year_end
    else:
        assert_values_exhausted(time_granularity)