'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].'

def _parse_octet(self, octet_str):

    if (not self._DECIMAL_DIGITS.issuperset(octet_str)):
        raise ValueError
    octet_int = int(octet_str, 10)
    if ((octet_int > 255) or ((octet_str[0] == '0') and (len(octet_str) > 1))):
        raise ValueError
    return octet_int
