def HostNameCheck(host):
 if (not HostNameValid(host)):
  raise ValueError((_('Invalid hostname: %s') % host))
 return str(host).lower()

def HostNameCheck ( host ) : if ( not HostNameValid ( host ) ) : raise ValueError ( ( _ ( 'Invalid hostname: %s' ) % host ) ) return str ( host ) . lower ( )
verify that a string is a valid host-name .