<commit_before>package com.kevlindev.karnaugh;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Util {
	private Util() {
	}

	public static String join(String delimiter, String... items) {
		return join(delimiter, Arrays.asList(items));
	}

	public static String join(String delimiter, List<? extends Object> items) {
		StringBuilder buffer = new StringBuilder();

		if (items != null && items.size() > 0) {
			buffer.append(items.get(0));

			for (int i = 1; i < items.size(); i++) {
				buffer.append(delimiter).append(items.get(i).toString());
			}
		}

		return buffer.toString();
	}
	
	public static String repeat(String text, int count) {
		StringBuilder buffer = new StringBuilder();
		
		for (int i = 0; i < count; i++) {
			buffer.append(text);
		}
		
		return buffer.toString();
	}

	public static List<List<MinTerm>> partitionMinTerms(int bits, List<MinTerm> minterms) {
		List<List<MinTerm>> result = new ArrayList<List<MinTerm>>();

		for (int i = 0; i <= bits; i++) {
			result.add(new ArrayList<MinTerm>());
		}

		for (MinTerm minterm : minterms) {
			int index = minterm.getBitCount();
			List<MinTerm> partition = result.get(index);

			partition.add(minterm);
		}

		return result;
	}
}<commit_msg>Make minterm partition more generic to collections in general and not just lists<commit_after>package com.kevlindev.karnaugh;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

public class Util {
	private Util() {
	}

	public static String join(String delimiter, String... items) {
		return join(delimiter, Arrays.asList(items));
	}

	public static String join(String delimiter, List<? extends Object> items) {
		StringBuilder buffer = new StringBuilder();

		if (items != null && items.size() > 0) {
			buffer.append(items.get(0));

			for (int i = 1; i < items.size(); i++) {
				buffer.append(delimiter).append(items.get(i).toString());
			}
		}

		return buffer.toString();
	}
	
	public static String repeat(String text, int count) {
		StringBuilder buffer = new StringBuilder();
		
		for (int i = 0; i < count; i++) {
			buffer.append(text);
		}
		
		return buffer.toString();
	}

	public static List<List<MinTerm>> partitionMinTerms(int bits, Collection<MinTerm> minterms) {
		List<List<MinTerm>> result = new ArrayList<List<MinTerm>>();

		for (int i = 0; i <= bits; i++) {
			result.add(new ArrayList<MinTerm>());
		}

		for (MinTerm minterm : minterms) {
			int index = minterm.getBitCount();
			List<MinTerm> partition = result.get(index);

			partition.add(minterm);
		}

		return result;
	}
}
{'fraction_non_alphanumeric': 0.14465648854961832, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 3.9359698681732582, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 25, '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': '5612262', 'n_tokens_mistral': 950, 'n_tokens_neox': 834, 'n_words': 226}