#NEWLINE# def _calculate_simple_quota( context , resource , requested ) : #NEWLINE# #INDENT# 'Check quota for resource; return min(requested, allowed).' #NEWLINE# quota = get_project_quotas ( context , context . project_id ) #NEWLINE# allowed = _get_request_allotment ( requested , 0 , quota [ resource ] ) #NEWLINE# return min ( requested , allowed )