code: def validate_rpc_host(ip):
      
      if not is_valid_ipv4(ip) and not is_valid_ipv6(ip):
          raise ApplicationException(
              desc='Invalid RPC ip address: %s' % ip)
      return ip
docs: Validates the given ip for use as RPC server address.