<commit_before>package config

import (
	"os"
	"strconv"

	"github.com/pkg/errors"
)

type config struct {
	Host                string
	Port                string
	RedisAddr           string
	RedisPassword       string
	RedisDB             int
	DynamoDBRegion      string
	DynamoDBTablePrefix string

	Debug bool
}

const (
	// DefaultPort is the default listening port.
	DefaultPort = "8000"
	// DefaultRedisAddr is the port to connect to redis-server process.
	DefaultRedisAddr = "localhost:6379"
	// DefaultRedisPassword is the password to connect to redis-server process.
	DefaultRedisPassword = ""
	// DefaultRedisDB is the redis db number.
	DefaultRedisDB = 0
	// DefaultDynamoDBRegion is the DynamoDB region.
	DefaultDynamoDBRegion = "ap-northeast-1"
	// DefaultDynamoDBTablePrefix is the prefix of DynamoDB table name.
	DefaultDynamoDBTablePrefix = "diamondb_datapoints"
)

// Config is set from the environment variables.
var Config = &config{}

// Load loads into Config from environment values.
func Load() error {
	Config.Port = os.Getenv("DIAMONDB_PORT")
	if Config.Port == "" {
		Config.Port = DefaultPort
	}
	Config.RedisAddr = os.Getenv("DIAMONDB_REDIS_ADDR")
	if Config.RedisAddr == "" {
		Config.RedisAddr = DefaultRedisAddr
	}
	Config.RedisPassword = os.Getenv("<PASSWORD>")
	if Config.RedisPassword == "" {
		Config.RedisPassword = <PASSWORD>
	}
	redisdb := os.Getenv("DIAMONDB_REDIS_DB")
	if redisdb == "" {
		Config.RedisDB = DefaultRedisDB
	} else {
		v, err := strconv.Atoi(redisdb)
		if err != nil {
			return errors.New("DIAMONDB_REDIS_DB must be an integer")
		}
		Config.RedisDB = v
	}
	Config.DynamoDBRegion = os.Getenv("DIAMONDB_DYNAMODB_REGION")
	if Config.DynamoDBRegion == "" {
		Config.DynamoDBRegion = DefaultDynamoDBRegion
	}
	Config.DynamoDBTablePrefix = os.Getenv("DIAMONDB_DYNAMODB_TABLE_PREFIX")
	if Config.DynamoDBTablePrefix == "" {
		Config.DynamoDBTablePrefix = DefaultDynamoDBRegion
	}

	if os.Getenv("DIAMONDB_DEBUG") != "" {
		Config.Debug = true
	}

	return nil
}<commit_msg>Fix typo<commit_after>package config

import (
	"os"
	"strconv"

	"github.com/pkg/errors"
)

type config struct {
	Host                string
	Port                string
	RedisAddr           string
	RedisPassword       string
	RedisDB             int
	DynamoDBRegion      string
	DynamoDBTablePrefix string

	Debug bool
}

const (
	// DefaultPort is the default listening port.
	DefaultPort = "8000"
	// DefaultRedisAddr is the port to connect to redis-server process.
	DefaultRedisAddr = "localhost:6379"
	// DefaultRedisPassword is the password to connect to redis-server process.
	DefaultRedisPassword = ""
	// DefaultRedisDB is the redis db number.
	DefaultRedisDB = 0
	// DefaultDynamoDBRegion is the DynamoDB region.
	DefaultDynamoDBRegion = "ap-northeast-1"
	// DefaultDynamoDBTablePrefix is the prefix of DynamoDB table name.
	DefaultDynamoDBTablePrefix = "diamondb_datapoints"
)

// Config is set from the environment variables.
var Config = &config{}

// Load loads into Config from environment values.
func Load() error {
	Config.Port = os.Getenv("DIAMONDB_PORT")
	if Config.Port == "" {
		Config.Port = DefaultPort
	}
	Config.RedisAddr = os.Getenv("DIAMONDB_REDIS_ADDR")
	if Config.RedisAddr == "" {
		Config.RedisAddr = DefaultRedisAddr
	}
	Config.RedisPassword = os.Getenv("DIAMONDB_REDIS_PASSWORD")
	if Config.RedisPassword == "" {
		Config.RedisPassword = <PASSWORD>
	}
	redisdb := os.Getenv("DIAMONDB_REDIS_DB")
	if redisdb == "" {
		Config.RedisDB = DefaultRedisDB
	} else {
		v, err := strconv.Atoi(redisdb)
		if err != nil {
			return errors.New("DIAMONDB_REDIS_DB must be an integer")
		}
		Config.RedisDB = v
	}
	Config.DynamoDBRegion = os.Getenv("DIAMONDB_DYNAMODB_REGION")
	if Config.DynamoDBRegion == "" {
		Config.DynamoDBRegion = DefaultDynamoDBRegion
	}
	Config.DynamoDBTablePrefix = os.Getenv("DIAMONDB_DYNAMODB_TABLE_PREFIX")
	if Config.DynamoDBTablePrefix == "" {
		Config.DynamoDBTablePrefix = DefaultDynamoDBTablePrefix
	}

	if os.Getenv("DIAMONDB_DEBUG") != "" {
		Config.Debug = true
	}

	return nil
}
{'fraction_non_alphanumeric': 0.09903917220990392, 'fraction_numerical': 0.004927322000492732, 'mean_word_length': 3.731934731934732, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '2444420', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1425, 'n_words': 315}