<commit_before>package etcd

// Set sets the given key to the given value.
// It will create a new key value pair or replace the old one.
// It will not replace a existing directory.
func (c *Client) Set(key string, value string, ttl uint64) (*Response, error) {
	raw, err := c.RawSet(key, value, ttl)

	if err != nil {
		return nil, err
	}

	return raw.Unmarshal()
}

// Set sets the given key to a directory.
// It will create a new directory or replace the old key value pair by a directory.
// It will not replace a existing directory.
func (c *Client) SetDir(key string, ttl uint64) (*Response, error) {
	raw, err := c.RawSetDir(key, ttl)

	if err != nil {
		return nil, err
	}

	return raw.Unmarshal()
}

// CreateDir creates a directory. It succeeds only if
// the given key does not yet exist.<commit_msg>doc typo<commit_after>package etcd

// Set sets the given key to the given value.
// It will create a new key value pair or replace the old one.
// It will not replace a existing directory.
func (c *Client) Set(key string, value string, ttl uint64) (*Response, error) {
	raw, err := c.RawSet(key, value, ttl)

	if err != nil {
		return nil, err
	}

	return raw.Unmarshal()
}

// SetDir sets the given key to a directory.
// It will create a new directory or replace the old key value pair by a directory.
// It will not replace a existing directory.
func (c *Client) SetDir(key string, ttl uint64) (*Response, error) {
	raw, err := c.RawSetDir(key, ttl)

	if err != nil {
		return nil, err
	}

	return raw.Unmarshal()
}

// CreateDir creates a directory. It succeeds only if
// the given key does not yet exist.
{'fraction_non_alphanumeric': 0.1022167487684729, 'fraction_numerical': 0.0049261083743842365, 'mean_word_length': 3.298941798941799, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3593779', 'n_tokens_mistral': 523, 'n_tokens_neox': 500, 'n_words': 244}