def allowed_floating_ips(context, requested_floating_ips):
    project_id = context.project_id
    context = context.elevated()
    used_floating_ips = db.floating_ip_count_by_project(context, project_id)
    quota = get_project_quotas(context, project_id)
    allowed_floating_ips = _get_request_allotment(requested_floating_ips,
                                                  used_floating_ips,
                                                  quota['floating_ips'])
    return min(requested_floating_ips, allowed_floating_ips)
Check quota and return min(requested, allowed) floating ips.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/quota.py/allowed_floating_ips