#NEWLINE# @ classmethod #NEWLINE# def _parse_hextet( cls , hextet_str ) : #NEWLINE# #INDENT# "Convert an IPv6 hextet string into an integer.\n\n        Args:\n            hextet_str: A string, the number to parse.\n\n        Returns:\n            The hextet as an integer.\n\n        Raises:\n            ValueError: if the input isn't strictly a hex number from\n              [0..FFFF].\n\n        " #NEWLINE# if ( not cls . _HEX_DIGITS . issuperset ( hextet_str ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Only hex digits permitted in %r' % hextet_str ) ) #NEWLINE# #UNINDENT# if ( len ( hextet_str ) > 4 ) : #NEWLINE# #INDENT# msg = 'At most 4 characters permitted in %r' #NEWLINE# raise ValueError ( ( msg % hextet_str ) ) #NEWLINE# #UNINDENT# return int ( hextet_str , 16 )