def handle(self, requests):
		logging.debug("[zmq] <~ self%s" % ''.join([format_method(*req) for req in requests]))

		# loop request chain
		module = self.server.module
		result = module
		parsed = module.name

		for method, args, kwargs in requests:
			# parse request
			try:
				if method == '__dir':
					result = dir(result, *args, **kwargs)
				elif method == '__len':
					result = len(result, *args, **kwargs)
				elif method == '__set':
					result = setattr(result, *args, **kwargs)
				elif method == '__del':
					result = delattr(result, *args, **kwargs)
				else:
					try: result = getattr(result, method)
					except AttributeError:
						parsed += '.' + method
						raise
					else:
						parsed += format_method(method, args, kwargs)
						result = result(*args, **kwargs)
			except __HOLE__:
				msg = 'AttributeError: \'%s\'' % parsed
				logging.error(msg)
				module.alert(msg)
				raise ReqError(parsed)
			except PyscaleError as ex:
				msg = ''.join(traceback.format_exception_only(type(ex), ex)).strip()
				logging.error(msg)
				module.alert(msg)
				raise ReqError(parsed)
			except Exception as ex:
				msg = traceback.format_exc()
				logging.exception(msg)
				module.error(msg)
				raise ReqError(parsed)

		return result
dataset/ETHPy150Open alexcepoi/pyscale/pyscale/zmq/rpc.py/RpcWorker.handle