'Generates a dict whose key=subnet_id, value=total_ips in subnet'

@classmethod
def _generate_subnet_total_ips_dict(cls, context, filters):

    total_ips_query = cls._build_total_ips_query(context, filters)
    subnet_totals_dict = {}
    for row in total_ips_query:
        if (not row.subnet_id):
            continue
        if row.last_ip:
            pool_total = netaddr.IPRange(netaddr.IPAddress(row.first_ip), netaddr.IPAddress(row.last_ip)).size
            cur_total = subnet_totals_dict.get(row.subnet_id, 0)
            subnet_totals_dict[row.subnet_id] = (cur_total + pool_total)
        else:
            subnet_totals_dict[row.subnet_id] = netaddr.IPNetwork(row.cidr, version=row.ip_version).size
    return subnet_totals_dict
