def _convert_life_span_string(life_span_string):
 (d, h, m, s) = TIME_RE.match(life_span_string).groups()
 times = [(s, 1), (m, 60), (h, 3600), (d, 86400)]
 return sum(((int((t[0] or 0)) * t[1]) for t in times))

def _convert_life_span_string ( life_span_string ) : ( d , h , m , s ) = TIME_RE . match ( life_span_string ) . groups ( ) times = [ ( s , 1 ) , ( m , 60 ) , ( h , 3600 ) , ( d , 86400 ) ] return sum ( ( ( int ( ( t [ 0 ] or 0 ) ) * t [ 1 ] ) for t in times ) )
converts a time_re compatible life span string .