def _create_quota_usage_if_missing(user_usages, resource, until_refresh, project_id, user_id, session):
 new_usage = None
 if (resource not in user_usages):
  user_id_to_use = user_id
  if (resource in PER_PROJECT_QUOTAS):
   user_id_to_use = None
  new_usage = _quota_usage_create(project_id, user_id_to_use, resource, 0, 0, (until_refresh or None), session)
  user_usages[resource] = new_usage
 return (new_usage is not None)

def _create_quota_usage_if_missing ( user_usages , resource , until_refresh , project_id , user_id , session ) : new_usage = None if ( resource not in user_usages ) : user_id_to_use = user_id if ( resource in PER_PROJECT_QUOTAS ) : user_id_to_use = None new_usage = _quota_usage_create ( project_id , user_id_to_use , resource , 0 , 0 , ( until_refresh or None ) , session ) user_usages [ resource ] = new_usage return ( new_usage is not None )
creates a quotausage record and adds to user_usages if not present .