<commit_before>#!/usr/bin/env python3
import subprocess
from pathlib import Path


def run(command, log=True):
    try:
        subprocess.run(command, stdout=subprocess.PIPE)
    except subprocess.CalledProcessError as error:
        print('{}: {}\n{}'.format(error.returncode, error.cmd, error.output))
        raise error

    if log:
        print('{}\n'.format(' '.join(command)))
    else:
        print(' '.join(command))


def which(command):
    try:
        import shutil
        assert hasattr(shutil, 'which')
        full_path = shutil.which(command)
        assert full_path
        return full_path
    except AssertionError:
        raise RuntimeError('Command {} not installed'.format(command))
<commit_msg>Initial commit<commit_after>#!/usr/bin/env python3
import subprocess
from pathlib import Path


def run(command, log=False):
    try:
        subprocess.run(command, stdout=subprocess.PIPE)
    except subprocess.CalledProcessError as error:
        print('{}: {}\n{}'.format(error.returncode, error.cmd, error.output))
        raise error

    if log:
        print(' '.join(command))
    else:
        print(' '.join(command))


def which(command):
    try:
        import shutil
        assert hasattr(shutil, 'which')
        full_path = shutil.which(command)
        assert full_path
        return full_path
    except AssertionError:
        raise RuntimeError('Command {} not installed'.format(command))

{'fraction_non_alphanumeric': 0.11846689895470383, 'fraction_numerical': 0.0013937282229965157, 'mean_word_length': 2.839572192513369, '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': '3068734', 'n_tokens_mistral': 426, 'n_tokens_neox': 418, 'n_words': 103}