def total_seconds(timedelta):
    """For Python 2.6 compatibility.  Equivalent to
    :meth:`timedelta.total_seconds() <datetime.timedelta.total_seconds>`
    method which was introduced in Python 2.7.

    :param timedelta: the timedelta
    :type timedelta: :class:`datetime.timedelta`
    :returns: the total number of seconds contained in the duration

    """
    if not isinstance(timedelta, 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/operator `+` -> `/`