(onion)
return host
:param onion: IAuthenticatedOnionClients provider

    :returns: a .onion hostname if all clients have the same name or
        raises ValueError otherwise
:param onion: IAuthenticatedOnionClients provider
: param onion : IAuthenticatedOnionClients provider
def _maybe_unique_host(onion):
    """
    :param onion: IAuthenticatedOnionClients provider

    :returns: a .onion hostname if all clients have the same name or
        raises ValueError otherwise
    """
    hosts = [
        onion.get_client(nm).hostname
        for nm in onion.client_names()
    ]
    if not hosts:
        raise ValueError(
            "Can't access .onion_uri because there are no clients"
        )
    host = hosts[0]
    for h in hosts[1:]:
        if h != host:
            raise ValueError(
                "Cannot access .onion_uri for stealth-authenticated services "
                "because each client has a unique URI"
            )
    return host
def _maybe_unique_host ( onion ) : hosts = [ onion . get_client ( nm ) . hostname for nm in onion . client_names ( ) ] if not hosts : raise ValueError ( "Can't access .onion_uri because there are no clients" ) host = hosts [ 0 ] for h in hosts [ 1 : ] : if h != host : raise ValueError ( "Cannot access .onion_uri for stealth-authenticated services " "because each client has a unique URI" ) return host