def interval_decode(s):
 time = 0
 sign = 1
 s = s.strip()
 if s.startswith('-'):
  s = s[1:]
  sign = (-1)
 elif s.startswith('+'):
  s = s[1:]
 for match in allMatches(s, _timeRE):
  char = match.group(0)[(-1)].lower()
  if (char not in timeValues):
   continue
  time += (int(match.group(0)[:(-1)]) * timeValues[char])
 return time

def interval_decode ( s ) : time = 0 sign = 1 s = s . strip ( ) if s . startswith ( '-' ) : s = s [ 1 : ] sign = ( - 1 ) elif s . startswith ( '+' ) : s = s [ 1 : ] for match in allMatches ( s , _timeRE ) : char = match . group ( 0 ) [ ( - 1 ) ] . lower ( ) if ( char not in timeValues ) : continue time += ( int ( match . group ( 0 ) [ : ( - 1 ) ] ) * timeValues [ char ] ) return time
decodes a number in the format 1h4d3m into a number of seconds .