Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, port, hosts, distributor=RoundRobin, venv=None):
"""create a new cluster listening on `port`, managing `hosts`"""
self.hosts = sum((self._start_node(host, user, start_port, venv)
for host, user, start_port in hosts), [])
self._container = aiomas.Container.create(('localhost', port),
codec=aiomas.codecs.MsgPackBlosc,
extra_serializers=[get_np_serializer])
self._container.has_manager = True
self._managers = aiomas.run(self._connect_to_managers(self.hosts))
self._distributor = distributor(self._managers)