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

# Usage: ./launch_nightly_test.py
#            --test-host <hostname>[:<port>]
#            (--email <name>@<address>)*
#            [--title "<Title>"]
#            [-- <flags for full_test_driver.py>]

import sys, subprocess32, os, optparse

if __name__ != "__main__":
    raise ImportError("It doesn't make any sense to import this as a module")

parser = optparse.OptionParser()
parser.add_option("--test-host", action = "store", dest = "test_host")
parser.add_option("--email", action = "append", dest = "emailees")
parser.add_option("--title", action = "store", dest = "title")
parser.set_defaults(title = "Nightly test", emailees = [])
(options, args) = parser.parse_args()
if options.test_host is None:
    parser.error("You must specify --test-host.")

def escape(arg):
    return "'" + arg.replace("'", "'\''") + "'"

tar_proc = subprocess32.Popen(
    ["tar", "--create", "--gzip", "--file=-", "-C", os.path.dirname(__file__), "--"] +
        ["full_test_driver.py", "remotely.py", "simple_linear_db.py", "renderer"],
    stdout = subprocess32.PIPE
    )
try:
    command = "SLURM_CONF=/home/teapot/slurm/slurm.conf ./full_test_driver.py %s >output.txt 2>&1" % " ".join(escape(x) for x in args)
    curl_cmd_line = ["curl", "-f", "-X", "POST", "http://%s/spawn/" % options.test_host]
    curl_cmd_line += ["-F", "tarball=@-"]
    curl_cmd_line += ["-F", "command=%s" % command]
    curl_cmd_line += ["-F", "title=%s" % options.title]
    for emailee in options.emailees:
        curl_cmd_line += ["-F", "emailee=%s" % emailee]
    subprocess32.check_call(curl_cmd_line, stdin = tar_proc.stdout)
finally:
    try:
        tar_proc.terminate()
    except IOError:
        pass<commit_msg>Don't use subprocess32 in launch_nightly_test.py.<commit_after>#!/usr/bin/env python

# Usage: ./launch_nightly_test.py
#            --test-host <hostname>[:<port>]
#            (--email <name>@<address>)*
#            [--title "<Title>"]
#            [-- <flags for full_test_driver.py>]

import sys, subprocess, os, optparse

if __name__ != "__main__":
    raise ImportError("It doesn't make any sense to import this as a module")

parser = optparse.OptionParser()
parser.add_option("--test-host", action = "store", dest = "test_host")
parser.add_option("--email", action = "append", dest = "emailees")
parser.add_option("--title", action = "store", dest = "title")
parser.set_defaults(title = "Nightly test", emailees = [])
(options, args) = parser.parse_args()
if options.test_host is None:
    parser.error("You must specify --test-host.")

def escape(arg):
    return "'" + arg.replace("'", "'\''") + "'"

tar_proc = subprocess.Popen(
    ["tar", "--create", "--gzip", "--file=-", "-C", os.path.dirname(__file__), "--"] +
        ["full_test_driver.py", "remotely.py", "simple_linear_db.py", "renderer"],
    stdout = subprocess.PIPE
    )
try:
    command = "SLURM_CONF=/home/teapot/slurm/slurm.conf ./full_test_driver.py %s >output.txt 2>&1" % " ".join(escape(x) for x in args)
    curl_cmd_line = ["curl", "-f", "-X", "POST", "http://%s/spawn/" % options.test_host]
    curl_cmd_line += ["-F", "tarball=@-"]
    curl_cmd_line += ["-F", "command=%s" % command]
    curl_cmd_line += ["-F", "title=%s" % options.title]
    for emailee in options.emailees:
        curl_cmd_line += ["-F", "emailee=%s" % emailee]
    subprocess.check_call(curl_cmd_line, stdin = tar_proc.stdout)
finally:
    try:
        tar_proc.terminate()
    except IOError:
        pass
{'fraction_non_alphanumeric': 0.19868496283590623, 'fraction_numerical': 0.004002287021154946, 'mean_word_length': 3.412358133669609, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 19, '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': '4881845', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1254, 'n_words': 263}