@staticmethod
    def get_all_quotas(context, resources):
        tenant_default = dict((key, resource.default)
                              for key, resource in resources.items())

        all_tenant_quotas = {}

        for quota in context.session.query(quota_models.Quota):
            tenant_id = quota['tenant_id']

            # avoid setdefault() because only want to copy when actually
            # required
            tenant_quota = all_tenant_quotas.get(tenant_id)
            if tenant_quota is None:
                tenant_quota = tenant_default.copy()
                tenant_quota['tenant_id'] = tenant_id
                all_tenant_quotas[tenant_id] = tenant_quota

            tenant_quota[quota['resource']] = quota['limit']

        # Convert values to a list to as caller expect an indexable iterable,
        # where python3's dict_values does not support indexing
        return list(all_tenant_quotas.values())
*musicpd.org, audio output section:*
dataset/ETHPy150Open openstack/neutron/neutron/db/quota/driver.py/DbQuotaDriver.get_all_quotas--crossover with--dataset/ETHPy150Open mopidy/mopidy/mopidy/mpd/protocol/audio_output.py/enableoutput