from datetime import datetime


def get_latest_year() -> int:
    """
    Returns the last year if we are not in december yet otherwise
    returns the current year.
    """
    today = datetime.now()
    if today.month < 12:
        return today.year - 1
    return today.year