<commit_before>package main

import (
	"fmt"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/pkg/api/v1"
	"k8s.io/client-go/rest"
	"os"
	"time"
)

func clientSet() *kubernetes.Clientset {
	config, err := rest.InClusterConfig()
	if err != nil {
		panic(err.Error())
	}
	clientSet, err := kubernetes.NewForConfig(config)
	if err != nil {
		panic(err.Error())
	}
	return clientSet
}

func getPods(clientSet *kubernetes.Clientset, options options) *v1.PodList {
	coreClient := clientSet.CoreV1()
	pods := coreClient.Pods(options.namespace)
	listOptions := v1.ListOptions{}
	if options.labelExclusion != nil {
		selector := labels.NewSelector().Add(*options.labelExclusion)
		listOptions.LabelSelector = selector.String()
	}
	podList, err := pods.List(listOptions)
	if err != nil {
		panic(err.Error())
	}
	return podList
}

func reap(clientSet *kubernetes.Clientset, pod v1.Pod, reason string) {
	fmt.Printf("Reaping Pod %s because %s\n", pod.Name, reason)
	err := clientSet.Core().Pods(pod.Namespace).Delete(pod.Name, nil)
	if err != nil {
		// log the error, but continue on
		fmt.Fprintf(os.Stderr, "unable to delete pod %s because %s", pod.Name, err)
	}
}
<commit_msg>simplified panics<commit_after>package main

import (
	"fmt"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/pkg/api/v1"
	"k8s.io/client-go/rest"
	"os"
	"time"
)

func clientSet() *kubernetes.Clientset {
	config, err := rest.InClusterConfig()
	if err != nil {
		panic(err)
	}
	clientSet, err := kubernetes.NewForConfig(config)
	if err != nil {
		panic(err)
	}
	return clientSet
}

func getPods(clientSet *kubernetes.Clientset, options options) *v1.PodList {
	coreClient := clientSet.CoreV1()
	pods := coreClient.Pods(options.namespace)
	listOptions := v1.ListOptions{}
	if options.labelExclusion != nil {
		selector := labels.NewSelector().Add(*options.labelExclusion)
		listOptions.LabelSelector = selector.String()
	}
	podList, err := pods.List(listOptions)
	if err != nil {
		panic(err)
	}
	return podList
}

func reap(clientSet *kubernetes.Clientset, pod v1.Pod, reason string) {
	fmt.Printf("Reaping Pod %s because %s\n", pod.Name, reason)
	err := clientSet.Core().Pods(pod.Namespace).Delete(pod.Name, nil)
	if err != nil {
		// log the error, but continue on
		fmt.Fprintf(os.Stderr, "unable to delete pod %s because %s", pod.Name, err)
	}
}

{'fraction_non_alphanumeric': 0.15201005025125627, 'fraction_numerical': 0.007537688442211055, 'mean_word_length': 4.368539325842697, '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': '6006702', 'n_tokens_mistral': 925, 'n_tokens_neox': 907, 'n_words': 187}