<commit_before>#!/usr/bin/env python
import time
import random
import re
import subprocess
import signal
import sys
import os

def run(cmd, **kwargs):
    p = subprocess.Popen(cmd.split(),
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE,
                         **kwargs)
    p.wait()
    out = p.stdout.read()
    err = p.stderr.read()

    time.sleep(0.1)
    return p.returncode, out + '\n' + err

def spawn(cmd, **kwargs):
    p = subprocess.Popen(cmd.split(),
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE,
                         **kwargs)
    time.sleep(0.4)
    return p

def wait(p, match):
    os.kill(p.pid, signal.SIGINT)
    p.wait()
    out = p.stdout.read()
    err = p.stderr.read()
    return bool(re.search(match, out)), out + '\n' + err



def gen(prog, arg="", **kwargs):
    Prog = ''.join([w.capitalize() for w in prog.split('_')])
    ctx = {
        'prog': prog,
        'Prog': Prog,
        'rubyver': os.environ.get('RUBYVER', '1.8'),
        'arg': arg,
        'java': kwargs.get('java', Prog),
        'dotnet': kwargs.get('dotnet', Prog),
        }
    return [
        ('python', './venv/bin/python %(prog)s.py %(arg)s' % ctx),
        ('erlang', './%(prog)s.erl %(arg)s' % ctx),
        ('java', 'java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:'
             'rabbitmq-client.jar %(java)s %(arg)s' % ctx),
        ('dotnet', 'env MONO_PATH=lib/bin mono %(dotnet)s.exe %(arg)s' % ctx),
        ('ruby', 'env RUBYOPT=-rubygems GEM_HOME=gems/gems RUBYLIB=gems/lib '<commit_msg>Our CI server is quite slow, give it a bit more time.<commit_after>#!/usr/bin/env python
import time
import random
import re
import subprocess
import signal
import sys
import os

def run(cmd, **kwargs):
    p = subprocess.Popen(cmd.split(),
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE,
                         **kwargs)
    p.wait()
    out = p.stdout.read()
    err = p.stderr.read()

    time.sleep(0.1)
    return p.returncode, out + '\n' + err

def spawn(cmd, **kwargs):
    p = subprocess.Popen(cmd.split(),
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE,
                         **kwargs)
    time.sleep(1.0)
    return p

def wait(p, match):
    os.kill(p.pid, signal.SIGINT)
    p.wait()
    out = p.stdout.read()
    err = p.stderr.read()
    return bool(re.search(match, out)), out + '\n' + err



def gen(prog, arg="", **kwargs):
    Prog = ''.join([w.capitalize() for w in prog.split('_')])
    ctx = {
        'prog': prog,
        'Prog': Prog,
        'rubyver': os.environ.get('RUBYVER', '1.8'),
        'arg': arg,
        'java': kwargs.get('java', Prog),
        'dotnet': kwargs.get('dotnet', Prog),
        }
    return [
        ('python', './venv/bin/python %(prog)s.py %(arg)s' % ctx),
        ('erlang', './%(prog)s.erl %(arg)s' % ctx),
        ('java', 'java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:'
             'rabbitmq-client.jar %(java)s %(arg)s' % ctx),
        ('dotnet', 'env MONO_PATH=lib/bin mono %(dotnet)s.exe %(arg)s' % ctx),
        ('ruby', 'env RUBYOPT=-rubygems GEM_HOME=gems/gems RUBYLIB=gems/lib '
{'fraction_non_alphanumeric': 0.17881200244947948, 'fraction_numerical': 0.00612369871402327, 'mean_word_length': 2.0110599078341016, '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': '1227861', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1149, 'n_words': 247}