def _create_resource_instance(self, resource_name, plural_name):

        if (not cfg.CONF.QUOTAS.track_quota_usage or
            resource_name not in self._tracked_resource_mappings):
            LOG.info(_LI("Creating instance of CountableResource for "
                         "resource:%s"), resource_name)
            return resource.CountableResource(
                resource_name, resource._count_resource,
                'quota_%s' % resource_name)
        else:
            LOG.info(_LI("Creating instance of TrackedResource for "
                         "resource:%s"), resource_name)
            return resource.TrackedResource(
                resource_name,
                self._tracked_resource_mappings[resource_name],
                'quota_%s' % resource_name)
Factory function for quota Resource.
dataset/ETHPy150Open openstack/neutron/neutron/quota/resource_registry.py/ResourceRegistry._create_resource_instance