def __init__(self, value):
if isinstance(value, (int, long)):<EOL><INDENT>pass<EOL><DEDENT>elif not isinstance(value, basestring):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>elif value.isdigit():<EOL><INDENT>value = int(value)<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>value = self._units_map[value.lower()]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError('<STR_LIT>' % value)<EOL><DEDENT><DEDENT>if value <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>' % value)<EOL><DEDENT>self.value = value<EOL>
Initialize a TimeUnit object.

:param value: The value.  This may be a recognized unit name,
              or an integer value in either string or integer
              format.  A ValueError will be raised if the
              value cannot be interpreted.