def client_host(server_host):
 if (server_host == '0.0.0.0'):
  return '127.0.0.1'
 if (server_host in ('::', '::0', '::0.0.0.0')):
  return '::1'
 return server_host

def client_host ( server_host ) : if ( server_host == '0.0.0.0' ) : return '127.0.0.1' if ( server_host in ( '::' , '::0' , '::0.0.0.0' ) ) : return '::1' return server_host
return the host on which a client can connect to the given listener .