<commit_before>#ifndef HMLIB_TUPLE_INC
#define HMLIB_TUPLE_INC 100
#
#include<tuple>
#include<utility>
#include"exceptions.hpp"
#include"iterators/transform_iterator.hpp"
#include"hash.hpp"
namespace hmLib {
	namespace detail {
		template<size_t n, size_t r>
		struct tuple_transform_impl {
			template<typename Fn, typename... Tuple>
			auto operator()(Fn&& f, Tuple&&... t) {
				return std::tuple_cat(
					std::tuple<decltype((f(std::get<n>(t)...)))>(f(std::get<n>(t)...)),
					tuple_transform_impl<n+1,r-1>()(f, t...)
				);
			}
		};
		template<size_t n>
		struct tuple_transform_impl<n,1>{
			template<typename Fn, typename... Tuple>
			auto operator()(Fn&& f, Tuple&&... t) {
				return std::tuple<decltype((f(std::get<n>(t)...)))>(f(std::get<n>(t)...));
			}
		};
	}
	template<typename Fn, typename Tuple, typename... OtherTuples>
	auto tuple_transform(Fn&& f, Tuple&& t, OtherTuples&& ... ot) {
		return detail::tuple_transform_impl<0, std::tuple_size<typename std::decay<Tuple>::type>::value>()(
			std::forward<Fn>(f),
			std::forward<Tuple>(t),
			std::forward<OtherTuples>(ot)...
		);
	}

	//old definition
	template<typename Fn, typename Tuple, typename... OtherTuples>
	auto tuple_for_each(Fn&& f, Tuple&& t, OtherTuples&&... ot) {
		return detail::tuple_transform_impl<0, std::tuple_size<typename std::decay<Tuple>::type>::value>()(
			std::forward<Fn>(f),
			std::forward<Tuple>(t),
			std::forward<OtherTuples>(ot)...
		);
	}

	namespace detail {
		template<typename T, size_t n>
		struct tuple_array_impl {
			auto operator()(const T& ini) {
				return std::tuple_cat(
					std::tuple<T>(ini),
					tuple_array_impl<T, n-1>()(ini)
				);
			}
		};
		template<typename T>
		struct tuple_array_impl<T, 1> {
			auto operator()(const T& ini) { return std::tuple<T>(ini); }
		};
	}
	template<typename T, size_t n>
	auto tuple_array(const T& ini) {
		return detail::tuple_array_impl<T, n>()(ini);
	}

	namespace detail {
		template<typename T, size_t n>
		struct tuple_generate_impl {
			template<typename Fn>
			auto operator()(Fn&& f) {
				return std::tuple_cat(
					std::tuple<T>(f()),
					tuple_generate_impl<T, n - 1>()(f)
				);
			}
		};
		template<typename T>
		struct tuple_generate_impl<T, 1> {
			template<typename Fn>
			auto operator()(Fn&& f) { return std::tuple<T>(f()); }
		};
	}
	template<size_t n, typename Fn>
	auto tuple_generate(Fn&& f) {
		return detail::tuple_generate_impl<decltype(f()), n>()(std::forward<Fn>(f));
	}

	namespace detail {
		template<typename ans_type, unsigned int n, unsigned int r>
		struct tuple_apply_at_impl {
			template<typename Fn, typename... Tuple>
			decltype(auto) operator()(unsigned int pos, Fn&& f, Tuple&&... v) {
				if(n==pos) {
					return f(std::get<n>(v)...);
				}
				return tuple_apply_at_impl<n+1,r-1>()(pos, std::forward<Fn>(f), std::forward<Tuple>(v)...);
			}
		};
		template<unsigned int n>
		struct tuple_apply_at_impl<n,0>{
			template<typename Fn, typename... Tuple>
			decltype(auto) operator()(unsigned int pos, Fn&& f, Tuple&&... v) {
				hmLib_throw(hmLib::access_exceptions::out_of_range_access, "tuple access is out of range.");
				return f(std::get<0>(v)...);
			}
		};
	}
	template<typename Fn, typename Tuple, typename... OtherTuples>
	decltype(auto) tuple_apply_at(unsigned int n, Fn&& f, Tuple&& t, OtherTuples&&... ot){
		return detail::tuple_apply_at_impl<0,std::tuple_size<typename std::decay<Tuple>::type>::value>()(n,
			std::forward<Fn>(f),
			std::forward<Tuple>(t),
			std::forward<OtherTuples>(ot)...
		);
	}

	template<std::size_t n, typename Fn, typename... Tuple>
	decltype(auto) tuple_apply_at(Fn f, Tuple... t) {
		return f(std::get<n>(t)...);
	}<commit_msg>Fix: template argument of tuple_array_at was incorrect.<commit_after>#ifndef HMLIB_TUPLE_INC
#define HMLIB_TUPLE_INC 100
#
#include<tuple>
#include<utility>
#include"exceptions.hpp"
#include"iterators/transform_iterator.hpp"
#include"hash.hpp"
namespace hmLib {
	namespace detail {
		template<size_t n, size_t r>
		struct tuple_transform_impl {
			template<typename Fn, typename... Tuple>
			auto operator()(Fn&& f, Tuple&&... t) {
				return std::tuple_cat(
					std::tuple<decltype((f(std::get<n>(t)...)))>(f(std::get<n>(t)...)),
					tuple_transform_impl<n+1,r-1>()(f, t...)
				);
			}
		};
		template<size_t n>
		struct tuple_transform_impl<n,1>{
			template<typename Fn, typename... Tuple>
			auto operator()(Fn&& f, Tuple&&... t) {
				return std::tuple<decltype((f(std::get<n>(t)...)))>(f(std::get<n>(t)...));
			}
		};
	}
	template<typename Fn, typename Tuple, typename... OtherTuples>
	auto tuple_transform(Fn&& f, Tuple&& t, OtherTuples&& ... ot) {
		return detail::tuple_transform_impl<0, std::tuple_size<typename std::decay<Tuple>::type>::value>()(
			std::forward<Fn>(f),
			std::forward<Tuple>(t),
			std::forward<OtherTuples>(ot)...
		);
	}

	//old definition
	template<typename Fn, typename Tuple, typename... OtherTuples>
	auto tuple_for_each(Fn&& f, Tuple&& t, OtherTuples&&... ot) {
		return detail::tuple_transform_impl<0, std::tuple_size<typename std::decay<Tuple>::type>::value>()(
			std::forward<Fn>(f),
			std::forward<Tuple>(t),
			std::forward<OtherTuples>(ot)...
		);
	}

	namespace detail {
		template<typename T, size_t n>
		struct tuple_array_impl {
			auto operator()(const T& ini) {
				return std::tuple_cat(
					std::tuple<T>(ini),
					tuple_array_impl<T, n-1>()(ini)
				);
			}
		};
		template<typename T>
		struct tuple_array_impl<T, 1> {
			auto operator()(const T& ini) { return std::tuple<T>(ini); }
		};
	}
	template<typename T, size_t n>
	auto tuple_array(const T& ini) {
		return detail::tuple_array_impl<T, n>()(ini);
	}

	namespace detail {
		template<typename T, size_t n>
		struct tuple_generate_impl {
			template<typename Fn>
			auto operator()(Fn&& f) {
				return std::tuple_cat(
					std::tuple<T>(f()),
					tuple_generate_impl<T, n - 1>()(f)
				);
			}
		};
		template<typename T>
		struct tuple_generate_impl<T, 1> {
			template<typename Fn>
			auto operator()(Fn&& f) { return std::tuple<T>(f()); }
		};
	}
	template<size_t n, typename Fn>
	auto tuple_generate(Fn&& f) {
		return detail::tuple_generate_impl<decltype(f()), n>()(std::forward<Fn>(f));
	}

	namespace detail {
		template<unsigned int n, unsigned int r>
		struct tuple_apply_at_impl {
			template<typename Fn, typename... Tuple>
			decltype(auto) operator()(unsigned int pos, Fn&& f, Tuple&&... v) {
				if(n==pos) {
					return f(std::get<n>(v)...);
				}
				return tuple_apply_at_impl<n+1,r-1>()(pos, std::forward<Fn>(f), std::forward<Tuple>(v)...);
			}
		};
		template<unsigned int n>
		struct tuple_apply_at_impl<n,0>{
			template<typename Fn, typename... Tuple>
			decltype(auto) operator()(unsigned int pos, Fn&& f, Tuple&&... v) {
				hmLib_throw(hmLib::access_exceptions::out_of_range_access, "tuple access is out of range.");
				return f(std::get<0>(v)...);
			}
		};
	}
	template<typename Fn, typename Tuple, typename... OtherTuples>
	decltype(auto) tuple_apply_at(unsigned int n, Fn&& f, Tuple&& t, OtherTuples&&... ot){
		return detail::tuple_apply_at_impl<0,std::tuple_size<typename std::decay<Tuple>::type>::value>()(n,
			std::forward<Fn>(f),
			std::forward<Tuple>(t),
			std::forward<OtherTuples>(ot)...
		);
	}

	template<std::size_t n, typename Fn, typename... Tuple>
	decltype(auto) tuple_apply_at(Fn f, Tuple... t) {
		return f(std::get<n>(t)...);
	}
{'fraction_non_alphanumeric': 0.1916451919164519, 'fraction_numerical': 0.004611420046114201, 'mean_word_length': 4.351233671988389, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, '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': '6756217', 'n_tokens_mistral': 3135, 'n_tokens_neox': 2729, 'n_words': 530}