<commit_before>import atexit
import BaseHTTPServer
import errno
import os
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import threading
import time


class ToSServerThread(threading.Thread):
    class ToSHandler(BaseHTTPServer.BaseHTTPRequestHandler):
        def do_GET(self):
            self.send_response(200)
            self.end_headers()
            self.wfile.write("Do What Ye Will (An it Harm None).\n")
    def run(self):
        try:
            BaseHTTPServer.HTTPServer(("localhost", 4001), self.ToSHandler).serve_forever()
        except Exception as e:
            print "Problem starting ToSServer: %s" % e
            sys.exit(1)


config = os.environ.get('BOULDER_CONFIG')
if config is None:
    config = 'test/boulder-config.json'
processes = []


def install(progs, race_detection):
    cmd = "go install"
    if race_detection:
        cmd = """go install -race"""

    for prog in progs:
        cmd += " ./" + prog
    p = subprocess.Popen(cmd, shell=True)
    out, err = p.communicate()
    if p.returncode != 0:
        sys.stderr.write("unable to run go install: %s\n" % cmd)
        sys.stderr.write("stdout:\n" + out + "\n")
        sys.stderr.write("stderr: \n" + err + "\n")
        return False
    print('installed %s with pid %d' % (cmd, p.pid))
    return True

def run(path, race_detection):
    binary = os.path.basename(path)
    cmd = """GORACE="halt_on_error=1" %s --config %s""" % (binary, config)<commit_msg>Fix error output in startservers.<commit_after>import atexit
import BaseHTTPServer
import errno
import os
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import threading
import time


class ToSServerThread(threading.Thread):
    class ToSHandler(BaseHTTPServer.BaseHTTPRequestHandler):
        def do_GET(self):
            self.send_response(200)
            self.end_headers()
            self.wfile.write("Do What Ye Will (An it Harm None).\n")
    def run(self):
        try:
            BaseHTTPServer.HTTPServer(("localhost", 4001), self.ToSHandler).serve_forever()
        except Exception as e:
            print "Problem starting ToSServer: %s" % e
            sys.exit(1)


config = os.environ.get('BOULDER_CONFIG')
if config is None:
    config = 'test/boulder-config.json'
processes = []


def install(progs, race_detection):
    cmd = "go install"
    if race_detection:
        cmd = """go install -race"""

    for prog in progs:
        cmd += " ./" + prog
    p = subprocess.Popen(cmd, shell=True)
    out, err = p.communicate()
    if p.returncode != 0:
        sys.stderr.write("unable to run go install: %s\n" % cmd)
        if out:
            sys.stderr.write("stdout:\n" + out + "\n")
        if err:
            sys.stderr.write("stderr: \n" + err + "\n")
        return False
    print('installed %s with pid %d' % (cmd, p.pid))
    return True

def run(path, race_detection):
    binary = os.path.basename(path)
    cmd = """GORACE="halt_on_error=1" %s --config %s""" % (binary, config)
{'fraction_non_alphanumeric': 0.12385019710906701, 'fraction_numerical': 0.006570302233902759, 'mean_word_length': 2.695388349514563, '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': '4585799', 'n_tokens_mistral': 1000, 'n_tokens_neox': 965, 'n_words': 267}