def validates_cpu(obj):
    checker = Checker()
    check = True

    _ = obj._
    checker.errors = []

    if is_param(obj.input, 'max_vcpus'):
        check = checker.check_number(
                _('Maximum Allocatable Virtual CPUs'),
                obj.input.max_vcpus,
                CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
                min = VCPUS_MIN_SIZE,
                ) and check
    else:
        check = False
        checker.add_error(_('Maximum Allocatable Virtual CPUs') % _('"%s" is required.'))

    if is_param(obj.input, 'vcpus'):
        check = checker.check_number(
                _("Number of Virtual CPUs to Allocate"),
                obj.input.vcpus,
                CHECK_EMPTY | CHECK_VALID | CHECK_MIN,
                min = VCPUS_MIN_SIZE,
                ) and check;

    obj.view.alert = checker.errors
    return check
dataset/ETHPy150Open karesansui/karesansui/karesansui/gadget/guestby1cpu.py/validates_cpu/swapped operands of `%`