'Remove an address from a larger block.
For example:
addr1 = IP(\'10.1.1.0/24\')
addr2 = IP(\'10.1.1.0/26\')
addr1.address_exclude(addr2) =
[IP(\'10.1.1.64/26\'), IP(\'10.1.1.128/25\')]
or IPv6:
addr1 = IP(\'::1/32\')
addr2 = IP(\'::1/128\')
addr1.address_exclude(addr2) = [IP(\'::0/128\'),
IP(\'::2/127\'),
IP(\'::4/126\'),
IP(\'::8/125\'),
IP(\'0:0:8000::/33\')]
Args:
other: An IP object of the same type.
Returns:
A sorted list of IP objects addresses which is self minus
other.
Raises:
IPTypeError: If self and other are of difffering address
versions.
IPAddressExclusionError: There was some unknown error in the
address exclusion process.  This likely points to a bug
elsewhere in this code.
ValueError: If other is not completely contained by self.'

def address_exclude(self, other):

    if (not (self._version == other._version)):
        raise IPTypeError(("%s    and    %s    aren't    of    the    same    version" % (str(self), str(other))))
    if (other not in self):
        raise ValueError(('%s    not    contained    in    %s' % (str(other), str(self))))
    ret_addrs = []
    other = IPNetwork(('%s/%s' % (str(other.network), str(other.prefixlen))), version=other._version)
    (s1, s2) = self.subnet()
    while ((s1 != other) and (s2 != other)):
        if (other in s1):
            ret_addrs.append(s2)
            (s1, s2) = s1.subnet()
        elif (other in s2):
            ret_addrs.append(s1)
            (s1, s2) = s2.subnet()
        else:
            raise IPAddressExclusionError(('Error    performing    exclusion:    s1:    %s    s2:    %s    other:    %s' % (str(s1), str(s2), str(other))))
    if (s1 == other):
        ret_addrs.append(s2)
    elif (s2 == other):
        ret_addrs.append(s1)
    else:
        raise IPAddressExclusionError(('Error    performing    exclusion:    s1:    %s    s2:    %s    other:    %s' % (str(s1), str(s2), str(other))))
    return sorted(ret_addrs, key=BaseNet._get_networks_key)
