def validate_cidr(value):
    """Validate whether ``value`` is a validr IPv4/IPv6 CIDR."""
    try:
        cidr = ipaddress.ip_network(unicode(value))
    except ValueError:
        raise exc.ValidationError({
            'cidr': value % '%r does not appear to be an IPv4 or IPv6 network'
        })
    else:
        return cidr
dataset/ETHPy150Open dropbox/nsot/nsot/validators.py/validate_cidr/swapped operands of `%`