<commit_before>from os import makedirs
import textwrap

with open('../resources/sounds/blip.wav', 'rb') as i:
  data = i.read()

header = """\
#ifndef BLIP_H
#define BLIP_H

#include <cstdint>
#include <vector>

static std::vector<std::uint8_t> blip = {
  %s
};
#endif /* BLIP_H */
""" % '\n\t'.join(
  textwrap.wrap(
    ', '.join('0x%02x' % ord(y) for y in data),
  79)
)

makedirs('../src/res/')
with open('../src/res/blip.h', 'w') as f:
  f.write(header)<commit_msg>Fixed directory already exists error in wavconverter.py<commit_after>import errno
from os import makedirs, path
import textwrap

with open('../resources/sounds/blip.wav', 'rb') as i:
  data = i.read()

header = """\
#ifndef BLIP_H
#define BLIP_H

#include <cstdint>
#include <vector>

static std::vector<std::uint8_t> blip = {
  %s
};
#endif /* BLIP_H */
""" % '\n\t'.join(
  textwrap.wrap(
    ', '.join('0x%02x' % ord(y) for y in data),
  79)
)

try:
  makedirs('../src/res/')
except OSError:
  pass

with open('../src/res/blip.h', 'w') as f:
  f.write(header)
{'fraction_non_alphanumeric': 0.20348837209302326, 'fraction_numerical': 0.011627906976744186, 'mean_word_length': 3.611607142857143, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1165826', 'n_tokens_mistral': 441, 'n_tokens_neox': 433, 'n_words': 100}