#NEWLINE# @ classmethod #NEWLINE# def _string_from_ip_int( cls , ip_int = None ) : #NEWLINE# #INDENT# 'Turns a 128-bit integer into hexadecimal notation.\n\n        Args:\n            ip_int: An integer, the IP address.\n\n        Returns:\n            A string, the hexadecimal representation of the address.\n\n        Raises:\n            ValueError: The address is bigger than 128 bits of all ones.\n\n        ' #NEWLINE# if ( ip_int is None ) : #NEWLINE# #INDENT# ip_int = int ( cls . _ip ) #NEWLINE# #UNINDENT# if ( ip_int > cls . _ALL_ONES ) : #NEWLINE# #INDENT# raise ValueError ( 'IPv6 address is too large' ) #NEWLINE# #UNINDENT# hex_str = ( '%032x' % ip_int ) #NEWLINE# hextets = [ ( '%x' % int ( hex_str [ x : ( x + 4 ) ] , 16 ) ) for x in range ( 0 , 32 , 4 ) ] #NEWLINE# hextets = cls . _compress_hextets ( hextets ) #NEWLINE# return ':' . join ( hextets )