def normalize_time_unit(s):
 s = s.lower().strip()
 if (s in units):
  return s
 if (s in unit_aliases):
  return unit_aliases[s]
 if (s[(-1)] == 's'):
  return normalize_time_unit(s.rstrip('s'))
 raise ValueError(('Do not understand time unit %s' % s))

def normalize_time_unit ( s ) : s = s . lower ( ) . strip ( ) if ( s in units ) : return s if ( s in unit_aliases ) : return unit_aliases [ s ] if ( s [ ( - 1 ) ] == 's' ) : return normalize_time_unit ( s . rstrip ( 's' ) ) raise ValueError ( ( 'Do not understand time unit %s' % s ) )
normalize time input to one of year .