<commit_before>import java.util.ArrayList;

public class Sieve {

    private static int _max = 0;

    /**
     * "Debug" version of printSieve.  This will show all numbers
     * along with their T/F mark of primality.
     * @param results - list of ints from 1 to n
     * @param prime - boolean array indicating primality
     */
    
    public static void printsieve(int[] results, boolean[] prime) {
	    System.out.print("> ");
	    char aChar = ' ';

	    // Just loop through the array and print the values.
	    // Put a (T) after each one if it has been marked
	    // prime; put a (F) after one if it has  been marked
	    // composite (not prime).
	    
	    for (int j = 0; j < results.length;) {
		aChar = prime[j] ? 'T' : 'F';
		System.out.print(results[j] + "(" + aChar + ") ");
		j++;
	    }
	    System.out.println();
    }

    /**
     * Prints out an array which should contain all prime values.
     * Really, will print out any array.
     * @param results array of ints to print out
     */
    
    public static void printSieve(int[] results) {

	// As long as there are elements in the array,
	// print it.  Otherwise, print "BLANK".
	if (results == null) {
            System.out.println("BLANK");
        } else if (results.length == 0) {
            System.out.println("BLANK");
        } else {
	    System.out.print("> ");
	    for (int j = 1; j < results.length;) {
		System.out.print(results[j] + " ");
		j++;
	    }
	}
    }

    /**
     * @param s the size of the array to return
     */
    
    public static boolean[] getTrueArray(int s) {
	boolean toReturn[] = new boolean[s];
	for (int j = 0; j < s; j++) {
	    toReturn[j] = true;
	}
	// Return an all-true array.
	return toReturn;
	
    }

    /**
     * Convert our "behind the scenes" arrays - the list of ints from
     * 1 to n and the same-size array which indicates their primality -
     * into a simple array of all prime values.
     * @param results an array with all ints from 1 to n
     * @return int[] the prime numbers from 1 to n 
     */
    
    public static int[] convertResults(int[] results, boolean prime[] ) {

	// Create an ArrayList.	 If a value is true for primality,
	// add it to the array list.
	
	ArrayList<Integer> actual = new ArrayList<Integer>();
	for (int j = 0; j < results.length; j++) {
	    if (prime[j]) {
		actual.add(new Integer(j + 1));
	    }
	}
<commit_msg>style fix<commit_after>import java.util.ArrayList;

public class Sieve {

    private static int _max = 0;

    /**
     * "Debug" version of printSieve.  This will show all numbers
     * along with their T/F mark of primality.
     * @param results - list of ints from 1 to n
     * @param prime - boolean array indicating primality
     */
    
    public static void printsieve(int[] results, boolean[] prime) {
	    System.out.print("> ");
	    char aChar = ' ';

	    // Just loop through the array and print the values.
	    // Put a (T) after each one if it has been marked
	    // prime; put a (F) after one if it has  been marked
	    // composite (not prime).
	    
	    for (int j = 0; j < results.length;) {
		aChar = prime[j] ? 'T' : 'F';
		System.out.print(results[j] + "(" + aChar + ") ");
		j++;
	    }
	    System.out.println();
    }

    /**
     * Prints out an array which should contain all prime values.
     * Really, will print out any array.
     * @param results array of ints to print out
     */
    
    public static void printSieve(int[] results) {

	// As long as there are elements in the array,
	// print it.  Otherwise, print "BLANK".
	if (results == null) {
            System.out.println("BLANK");
        } else if (results.length == 0) {
            System.out.println("BLANK");
        } else {
	    System.out.print("> ");
	    for (int j = 1; j < results.length;) {
		System.out.print(results[j] + " ");
		j++;
	    }
	}
    }

    /**
     * @param size the size of the array to return.
     */
    
    public static boolean[] getTrueArray(int size) {
	boolean[] toReturn = new boolean[size];
	for (int j = 0; j < size; j++) {
	    toReturn[j] = true;
	}
	// Return an all-true array.
	return toReturn;
	
    }

    /**
     * Convert our "behind the scenes" arrays - the list of ints from
     * 1 to n and the same-size array which indicates their primality -
     * into a simple array of all prime values.
     * @param results an array with all ints from 1 to n
     * @return int[] the prime numbers from 1 to n 
     */
    
    public static int[] convertResults(int[] results, boolean prime[] ) {

	// Create an ArrayList.	 If a value is true for primality,
	// add it to the array list.
	
	ArrayList<Integer> actual = new ArrayList<Integer>();
	for (int j = 0; j < results.length; j++) {
	    if (prime[j]) {
		actual.add(new Integer(j + 1));
	    }
	}

{'fraction_non_alphanumeric': 0.1258057808276149, 'fraction_numerical': 0.004574755666458723, 'mean_word_length': 2.1665569453587885, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '4067909', 'n_tokens_mistral': 1583, 'n_tokens_neox': 1488, 'n_words': 567}