import calendar


def get_leap_years(start_year=1980, end_year=2050):

    """
    Gets the number of calendar days by year, either 365 or 366

    Args:
        start_year (Optional[int])
        end_year (Optional[int])

    Returns:
        Dictionary, with keys --> values as yyyy --> n days
    """

    leap_year_dict = dict()

    for yyyy in range(start_year, end_year):

        if calendar.isleap(yyyy):
            leap_year_dict[yyyy] = 366
        else:
            leap_year_dict[yyyy] = 365

    return leap_year_dict