def _time_to_seconds_past_midnight(time_expr):
 if (time_expr is None):
  return None
 if (time_expr.count(':') == 1):
  time_expr += ':00'
 (hour, minute, second) = [int(p, 10) for p in time_expr.split(':')]
 return ((((hour * 60) * 60) + (minute * 60)) + second)

def _time_to_seconds_past_midnight ( time_expr ) : if ( time_expr is None ) : return None if ( time_expr . count ( ':' ) == 1 ) : time_expr += ':00' ( hour , minute , second ) = [ int ( p , 10 ) for p in time_expr . split ( ':' ) ] return ( ( ( ( hour * 60 ) * 60 ) + ( minute * 60 ) ) + second )
parse a time expression to seconds after midnight .