<commit_before>#pragma once

#include <functional>

namespace supermarx
{

class stubborn
{
public:
	template<typename T>
	static T attempt(std::function<T()> const& f, size_t attempts = 5)
	{
		for(size_t i = 0; i < attempts; ++i)
		{
			try
			{
				return f();
			} catch(std::exception const& e)
			{<commit_msg>Parameterized stubborn in exception type<commit_after>#pragma once

#include <functional>

namespace supermarx
{

class stubborn
{
public:
	template<typename T, typename E = std::runtime_error>
	static T attempt(std::function<T()> const& f, size_t attempts = 5)
	{
		for(size_t i = 0; i < attempts; ++i)
		{
			try
			{
				return f();
			}
			catch(E const& e)
			{
{'fraction_non_alphanumeric': 0.13196480938416422, 'fraction_numerical': 0.005865102639296188, 'mean_word_length': 3.7430555555555554, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '6792376', 'n_tokens_mistral': 285, 'n_tokens_neox': 246, 'n_words': 69}