<commit_before>#!/usr/bin/env python

import os
import subprocess
import unittest

csibe_path = os.path.dirname(os.path.realpath(__file__))
build_directory = "build"

if not os.path.isdir(build_directory):
    os.makedirs(build_directory)

os.chdir(build_directory)

subprocess.call(["cmake", csibe_path])
<commit_msg>Add logic and error-handling for CMake and make invocations<commit_after>#!/usr/bin/env python

import argparse
import os
import subprocess
import sys

parser = argparse.ArgumentParser()
parser.add_argument("-j", "--jobs", type=int, default=1, help="number of jobs for make")
args = parser.parse_args()

make_jobs = args.jobs

csibe_path = os.path.dirname(os.path.realpath(__file__))
build_directory = "build"

if not os.path.isdir(build_directory):
    os.makedirs(build_directory)

os.chdir(build_directory)

cmake_return_value = subprocess.call(["cmake", csibe_path])
if cmake_return_value:
    sys.exit(cmake_return_value)

make_return_value = subprocess.call(["make", "-j{}".format(make_jobs)])
if make_return_value:
    sys.exit(make_return_value)

make_size_return_value =  subprocess.call(["make", "size"])
if make_size_return_value:
    sys.exit(make_size_return_value)

{'fraction_non_alphanumeric': 0.12447786131996658, 'fraction_numerical': 0.000835421888053467, 'mean_word_length': 6.304878048780488, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1280746', 'n_tokens_mistral': 430, 'n_tokens_neox': 422, 'n_words': 79}