@classmethod
    def get_isolated_subnets(cls, network):
        isolated_subnets = collections.defaultdict(lambda: True)
        subnets = dict((subnet.id, subnet) for subnet in network.subnets)

        for port in network.ports:
            if port.device_owner not in constants.ROUTER_INTERFACE_OWNERS:
                continue
            for alloc in port.fixed_ips:
                if subnets[alloc.subnet_id].gateway_ip == alloc.ip_address:
                    isolated_subnets[alloc.subnet_id] = False

        return isolated_subnets
Returns a dict indicating whether or not a subnet is isolated
dataset/ETHPy150Open openstack/neutron/neutron/agent/linux/dhcp.py/Dnsmasq.get_isolated_subnets