<commit_before>package florian_haas.lucas.util;

import java.math.BigDecimal;
import java.util.*;

public class Utils {

	@SuppressWarnings("unchecked")
	public static <K, V> Map<K, V> deepUnmodifiableMap(Map<K, V> map) {
		Map<K, V> tmp = new HashMap<>();
		map.forEach((key, value) -> {
			Object valueO = value;
			if (value instanceof Map<?, ?>) {
				Map<?, ?> val = deepUnmodifiableMap((Map<?, ?>) value);
				valueO = val;
			}
			tmp.put(key, (V) valueO);
		});
		return Collections.unmodifiableMap(tmp);
	}

	public static <T extends Comparable<? super T>> Boolean isEqual(T comp1, T comp2) {
		return comp1.compareTo(comp2) == 0;
	}

	public static <T extends Comparable<? super T>> Boolean isLessThan(T comp1, T comp2) {
		return comp1.compareTo(comp2) < 0;
	}

	public static <T extends Comparable<? super T>> Boolean isGreatherThan(T comp1, T comp2) {
		return comp1.compareTo(comp2) > 0;
	}

	public static <T extends Comparable<? super T>> Boolean isGreatherEqual(T comp1, T comp2) {
		return comp1.compareTo(comp2) >= 0;
	}

	public static <T extends Comparable<? super T>> Boolean isLessEqual(T comp1, T comp2) {
		return comp1.compareTo(comp2) <= 0;
	}

	public static Boolean isZero(BigDecimal decimal) {
		return isEqual(decimal, BigDecimal.ZERO);
	}

	public static Boolean isLessThanZero(BigDecimal decimal) {
		return isLessThan(decimal, BigDecimal.ZERO);
	}

	public static Boolean isGreatherThanZero(BigDecimal decimal) {
		return isGreatherThan(decimal, BigDecimal.ZERO);
	}

	public static Boolean isGreatherEqualZero(BigDecimal decimal) {
		return isGreatherEqual(decimal, BigDecimal.ZERO);
	}

	public static Boolean isLessEqualZero(BigDecimal decimal) {
		return isLessEqual(decimal, BigDecimal.ZERO);
	}

	public static boolean isInRangeInclusive(long start, long end, long value) {
		return value <= end && value >= start;
	}

	public static boolean isInRangeExclusive(long start, long end, long value) {
		return value < end && value > start;
	}

	public static boolean isInRangeInclusive(int start, int end, int value) {
		return value <= end && value >= start;
	}

	public static boolean isInRangeExclusive(int start, int end, int value) {
		return value < end && value > start;
	}
}
<commit_msg>Added methods to get type class from generic type args<commit_after>package florian_haas.lucas.util;

import java.lang.reflect.ParameterizedType;
import java.math.BigDecimal;
import java.util.*;

public class Utils {

	@SuppressWarnings("unchecked")
	public static <K, V> Map<K, V> deepUnmodifiableMap(Map<K, V> map) {
		Map<K, V> tmp = new HashMap<>();
		map.forEach((key, value) -> {
			Object valueO = value;
			if (value instanceof Map<?, ?>) {
				Map<?, ?> val = deepUnmodifiableMap((Map<?, ?>) value);
				valueO = val;
			}
			tmp.put(key, (V) valueO);
		});
		return Collections.unmodifiableMap(tmp);
	}

	public static <T extends Comparable<? super T>> Boolean isEqual(T comp1, T comp2) {
		return comp1.compareTo(comp2) == 0;
	}

	public static <T extends Comparable<? super T>> Boolean isLessThan(T comp1, T comp2) {
		return comp1.compareTo(comp2) < 0;
	}

	public static <T extends Comparable<? super T>> Boolean isGreatherThan(T comp1, T comp2) {
		return comp1.compareTo(comp2) > 0;
	}

	public static <T extends Comparable<? super T>> Boolean isGreatherEqual(T comp1, T comp2) {
		return comp1.compareTo(comp2) >= 0;
	}

	public static <T extends Comparable<? super T>> Boolean isLessEqual(T comp1, T comp2) {
		return comp1.compareTo(comp2) <= 0;
	}

	public static Boolean isZero(BigDecimal decimal) {
		return isEqual(decimal, BigDecimal.ZERO);
	}

	public static Boolean isLessThanZero(BigDecimal decimal) {
		return isLessThan(decimal, BigDecimal.ZERO);
	}

	public static Boolean isGreatherThanZero(BigDecimal decimal) {
		return isGreatherThan(decimal, BigDecimal.ZERO);
	}

	public static Boolean isGreatherEqualZero(BigDecimal decimal) {
		return isGreatherEqual(decimal, BigDecimal.ZERO);
	}

	public static Boolean isLessEqualZero(BigDecimal decimal) {
		return isLessEqual(decimal, BigDecimal.ZERO);
	}

	public static boolean isInRangeInclusive(long start, long end, long value) {
		return value <= end && value >= start;
	}

	public static boolean isInRangeExclusive(long start, long end, long value) {
		return value < end && value > start;
	}

	public static boolean isInRangeInclusive(int start, int end, int value) {
		return value <= end && value >= start;
	}

	public static boolean isInRangeExclusive(int start, int end, int value) {
		return value < end && value > start;
	}

	public static <T> Class<T> getClassFromArgs(Class<?> clazz) {
		return getClassFromArgs(clazz, 0);
	}

	@SuppressWarnings("unchecked")
	public static <T> Class<T> getClassFromArgs(Class<?> clazz, int arg) {
		return (Class<T>) ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments()[arg];
	}
}

{'fraction_non_alphanumeric': 0.11562189054726368, 'fraction_numerical': 0.010149253731343283, 'mean_word_length': 3.93713163064833, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 60, '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': '2555892', 'n_tokens_mistral': 1729, 'n_tokens_neox': 1599, 'n_words': 463}