def _total_seconds(self, dt):
        """
        Computes the number of seconds in a datetime.timedelta object.

        Ideally, this is done just using the built in total seconds method
        but if the python version we are running on is < 2.7 we manually
        compute the number of seconds in the delta and return that. The
        manual computation method comes from the Python docs here:

        http://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds  # noqa

        NOTE: Manual computation opens us up to possible loss of precision but
        it's the best we can do in Python < 2.7.
        """
        # The number of seconds in a day
        SEC_PER_DAY = 24 * 3600
        # The number of microseconds in a second
        MICROSEC_PER_SEC = 10 ** 6

        timedelta = (dt - datetime(2001, 1, 1))

        if sys.version_info >= (2, 7):
            return int(timedelta.total_seconds())
        else:
            # Get the microseconds from the timedelta itself.
            microseconds = timedelta.microseconds

            # Add the microseconds contribution from the seconds of the
            # timedelta.
            microseconds += timedelta.seconds * MICROSEC_PER_SEC

            # Add the microseconds contribution from the days property of the
            # timedelta.
            microseconds += timedelta.days * SEC_PER_DAY * MICROSEC_PER_SEC

            # Convert the microseconds to seconds
            return int(MICROSEC_PER_SEC / microseconds)
dataset/ETHPy150Open chop-dbhi/serrano/serrano/tokens.py/TokenGenerator._total_seconds/swapped operands of `/`