<commit_before>#include "tools.h"

avr_t* Tools::init(char const *fname, uint32_t freq) {
    avr_t *avr = NULL;
    elf_firmware_t f;

    avr_init(avr);
    avr_load_firmware(avr, &f);

    return avr;
}

void Tools::avr_step(avr_t *avr, uint32_t steps) {
    for (int i = 0; i < steps; ++i) {
        avr_run(avr);
    }
}

avr_ioport_state_t Tools::avr_get_state(avr_t *avr, char port) {
    avr_ioport_state_t state;
    avr_ioctl(avr, AVR_IOCTL_IOPORT_GETSTATE(port), &state);

    return state;
}

void Tools::avr_set_state(avr_t *avr, char port, int reg, int mask, int v) {
    avr_ioport_external_t ext;
    ext.name = reg;
    ext.value = v;
    ext.mask = mask;
    avr_ioctl(avr, AVR_IOCTL_IOPORT_SET_EXTERNAL(port), &ext);<commit_msg>test: added use case for fname<commit_after>#include "tools.h"

avr_t* Tools::init(const char *fname, uint32_t freq) {
    avr_t *avr = NULL;
    elf_firmware_t f;

    elf_read_firmware(fname, &f);

    avr_init(avr);
    avr_load_firmware(avr, &f);

    return avr;
}

void Tools::avr_step(avr_t *avr, uint32_t steps) {
    for (int i = 0; i < steps; ++i) {
        avr_run(avr);
    }
}

avr_ioport_state_t Tools::avr_get_state(avr_t *avr, char port) {
    avr_ioport_state_t state;
    avr_ioctl(avr, AVR_IOCTL_IOPORT_GETSTATE(port), &state);

    return state;
}

void Tools::avr_set_state(avr_t *avr, char port, int reg, int mask, int v) {
    avr_ioport_external_t ext;
    ext.name = reg;
    ext.value = v;
    ext.mask = mask;
    avr_ioctl(avr, AVR_IOCTL_IOPORT_SET_EXTERNAL(port), &ext);
{'fraction_non_alphanumeric': 0.12807244501940493, 'fraction_numerical': 0.00646830530401035, 'mean_word_length': 3.702127659574468, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6680331', 'n_tokens_mistral': 707, 'n_tokens_neox': 694, 'n_words': 136}