#NEWLINE# def get_address_host( address ) : #NEWLINE# #INDENT# "\n    Returns the host part of the client's address.\n    A client's address is of the form: [<user>@]<host>.\n    " #NEWLINE# tokens = address . split ( '@' ) #NEWLINE# if ( len ( tokens ) == 1 ) : #NEWLINE# #INDENT# return tokens [ 0 ] #NEWLINE# #UNINDENT# if ( len ( address ) == 2 ) : #NEWLINE# #INDENT# return tokens [ 1 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( 'Invalid address: %s.' % address ) )