def _is_subnet_of(a, b):
    try:
        if (a._version != b._version):
            raise TypeError('{} and {} are not of the same version'.format(a, b))
        return ((b.network_address <= a.network_address) and (b.broadcast_address >= a.broadcast_address))
    except AttributeError:
        raise TypeError('Unable to test subnet containment between {} and {}'.format(a, b))
def _is_subnet_of(a, b):
    try:
        if (a._version != b._version):
            raise TypeError('{} and {} are not of the same version'.format(a, b))
        return ((b.network_address <= a.network_address) and (b.broadcast_address >= a.broadcast_address))
    except AttributeError:
        raise TypeError('Unable to test subnet containment between {} and {}'.format(a, b))