def _calculate_overquota(project_quotas, user_quotas, deltas, project_usages, user_usages):
 overs = []
 for (res, delta) in deltas.items():
  if (delta >= 0):
   if (0 <= project_quotas[res] < (delta + project_usages[res]['total'])):
    LOG.debug('Request is over project quota for resource "%(res)s". Project limit: %(limit)s, delta: %(delta)s, current total project usage: %(total)s', {'res': res, 'limit': project_quotas[res], 'delta': delta, 'total': project_usages[res]['total']})
    overs.append(res)
   elif (0 <= user_quotas[res] < (delta + user_usages[res]['total'])):
    LOG.debug('Request is over user quota for resource "%(res)s". User limit: %(limit)s, delta: %(delta)s, current total user usage: %(total)s', {'res': res, 'limit': user_quotas[res], 'delta': delta, 'total': user_usages[res]['total']})
    overs.append(res)
 return overs

def _calculate_overquota ( project_quotas , user_quotas , deltas , project_usages , user_usages ) : overs = [ ] for ( res , delta ) in deltas . items ( ) : if ( delta >= 0 ) : if ( 0 <= project_quotas [ res ] < ( delta + project_usages [ res ] [ 'total' ] ) ) : LOG . debug ( 'Request is over project quota for resource "%(res)s". Project limit: %(limit)s, delta: %(delta)s, current total project usage: %(total)s' , { 'res' : res , 'limit' : project_quotas [ res ] , 'delta' : delta , 'total' : project_usages [ res ] [ 'total' ] } ) overs . append ( res ) elif ( 0 <= user_quotas [ res ] < ( delta + user_usages [ res ] [ 'total' ] ) ) : LOG . debug ( 'Request is over user quota for resource "%(res)s". User limit: %(limit)s, delta: %(delta)s, current total user usage: %(total)s' , { 'res' : res , 'limit' : user_quotas [ res ] , 'delta' : delta , 'total' : user_usages [ res ] [ 'total' ] } ) overs . append ( res ) return overs
checks if any resources will go over quota based on the request .