def _is_quota_refresh_needed(quota_usage, max_age):
 refresh = False
 if (quota_usage.in_use < 0):
  LOG.debug('in_use has dropped below 0; forcing refresh for QuotaUsage: %s', dict(quota_usage))
  refresh = True
 elif (quota_usage.until_refresh is not None):
  quota_usage.until_refresh -= 1
  if (quota_usage.until_refresh <= 0):
   refresh = True
 elif (max_age and ((timeutils.utcnow() - quota_usage.updated_at).seconds >= max_age)):
  refresh = True
 return refresh

def _is_quota_refresh_needed ( quota_usage , max_age ) : refresh = False if ( quota_usage . in_use < 0 ) : LOG . debug ( 'in_use has dropped below 0; forcing refresh for QuotaUsage: %s' , dict ( quota_usage ) ) refresh = True elif ( quota_usage . until_refresh is not None ) : quota_usage . until_refresh -= 1 if ( quota_usage . until_refresh <= 0 ) : refresh = True elif ( max_age and ( ( timeutils . utcnow ( ) - quota_usage . updated_at ) . seconds >= max_age ) ) : refresh = True return refresh
determines if a quota usage refresh is needed .