I am using python 2.6.6 and I am not allowed to change it. I have a sorted list of IPv4 addresses. I need to find the smallest network that covers all the ip addresses in the list. The smallest network can be the CIDR, or a Network address with subnet mask. I haven't yet found a simple way to do it using netaddr module. Here's example:
x=['192.168.0.0', '192.168.2.245', '192.168.255.255']
cidr = get_cidr_for_addresses(x)
print cidr ##should print '192.168.0.0/16'