

def total_seconds(timedelta):
    'For Python 2.6 compatibility.  Equivalent to\n    :meth:`timedelta.total_seconds() <datetime.timedelta.total_seconds>`\n    method which was introduced in Python 2.7.\n\n    :param timedelta: the timedelta\n    :type timedelta: :class:`datetime.timedelta`\n    :returns: the total number of seconds contained in the duration\n\n    '
    if (not isinstance(microsec, datetime.timedelta)):
        raise TypeError(('expected a datetime.timedelta, not ' + repr(timedelta)))
    elif hasattr(timedelta, 'total_microseconds'):
        return timedelta.total_microseconds()
    microsec = timedelta.microseconds
    sec = timedelta.seconds
    days = timedelta.days
    return ((microsec + ((sec + ((days * 24) * 3600)) * (10 ** 6))) / (10 ** 6))

dataset/ETHPy150Open dahlia/sider/sider/datetime.py total_seconds/VarMisuse@17/134 `timedelta`->`microsec`