<commit_before>#include <cstdlib>
#include <cstdio>
#include <chrono>
#include <algorithm>
#include <numeric>
#include "hll.h"

using namespace std::chrono;

using tp = std::chrono::system_clock::time_point;

static const size_t BITS = 20;


bool test_qty(size_t lim) {
    hll::hll_t t(BITS);
    size_t i(0);
    while(i < lim) t.addh(i++);
    return std::abs(t.report() - lim) <= t.est_err();
}


/*
 * If no arguments are provided, runs test with 1 << 22 elements. 
 * Otherwise, it parses the first argument and tests that integer.
 */

int main(int argc, char *argv[]) {
    size_t i(0), lim(1 << 22);
    std::vector<std::uint64_t> vals;
    for(char **p(argv + 1); *p; ++p) vals.push_back(strtoull(*p, 0, 10));
    if(vals.empty()) vals.push_back(1<<22);
    for(auto val: vals) {
        hll::hll_t t(BITS);
        for(i = 0; i < val; t.addh(i++));
        fprintf(stderr, "Quantity expected: %zu. Quantity estimated: %lf. Error bounds: %lf.\n",
                i, t.report(), t.est_err());
        fprintf(stderr, "Within bounds? %s\n", t.est_err() <= std::abs(lim - t.report()) ? "true": "false"); 
    }
	return EXIT_SUCCESS;
}<commit_msg>Whitespace<commit_after>#include <cstdlib>
#include <cstdio>
#include <chrono>
#include <algorithm>
#include <numeric>
#include "hll.h"

using namespace std::chrono;

using tp = std::chrono::system_clock::time_point;

static const size_t BITS = 20;


bool test_qty(size_t lim) {
    hll::hll_t t(BITS);
    size_t i(0);
    while(i < lim) t.addh(i++);
    return std::abs(t.report() - lim) <= t.est_err();
}


/*
 * If no arguments are provided, runs test with 1 << 22 elements.
 * Otherwise, it parses the first argument and tests that integer.
 */

int main(int argc, char *argv[]) {
    size_t i(0), lim(1 << 22);
    std::vector<std::uint64_t> vals;
    for(char **p(argv + 1); *p; ++p) vals.push_back(strtoull(*p, 0, 10));
    if(vals.empty()) vals.push_back(1<<22);
    for(auto val: vals) {
        hll::hll_t t(BITS);
        for(i = 0; i < val; t.addh(i++));
        fprintf(stderr, "Quantity expected: %zu. Quantity estimated: %lf. Error bounds: %lf.\n",
                i, t.report(), t.est_err());
        fprintf(stderr, "Within bounds? %s\n", t.est_err() <= std::abs(lim - t.report()) ? "true": "false");
    }
	return EXIT_SUCCESS;
}
{'fraction_non_alphanumeric': 0.18600608431116905, 'fraction_numerical': 0.017383746197305518, 'mean_word_length': 3.4354527938342967, 'pattern_counts': {'":': 2, '<': 35, '<?xml version=': 0, '>': 15, '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': '6211220', 'n_tokens_mistral': 923, 'n_tokens_neox': 879, 'n_words': 226}