Create a Python function to calculate the day of the year for a specific date.
Your task is to create a Python function, `day_of_year`, that determines the day number of a particular date within a year. The function should take a date input in "YYYY-MM-DD" format, and return the day's position within the year. Don't forget to account for leap years! ### Parameters - `date` (str): A string representing a date in "YYYY-MM-DD" format. ### Return - The function should return an integer (`int`), representing the given date's day number within its respective year. The count begins from January 1, which is considered the first day of the year. ### Examples ```python # Example 1: # For August 8th, 2019, this was the 220th day of the year day_of_year("2019-08-08") # returns: 220 # Example 2: # For August 8th, 2020, this was the 221st day of the year, considering it was a leap year day_of_year("2020-08-08") # returns: 221 # Example 3: # For October 1, 2050, this will be the 274th day of the year day_of_year("2050-10-01") # returns: 274 ```