def getNS(host=None, port=None, broadcast=True, hmac_key=None):
    """Get a Pyro4 name server proxy.

    Parameters
    ----------
    host : str, optional
        Name server hostname.
    port : int, optional
        Name server port.
    broadcast : bool, optional
        Use broadcast mechanism? (i.e. reach out to all Pyro nodes in the network)
    hmac_key : str, optional
        Private key.

    Raises
    ------
    RuntimeError
        When Pyro name server is not found.

    Returns
    -------
    :class:`Pyro4.core.Proxy`
        Proxy from Pyro4.

    """
    import Pyro4
    try:
        return Pyro4.locateNS(host, port, broadcast, hmac_key)
    except Pyro4.errors.NamingError:
        raise RuntimeError('Pyro name server not found')
