def ParseExpiration(expiration):
 delta = 0
 for match in re.finditer(_DELTA_REGEX, expiration):
  amount = int(match.group(1))
  units = _EXPIRATION_CONVERSIONS.get(match.group(2).lower(), 1)
  delta += (amount * units)
 return delta

def ParseExpiration ( expiration ) : delta = 0 for match in re . finditer ( _DELTA_REGEX , expiration ) : amount = int ( match . group ( 1 ) ) units = _EXPIRATION_CONVERSIONS . get ( match . group ( 2 ) . lower ( ) , 1 ) delta += ( amount * units ) return delta
parses an expiration delta string .