Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import aiomas
import asyncio
import logging
import operator
import itertools
from .proxy import LocalProxy
logger = logging.getLogger(__name__)
class Node(aiomas.Container):
"""a node manages a population of agents"""
def __init__(self, addr, *args, **kwargs):
super().__init__(addr, *args, **kwargs)
self._local_agent_proxies = {}
# prepare logging for each node
_, port = addr[:-1].rsplit(':', 1)
handler = logging.FileHandler('/tmp/sydspawn_{}.log'.format(port))
handler.setLevel(logging.DEBUG)
self.logger = logging.getLogger(__name__)
self.logger.addHandler(handler)
self.logger.debug('node up at {}'.format(addr))
@classmethod
async def start(cls, addr, **container_kwargs):