def td_to_seconds(delta):
    """
    Return the number of seconds of a time duration.
    """
    return float(delta.microseconds + (delta.seconds + delta.days * 24 * 
        3600) * 10 ** 6) / 10 ** 6
