<commit_before>inherit .Base;

void create() {
    ::create("_integer");
}

void raw_to_medium(Serialization.Atom atom) {
    if (can_decode(atom)) {
	int i;
	if (1 == sscanf(atom->data, "%d", i)) {
	    atom->pdata = i; 
	    return;
	}
    }

    error("cannot decode %O\n", atom);
}

void medium_to_raw(Serialization.Atom atom) {
    atom->data = (string)atom->pdata;
}

void medium_to_done(Serialization.Atom atom) {
    atom->typed_data[this] = atom->pdata;
}

void done_to_medium(Serialization.Atom atom) {
    atom->pdata = atom->typed_data[this];
}

int(0..1) can_encode(mixed a) {
    return intp(a);
}

string _sprintf(int c) {
    if (c == 'O') {
	return "Int()";
    }<commit_msg>calling can_decode from any of the low level functions can result in bad loops.<commit_after>inherit .Base;

void create() {
    ::create("_integer");
}

void raw_to_medium(Serialization.Atom atom) {
	int i;

	if (1 == sscanf(atom->data, "%d", i)) {
	    atom->pdata = i; 
	    return;
	}

    error("cannot decode %O\n", atom);
}

void medium_to_raw(Serialization.Atom atom) {
    atom->data = (string)atom->pdata;
}

void medium_to_done(Serialization.Atom atom) {
    atom->typed_data[this] = atom->pdata;
}

void done_to_medium(Serialization.Atom atom) {
    atom->pdata = atom->typed_data[this];
}

int(0..1) can_encode(mixed a) {
    return intp(a);
}

string _sprintf(int c) {
    if (c == 'O') {
	return "Int()";
    }
{'fraction_non_alphanumeric': 0.16866619618913198, 'fraction_numerical': 0.004234297812279464, 'mean_word_length': 3.515923566878981, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '5000508', 'n_tokens_mistral': 550, 'n_tokens_neox': 553, 'n_words': 115}