@auth
    def _PUT(self, *param, **params):
        """<comment-ja>
        Japanese Comment
        </comment-ja>
        <comment-en>
        TODO: English Comment
        </comment-en>
        """
        (host_id, guest_id) = self.chk_guestby1(param)
        if guest_id is None: return web.notfound()

        if not validates_cpu(self):
            return web.badrequest(self.view.alert)
        
        if is_param(self.input, 'vcpus'):
            vcpus = int(self.input.vcpus)
        else:
            vcpus = None
        max_vcpus = int(self.input.max_vcpus)

        model = findbyguest1(self.orm, guest_id)

        # virt
        kvc = KaresansuiVirtConnection()
        try:
            domname = kvc.uuid_to_domname(model.uniq_key)
            if not domname: return web.conflict(web.ctx.path)
            virt = kvc.search_kvg_guests(domname)[0]

            vcpus_info = virt.get_vcpus_info()
            max_vcpus_limit = kvc.get_max_vcpus()
            vcpus_limit     = vcpus_info['max_vcpus']
        finally:
            kvc.close()
                
        if max_vcpus_limit < max_vcpus:
            return web.badrequest("%s is greater than the maximum number supported for guest. - max_vcpus_limit=%d max_vcpus=%d" \
                % (_('Maximum Number of Virtual CPUs'), self.input.max_vcpus_limit,self.input.max_vcpus,))

        if vcpus is not None:
            if vcpus_limit < vcpus:
                return web.badrequest("%s is greater than the maximum number supported for guest. - vcpus_limit=%d vcpus=%d" \
                    % (_('Number of Virtual CPUs'), self.input.vcpus_limit,self.input.vcpus,))

        options = {}
        options["name"] = domname
        if vcpus is not None:
            options["vcpus"] = vcpus
        options["max-vcpus"] = max_vcpus
        
        _cmd = dict2command("%s/%s" % (karesansui.config['application.bin.dir'],
                                       VIRT_COMMAND_SET_VCPUS),
                            options)
        
        cmdname = "Set CPU"
        _jobgroup = JobGroup(cmdname, karesansui.sheconf['env.uniqkey'])
        _jobgroup.jobs.append(Job(cmdname % '%s command', 0, _cmd))
        
        _machine2jobgroup = m2j_new(machine=model,
                                    jobgroup_id=-1,
                                    uniq_key=karesansui.sheconf['env.uniqkey'],
                                    created_user=self.me,
                                    modified_user=self.me,
                                    )
        save_job_collaboration(self.orm,
                               self.pysilhouette.orm,
                               _machine2jobgroup,
                               _jobgroup,
                               )
        return web.accepted()
dataset/ETHPy150Open karesansui/karesansui/karesansui/gadget/guestby1cpu.py/GuestBy1Cpu._PUT/swapped operands of `%`