Rewrite "days_remaining_in_year" in Python