#NEWLINE# def __timedelta_to_seconds( timedelta ) : #NEWLINE# #INDENT# ms = ( 10 ** 6 ) #NEWLINE# days = ( ( 24 * 60 ) * 60 ) #NEWLINE# ms_as_seconds = ( float ( timedelta . microseconds ) / days_as_seconds ) #NEWLINE# seconds = float ( timedelta . seconds ) #NEWLINE# days_as_seconds = ( float ( timedelta . days ) * days ) #NEWLINE# total_seconds = sum ( ( ms_as_seconds , seconds , days_as_seconds ) ) #NEWLINE# return abs ( total_seconds )