<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _timedelta_from_elements(elements):
 """ Return a timedelta from a dict of date elements. Accepts a dict containing any of the following: - years - months - days - hours - minutes - seconds If years and/or months are provided, it will use a naive calcuation of 365 days in a year and 30 days in a month. """

    days = sum((
        elements['days'],
        _months_to_days(elements.get('months', 0)),
        _years_to_days(elements.get('years', 0))
    ))

    return datetime.timedelta(days=days,
                              hours=elements.get('hours', 0),
                              minutes=elements.get('minutes', 0),
                              seconds=elements.get('seconds', 0))