<commit_before>package tempredis

import "fmt"

// Config is a key-value map of Redis config settings.
type Config map[string]string

// Host returns the host for a Redis server configured with this Config as
// "host:port".
func (c Config) Host() string {
	bind, ok := c["bind"]
	if !ok {
		bind = "127.0.0.1"
	}

	port, ok := c["port"]
	if !ok {
		port = "6379"
	}

	return fmt.Sprintf("%s:%s", bind, port)
}

// URL returns a Redis URL for a Redis server configured with this Config.
func (c Config) URL() string {
	password := c.Password()
	if len(password) == 0 {
		return fmt.Sprintf("redis://%s", c.Host())
	} else {
		return fmt.Sprintf("redis://:%s@%s", password, c.Host())
	}
}

// Password returns the password for a Redis server configured with this
// Config. If the server doesn't require authentication, an empty string will
// be returned.
func (c Config) Password() string {
	return c["requirepass"]
}
<commit_msg>Include trailing slash in URL.<commit_after>package tempredis

import "fmt"

// Config is a key-value map of Redis config settings.
type Config map[string]string

// Host returns the host for a Redis server configured with this Config as
// "host:port".
func (c Config) Host() string {
	bind, ok := c["bind"]
	if !ok {
		bind = "127.0.0.1"
	}

	port, ok := c["port"]
	if !ok {
		port = "6379"
	}

	return fmt.Sprintf("%s:%s", bind, port)
}

// URL returns a Redis URL for a Redis server configured with this Config.
func (c Config) URL() string {
	password := c.Password()
	if len(password) == 0 {
		return fmt.Sprintf("redis://%s/", c.Host())
	} else {
		return fmt.Sprintf("redis://:%s@%s/", password, c.Host())
	}
}

// Password returns the password for a Redis server configured with this
// Config. If the server doesn't require authentication, an empty string will
// be returned.
func (c Config) Password() string {
	return c["requirepass"]
}

{'fraction_non_alphanumeric': 0.14619883040935672, 'fraction_numerical': 0.011695906432748537, 'mean_word_length': 3.5679611650485437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1480701', 'n_tokens_mistral': 646, 'n_tokens_neox': 616, 'n_words': 234}