def addWorker(self, args):
        app_name, deployment_name = self.parse_app_deployment_name(args.name)
        if args.size:
            size = args.size
            if args.memory:
                raise InputErrorException('AmbiguousSize')
        elif args.memory:
            memory = args.memory
            size = self._get_size_from_memory(memory)
        else:
            size = None
        if not deployment_name:
            deployment_name = 'default'
        if not args.command:
            raise InputErrorException('NoWorkerCommandGiven')
        try:
            self.api.create_worker(
                app_name,
                deployment_name,
                args.command,
                params=args.params,
                size=size)
        except BadRequestError as e:
            if 'size' in e.msgs:
                if args.memory:
                    raise InputErrorException('InvalidMemory')
                if args.size:
                    raise InputErrorException('InvalidSize')
            else:
                raise
        return True
Provide a transactional scope around a series of operations.
dataset/ETHPy150Open cloudControl/cctrl/cctrl/app.py/AppController.addWorker--crossover with--dataset/ETHPy150Open jaysw/ipydb/ipydb/metadata/__init__.py/session_scope