def check_gateway_invalid_in_subnet(cidr, gateway):
    ip = netaddr.IPAddress(gateway)
    net = netaddr.IPNetwork(cidr)
    # Check whether the gw IP is in-valid on subnet.
    # If gateway is in the subnet, it cannot be the
    # 'network' or the 'broadcast address (only in IPv4)'.
    # If gateway is out of subnet, there is no way to
    # check since we don't have gateway's subnet cidr.
    return (ip in net and
            (ip == net.network or
             (net.version == constants.IP_VERSION_4 and ip == net[-1])))
Creates pmml.row element with columns
dataset/ETHPy150Open openstack/neutron/neutron/ipam/utils.py/check_gateway_invalid_in_subnet--crossover with--dataset/ETHPy150Open alex-pirozhenko/sklearn-pmml/sklearn_pmml/convert/utils.py/pmml_row