Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def amap(self, f, *args, **kwds):
AbstractWorkerPool._AbstractWorkerPool__map(self, f, *args, **kwds)
def submit(*argz):
"""send a job to the server"""
_pool = self._serve()
#print("using %s local workers" % _pool.get_ncpus())
try:
return _pool.submit(f, argz, globals=globals())
except pp.DestroyedServerError:
self._is_alive(None)
override = True if 'size' in kwds else False
elem_size = kwds.pop('size', 2)
length = min(len(task) for task in args)
args = zip(*args) #XXX: zip iterator ok? or should be list?
# submit all jobs, to be collected later with 'get()'
tasks = [submit(*task) for task in args]
tasks = [ApplyResult(task) for task in tasks]
# build a correctly sized results object
def amap(self, f, *args, **kwds): # register a callback ?
AbstractWorkerPool._AbstractWorkerPool__map(self, f, *args, **kwds)
_pool = self._serve()
return _pool.map_async(star(f), zip(*args)) # chunksize
amap.__doc__ = AbstractWorkerPool.amap.__doc__
def map(self, f, *args, **kwds):
AbstractWorkerPool._AbstractWorkerPool__map(self, f, *args, **kwds)
return list(self.imap(f, *args))
map.__doc__ = AbstractWorkerPool.map.__doc__
def map(self, f, *args, **kwds):
AbstractWorkerPool._AbstractWorkerPool__map(self, f, *args, **kwds)
_pool = self._serve()
return _pool.map(star(f), zip(*args)) # chunksize
map.__doc__ = AbstractWorkerPool.map.__doc__
def amap(self, f, *args, **kwds): # register a callback ?
AbstractWorkerPool._AbstractWorkerPool__map(self, f, *args, **kwds)
_pool = self._serve()
return _pool.map_async(star(f), zip(*args)) # chunksize
amap.__doc__ = AbstractWorkerPool.amap.__doc__
def map(self, f, *args, **kwds):
AbstractWorkerPool._AbstractWorkerPool__map(self, f, *args, **kwds)
_pool = self._serve()
return _pool.map(star(f), zip(*args)) # chunksize
map.__doc__ = AbstractWorkerPool.map.__doc__