def total_seconds(td):
    """
    Return the total number of seconds contained in the duration as a float
    """
    return (float(td.microseconds) + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6