def get_settable_quotas(self, context, resources, project_id,
                            user_id=None):

        settable_quotas = {}
        db_proj_quotas = db.quota_get_all_by_project(context, project_id)
        project_quotas = self.get_project_quotas(context, resources,
                                                 project_id, remains=True,
                                                 project_quotas=db_proj_quotas)
        if user_id:
            setted_quotas = db.quota_get_all_by_project_and_user(context,
                                                     project_id,
                                                     user_id)
            user_quotas = self.get_user_quotas(context, resources,
                                               project_id, user_id,
                                               project_quotas=db_proj_quotas,
                                               user_quotas=setted_quotas)
            for key, value in user_quotas.items():
                maximum = \
                    self._sum_quota_values(project_quotas[key]['remains'],
                                           setted_quotas.get(key, 0))
                minimum = value['in_use'] + value['reserved']
                settable_quotas[key] = {'minimum': minimum, 'maximum': maximum}
        else:
            for key, value in project_quotas.items():
                minimum = \
                    max(int(self._sub_quota_values(value['limit'],
                                                   value['remains'])),
                        int(value['in_use'] + value['reserved']))
                settable_quotas[key] = {'minimum': minimum, 'maximum': -1}
        return settable_quotas
Given a list of resources, retrieve the range of settable quotas for
dataset/ETHPy150Open openstack/nova/nova/quota.py/DbQuotaDriver.get_settable_quotas