def _days_in_year(years, calendar):
    """The number of days in the year according to given calendar."""
    if calendar == "360_day":
        return full_like(years, 360)
    return _is_leap_year(years, calendar).astype(int) + 365
The number of days in the year according to given calendar.
xarray/coding/calendar_ops.py