def create(name, memory, vcpus, local_gb, flavorid, swap=0,
           rxtx_quota=0, rxtx_cap=0):
    """Creates instance types."""
    for option in [memory, vcpus, local_gb, flavorid]:
        try:
            int(option)
        except ValueError:
            raise exception.InvalidInput(reason=_("create arguments must "
                                                  "be positive integers"))
    if (int(memory) <= 0) or (int(vcpus) <= 0) or (int(local_gb) < 0):
        raise exception.InvalidInput(reason=_("create arguments must "
                                              "be positive integers"))

    try:
        db.instance_type_create(
                context.get_admin_context(),
                dict(name=name,
                    memory_mb=memory,
                    vcpus=vcpus,
                    local_gb=local_gb,
                    flavorid=flavorid,
                    swap=swap,
                    rxtx_quota=rxtx_quota,
                    rxtx_cap=rxtx_cap))
    except exception.DBError, e:
        LOG.exception(e % _('DB error: %s'))
        raise exception.ApiError(_("Cannot create instance_type with "
                                    "name %(name)s and flavorid %(flavorid)s")
                                    % locals())
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/compute/instance_types.py/create/swapped operands of `%`