<commit_before>package main

import (
	"encoding/base64"
	"errors"
)

type TemplateProcessor struct {
	configMaps map[string]*ConfigMap
	namespace  string
	secrets    map[string]*Secret
	templates  map[string]*ConfigMap
}

func (t *TemplateProcessor) configmap(name, key string) (string, error) {
	// Check if the config map has already been fetched for this
	// namespace. If not, retrieve the config map and cached it for
	// future use.
	_, ok := t.configMaps[name]
	if !ok {
		cm, err := getConfigMap(t.namespace, name)
		if err != nil {
			return "", err
		}
		t.configMaps[name] = cm
	}

	v, ok := t.configMaps[name].Data[key]
	if !ok {
		return "", errors.New("missing key " + key)<commit_msg>code cleanup and refactor<commit_after>package main

import (
	"encoding/base64"
	"errors"
)

type TemplateProcessor struct {
	configMaps map[string]*ConfigMap
	namespace  string
	secrets    map[string]*Secret
	templates  map[string]*ConfigMap
}

func (t *TemplateProcessor) configmap(name, key string) (string, error) {
	// Check if the config map has already been fetched for this
	// namespace. If not, retrieve the config map and cache it for
	// future use.
	_, ok := t.configMaps[name]
	if !ok {
		cm, err := getConfigMap(t.namespace, name)
		if err != nil {
			return "", err
		}
		t.configMaps[name] = cm
	}

	v, ok := t.configMaps[name].Data[key]
	if !ok {
		return "", errors.New("missing key " + key)
{'fraction_non_alphanumeric': 0.12331679659815734, 'fraction_numerical': 0.002834868887313962, 'mean_word_length': 3.802721088435374, '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': '1139799', 'n_tokens_mistral': 499, 'n_tokens_neox': 477, 'n_words': 146}