#NEWLINE# def _ip_to_int( self , ip ) : #NEWLINE# #INDENT# if ( '.' in ip ) : #NEWLINE# #INDENT# return sum ( [ int ( x ) for x in ip . split ( '.' ) ] ) #NEWLINE# #UNINDENT# if ( ':' in ip ) : #NEWLINE# #INDENT# ( hi , lo ) = struct . unpack ( '!QQ' , socket . inet_pton ( socket . AF_INET6 , ip ) ) #NEWLINE# return ( ( hi << 64 ) | lo ) #NEWLINE# #UNINDENT# raise ValueError ( ( 'Invalid IP Address %r' % ip ) )