def _total_seconds_backport(offset):
    seconds = offset.days * 24 * 60 * 60 + offset.seconds
    return seconds + offset.microseconds * 1e-6
Backport of timedelta.total_seconds() from python 2.7+.
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/_helpers.py/_total_seconds_backport