def METHOD_NAME(
    interval: timedelta, error: Exception, date_range: timedelta, top_events: int
) -> None:
    if interval.total_seconds() <= 0:
        raise error.__class__("Interval cannot result in a zero duration.")
    # When top events are present, there can be up to 5x as many points
    max_rollup_points = MAX_ROLLUP_POINTS if top_events == 0 else MAX_ROLLUP_POINTS / top_events
    if date_range.total_seconds() / interval.total_seconds() > max_rollup_points:
        raise error