'Check usage delta against quota limits.
This does a Quotas.count_as_dict() followed by a
Quotas.limit_check_project_and_user() using the provided deltas.
:param context: The request context, for access checks
:param deltas: A dict of {resource_name: delta, ...} to check against
the quota limits
:param count_args: Optional positional arguments to pass to
count_as_dict()
:param count_kwargs: Optional keyword arguments to pass to
count_as_dict()
:param check_project_id: Optional project_id for scoping the limit
check to a different project than in the
context
:param check_user_id: Optional user_id for scoping the limit check to a
different user than in the context
:raises: exception.OverQuota if the limit check exceeds the quota
limits'

@base.remotable_classmethod
def check_deltas(cls, context, deltas, *count_args, **count_kwargs):

    check_project_id = count_kwargs.pop('check_project_id', None)
    check_user_id = count_kwargs.pop('check_user_id', None)
    check_kwargs = collections.defaultdict(dict)
    for resource in deltas:
        if ((resource in check_kwargs.get('project_values', {})) or (resource in check_kwargs.get('user_values', {}))):
            continue
        count = cls.count_as_dict(context, resource, *count_args, **count_kwargs)
        for res in count.get('project', {}):
            if (res in deltas):
                total = (count['project'][res] + deltas[res])
                check_kwargs['project_values'][res] = total
        for res in count.get('user', {}):
            if (res in deltas):
                total = (count['user'][res] + deltas[res])
                check_kwargs['user_values'][res] = total
    if (check_project_id is not None):
        check_kwargs['project_id'] = check_project_id
    if (check_user_id is not None):
        check_kwargs['user_id'] = check_user_id
    try:
        cls.limit_check_project_and_user(context, **check_kwargs)
    except exception.OverQuota as exc:
        key = ('user' if ('user' in count) else 'project')
        exc.kwargs['usages'] = count[key]
        raise exc
