def validate_cidr(cidr):
    """
    Return whether ``cidr`` is valid.

    :param cidr:
        IPv4/IPv6 address
    """
    try:
        netaddr.IPNetwork(cidr)
    except (__HOLE__, netaddr.AddrFormatError):
        return False
    else:
        return True
dataset/ETHPy150Open dropbox/pynsot/pynsot/util.py/validate_cidr