#NEWLINE# def get_user_quotas( self , context , resources , project_id , user_id , quota_class = None , defaults = True , usages = True , project_quotas = None , user_quotas = None ) : #NEWLINE# #INDENT# 'Given a list of resources, retrieve the quotas for the given\n        user and project.\n\n        :param context: The request context, for access checks.\n        :param resources: A dictionary of the registered resources.\n        :param project_id: The ID of the project to return quotas for.\n        :param user_id: The ID of the user to return quotas for.\n        :param quota_class: If project_id != context.project_id, the\n                            quota class cannot be determined.  This\n                            parameter allows it to be specified.  It\n                            will be ignored if project_id ==\n                            context.project_id.\n        :param defaults: If True, the quota class value (or the\n                         default value, if there is no value from the\n                         quota class) will be reported if there is no\n                         specific value for the resource.\n        :param usages: If True, the current in_use and reserved counts\n                       will also be returned.\n        :param project_quotas: Quotas dictionary for the specified project.\n        :param user_quotas: Quotas dictionary for the specified project\n                            and user.\n        ' #NEWLINE# if user_quotas : #NEWLINE# #INDENT# user_quotas = user_quotas . copy ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# user_quotas = db . quota_get_all_by_project_and_user ( context , project_id , user_id ) #NEWLINE# #UNINDENT# proj_quotas = ( project_quotas or db . quota_get_all_by_project ( context , project_id ) ) #NEWLINE# for ( key , value ) in six . iteritems ( proj_quotas ) : #NEWLINE# #INDENT# if ( key not in user_quotas . keys ( ) ) : #NEWLINE# #INDENT# user_quotas [ key ] = value #NEWLINE# #UNINDENT# #UNINDENT# user_usages = None #NEWLINE# if usages : #NEWLINE# #INDENT# user_usages = db . quota_usage_get_all_by_project_and_user ( context , project_id , user_id ) #NEWLINE# #UNINDENT# return self . _process_quotas ( context , resources , project_id , user_quotas , quota_class , defaults = quota_class , usages = user_usages )