

def format_subnetwork(subnet, tenant_id):
    allocation_pools = []
    cidr = ((str(subnet['networkIdentifier']) + '/') + str(subnet['cidr']))
    allocation_pools.append({
        'start': str((ipaddress.ip_network(cidr)[0] + 2)),
        'end': str((ipaddress.ip_network(cidr)[(- 1)] - 1)),
    })
    return {
        'name': '',
        'tenant_id': tenant_id,
        'allocation_pools': allocation_pools,
        'gateway_ip': subnet.get('gateway'),
        'ip_version': subnet.get('version'),
        'cidr': cidr,
        'id': str(subnet.get('id')),
        'enable_dhcp': False,
        'network_id': subnet.get('networkVlanId'),
        'dns_nameservers': [],
        'host_routes': [],
    }

dataset/ETHPy150Open softlayer/jumpgate/jumpgate/network/drivers/sl/subnets.py format_subnetwork/original