def parse_interval(val):
re_intv = re.compile(r"<STR_LIT>")<EOL>val = val.strip()<EOL>total = <NUM_LIT:0.0><EOL>for match in re_intv.findall(val):<EOL><INDENT>unit = match[<NUM_LIT:1>]<EOL>count = float(match[<NUM_LIT:0>])<EOL>if unit == '<STR_LIT:s>':<EOL><INDENT>total += count<EOL><DEDENT>elif unit == '<STR_LIT:m>':<EOL><INDENT>total += count * <NUM_LIT><EOL><DEDENT>elif unit == '<STR_LIT>':<EOL><INDENT>total += count / <NUM_LIT:1000><EOL><DEDENT>elif unit == "<STR_LIT:h>":<EOL><INDENT>total += count * <NUM_LIT><EOL><DEDENT>elif unit == '<STR_LIT:d>':<EOL><INDENT>total += count * <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % val)<EOL><DEDENT><DEDENT>return total<EOL>
converts a string to float of seconds
    .5 = 500ms
    90 = 1m30s