<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def year_interval(year, milliseconds=False, return_string=False):
 """ Return a start datetime and end datetime of a year. :param milliseconds: Minimum time resolution. :param return_string: If you want string instead of datetime, set True Usage Example:: datetime(2007, 1, 1, 0, 0, 0) datetime(2007, 12, 31, 23, 59, 59) """

    if milliseconds:  # pragma: no cover
        delta = timedelta(milliseconds=1)
    else:
        delta = timedelta(seconds=1)

    start = datetime(year, 1, 1)
    end = datetime(year + 1, 1, 1) - delta

    if not return_string:
        return start, end
    else:
        return str(start), str(end)