def ip_address_validators(protocol, unpack_ipv4):
 if ((protocol != u'both') and unpack_ipv4):
  raise ValueError(u"You can only use `unpack_ipv4` if `protocol` is set to 'both'")
 try:
  return ip_address_validator_map[protocol.lower()]
 except KeyError:
  raise ValueError((u"The protocol '%s' is unknown. Supported: %s" % (protocol, list(ip_address_validator_map))))

def ip_address_validators ( protocol , unpack_ipv4 ) : if ( ( protocol != u'both' ) and unpack_ipv4 ) : raise ValueError ( u"You can only use `unpack_ipv4` if `protocol` is set to 'both'" ) try : return ip_address_validator_map [ protocol . lower ( ) ] except KeyError : raise ValueError ( ( u"The protocol '%s' is unknown. Supported: %s" % ( protocol , list ( ip_address_validator_map ) ) ) )
depending on the given parameters returns the appropriate validators for the genericipaddressfield .