code: def valid_value(value, quote=default_cookie_quote, unquote=default_unquote):
      
      if value is None:
          return False
  
      # Put the value through a round trip with the given quote and unquote
      # functions, so we will know whether data will get lost or not in the event
      # that we don't complain.
      encoded = encode_cookie_value(value, quote=quote)
      decoded = parse_string(encoded, unquote=unquote)
  
      # If the original string made the round trip, this is a valid value for the
      # given quote and unquote functions. Since the round trip can generate
      # different unicode forms, normalize before comparing, so we can ignore
      # trivial inequalities.
      decoded_normalized = (normalize("NFKD", decoded)
                            if not isinstance(decoded, bytes) else decoded)
      value_normalized = (normalize("NFKD", value)
                          if not isinstance(value, bytes) else value)
      if decoded_normalized == value_normalized:
          return True
      return False
docs: Validate a cookie value string.
  
      This is generic across quote/unquote functions because it directly verifies
      the encoding round-trip using the specified quote/unquote functions.
      So if you use different quote/unquote functions, use something like this
      as a replacement for valid_value::
  
          my_valid_value = lambda value: valid_value(value, quote=my_quote,
                                                            unquote=my_unquote)