def valid_address(address):
if not address:<EOL><INDENT>return False<EOL><DEDENT>components = str(address).split('<STR_LIT::>')<EOL>if len(components) > <NUM_LIT:2> or not valid_hostname(components[<NUM_LIT:0>]):<EOL><INDENT>return False<EOL><DEDENT>if len(components) == <NUM_LIT:2> and not valid_port(components[<NUM_LIT:1>]):<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Determines whether the specified address string is valid.