'sets the list of hosts used by this client.
This function accepts the same format hosts parameter as the init
function and sets the client to use the new hosts the next time it
needs to look up a set of hosts. This function does not affect the
current connected status.
It is not currently possible to change the chroot with this function,
setting a host list with a new chroot will raise a ConfigurationError.
:param hosts: see description in :meth:`KazooClient.__init__`
:param randomize_hosts: override client default for host randomization
:raises:
:exc:`ConfigurationError` if the hosts argument changes the chroot
.. versionadded:: 1.4
.. warning::
Using this function to point a client to a completely disparate
zookeeper server cluster has undefined behavior.'

def set_hosts(self, hosts, randomize_hosts=None):

    if (randomize_hosts is None):
        randomize_hosts = self.randomize_hosts
    (self.hosts, chroot) = collect_hosts(hosts, randomize_hosts)
    if chroot:
        new_chroot = normpath(chroot)
    else:
        new_chroot = ''
    if ((self.chroot is not None) and (new_chroot != self.chroot)):
        raise ConfigurationError('Changing    chroot    at    runtime    is    not    currently    supported')
    self.chroot = new_chroot
