<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_total_seconds(td):
 """Python 2.6 backward compatibility function for timedelta.total_seconds. :type td: timedelta object :param td: timedelta object :rtype: float :return: The total number of seconds for the given timedelta object. """

    if hasattr(timedelta, "total_seconds"):
        return getattr(td, "total_seconds")()

    # Python 2.6 backward compatibility
    return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / float(10**6)