'Convert a decimal octet into an integer.
Args:
octet_str: A string, the number to parse.
Returns:
The octet as an integer.
Raises:
ValueError: if the octet isn\'t strictly a decimal from [0..255].'

@classmethod
def _parse_octet(cls, octet_str):

    if (not octet_str):
        raise ValueError(u'Empty    octet    not    permitted')
    if (not cls._DECIMAL_DIGITS.issuperset(octet_str)):
        msg = u'Only    decimal    digits    permitted    in    %r'
        raise ValueError((msg % octet_str))
    if (len(octet_str) > 3):
        msg = u'At    most    3    characters    permitted    in    %r'
        raise ValueError((msg % octet_str))
    octet_int = int(octet_str, 10)
    if ((octet_int > 7) and (octet_str[0] == u'0')):
        msg = u'Ambiguous    (octal/decimal)    value    in    %r    not    permitted'
        raise ValueError((msg % octet_str))
    if (octet_int > 255):
        raise ValueError((u'Octet    %d    (>    255)    not    permitted' % octet_int))
    return octet_int
