def valid_value(value, quote=default_cookie_quote, unquote=default_unquote):
 if (value is None):
  return False
 encoded = encode_cookie_value(value, quote=quote)
 decoded = parse_string(encoded, unquote=unquote)
 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

def valid_value ( value , quote = default_cookie_quote , unquote = default_unquote ) : if ( value is None ) : return False encoded = encode_cookie_value ( value , quote = quote ) decoded = parse_string ( encoded , unquote = unquote ) 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
validate a cookie value string .