@classmethod<EOL><INDENT>def _parse_octet(cls, octet_str):<DEDENT>
if not octet_str:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not cls._DECIMAL_DIGITS.issuperset(octet_str):<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg % octet_str)<EOL><DEDENT>if len(octet_str) > <NUM_LIT:3>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg % octet_str)<EOL><DEDENT>octet_int = int(octet_str, <NUM_LIT:10>)<EOL>if octet_int > <NUM_LIT:7> and octet_str[<NUM_LIT:0>] == '<STR_LIT:0>':<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg % octet_str)<EOL><DEDENT>if octet_int > <NUM_LIT:255>:<EOL><INDENT>raise ValueError("<STR_LIT>" % octet_int)<EOL><DEDENT>return octet_int<EOL>
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].