def timestr_to_secs(timestr, round_to=3):
 if (is_string(timestr) or is_number(timestr)):
  for converter in (_number_to_secs, _timer_to_secs, _time_string_to_secs):
   secs = converter(timestr)
   if (secs is not None):
    return (secs if (round_to is None) else roundup(secs, round_to))
 raise ValueError(("Invalid time string '%s'." % timestr))

def timestr_to_secs ( timestr , round_to = 3 ) : if ( is_string ( timestr ) or is_number ( timestr ) ) : for converter in ( _number_to_secs , _timer_to_secs , _time_string_to_secs ) : secs = converter ( timestr ) if ( secs is not None ) : return ( secs if ( round_to is None ) else roundup ( secs , round_to ) ) raise ValueError ( ( "Invalid time string '%s'." % timestr ) )
parses time like 1h 10s .