'Given a list of resources, retrieve the quotas for the given
user and project.
:param context: The request context, for access checks.
:param resources: A dictionary of the registered resources.
:param project_id: The ID of the project to return quotas for.
:param user_id: The ID of the user to return quotas for.
:param quota_class: If project_id != context.project_id, the
quota class cannot be determined.  This
parameter allows it to be specified.  It
will be ignored if project_id ==
context.project_id.
:param defaults: If True, the quota class value (or the
default value, if there is no value from the
quota class) will be reported if there is no
specific value for the resource.
:param usages: If True, the current counts will also be returned.
:param project_quotas: Quotas dictionary for the specified project.
:param user_quotas: Quotas dictionary for the specified project
and user.'

def get_user_quotas(self, context, resources, project_id, user_id, quota_class=None, defaults=True, usages=True, project_quotas=None, user_quotas=None):

    if user_quotas:
        user_quotas = user_quotas.copy()
    else:
        user_quotas = objects.Quotas.get_all_by_project_and_user(context, project_id, user_id)
    proj_quotas = (project_quotas or objects.Quotas.get_all_by_project(context, project_id))
    for (key, value) in proj_quotas.items():
        if (key not in user_quotas.keys()):
            user_quotas[key] = value
    user_usages = {}
    if usages:
        user_usages = self._get_usages(context, resources, project_id, user_id=user_id)
    return self._process_quotas(context, resources, project_id, user_quotas, quota_class, defaults=defaults, usages=user_usages)
