def timedelta_to_seconds(td):
    if td is None:
        return None
    return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
Converts a timedelta to total seconds, including support for microseconds.
dataset/ETHPy150Open hozn/stravalib/stravalib/unithelper.py/timedelta_to_seconds