<commit_before>import java.util.Random;
import com.arrayfire.Array;
import com.arrayfire.Util;

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Demonstrating Array Addition using ArrayFire");

        int[] dims;
        int total = 1;
        float[] left, right, res;
        Random rand = new Random();
        String str;

        dims = new int[2];
        dims[0] = 10;
        dims[1] = 1;

        for (int i = 0; i < dims.length; i++) {
            total *= dims[i];
        }

        left = new float[total];
        right = new float[total];

        for (int i = 0; i < total; i++) {
            left[i] = (float)i;
            double tmp = Math.ceil(rand.nextDouble() * 10) / 10;
            right[i] = (float)(tmp);
        }

        try {
            // Get info about arrayfire information
            Array.info();

            // Send data to ArrayFire
            Array A = new Array(dims, left);
            Array B = new Array(dims, right);

            // Create container for output
            Array C = new Array();

            // Do vector addition on the device
            C = Array.add(A, B);

            // Get result back to host memory
            res = C.host();

            for(int i = 0; i < total; i++) {
                str = Integer.toString(i) + ". ";
                float val = left[i] + right[i];
                str = str + Float.toString(left[i] ) + " + ";
                str = str + Float.toString(right[i]) + " = ";
                str = str + Float.toString(res[i]);
                System.out.println(str);
            }

        } catch (Exception e) {
            System.out.println("Failed to use ArrayFire");
            System.out.println(e.getMessage());
        }

    }
}<commit_msg>Fixing the Helloworld example to reflect change in API<commit_after>import java.util.Random;
import com.arrayfire.Array;
import com.arrayfire.Util;

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Demonstrating Array Addition using ArrayFire");

        int[] dims;
        int total = 1;
        float[] left, right, res;
        Random rand = new Random();
        String str;

        dims = new int[2];
        dims[0] = 10;
        dims[1] = 1;

        for (int i = 0; i < dims.length; i++) {
            total *= dims[i];
        }

        left = new float[total];
        right = new float[total];

        for (int i = 0; i < total; i++) {
            left[i] = (float)i;
            double tmp = Math.ceil(rand.nextDouble() * 10) / 10;
            right[i] = (float)(tmp);
        }

        try {
            // Get info about arrayfire information
            Array.info();

            // Send data to ArrayFire
            Array A = new Array(dims, left);
            Array B = new Array(dims, right);

            // Create container for output
            Array C = new Array();

            // Do vector addition on the device
            C = Array.add(A, B);

            // Get result back to host memory
            res = C.getFloatArray();

            for(int i = 0; i < total; i++) {
                str = Integer.toString(i) + ". ";
                float val = left[i] + right[i];
                str = str + Float.toString(left[i] ) + " + ";
                str = str + Float.toString(right[i]) + " = ";
                str = str + Float.toString(res[i]);
                System.out.println(str);
            }

        } catch (Exception e) {
            System.out.println("Failed to use ArrayFire");
            System.out.println(e.getMessage());
        }

    }
}
{'fraction_non_alphanumeric': 0.12904997254255904, 'fraction_numerical': 0.007688083470620538, 'mean_word_length': 1.4531986531986532, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '6166705', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1022, 'n_words': 304}