def total_seconds(td):
  secs = td.seconds + td.days * 24 * 3600
  if td.microseconds:
    secs += 1
  return secs
convert a timedelta to seconds.
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/ext/mapreduce/util.py/total_seconds