def ip(value):
    '''Validate an IP address (both IPv4 and IPv6)'''
    try:
        return ipv4(value)
    except ValueError:
        pass
    try:
        return ipv6(value)
    except __HOLE__:
        raise ValueError('{0} is not a valid ip'.format(value))
dataset/ETHPy150Open noirbizarre/flask-restplus/flask_restplus/inputs.py/ip