<commit_before>import subprocess
import sys
import setup_util
import os

def start(args):
  setup_util.replace_text("snap/bench/cfg/db.cfg", "host=\".*\"", "host=\"" + args.database_host + "\"")
  subprocess.check_call("cabal update", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal install --only-dependencies", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal build", shell=True, cwd="snap/bench")

  subprocess.Popen("dist/build/snap-bench/snap-bench +RTS -A4M -N -qg2 -I0 -G2 > /dev/null", shell=True, cwd="snap/bench")
  return 0

def stop():
  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
  out, err = p.communicate()
  for line in out.splitlines():
    if 'snap-bench' in line:
      try:
        pid = int(line.split(None, 2)[1])
        os.kill(pid, 9)
      except OSError:
        pass

  return 0
<commit_msg>Missing cabal configure command for snap<commit_after>import subprocess
import sys
import setup_util
import os

def start(args):
  setup_util.replace_text("snap/bench/cfg/db.cfg", "host=\".*\"", "host=\"" + args.database_host + "\"")
  subprocess.check_call("cabal update", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal install --only-dependencies", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal configure", shell=True, cwd="snap/bench")
  subprocess.check_call("cabal build", shell=True, cwd="snap/bench")

  subprocess.Popen("dist/build/snap-bench/snap-bench +RTS -A4M -N -qg2 -I0 -G2 > /dev/null", shell=True, cwd="snap/bench")
  return 0

def stop():
  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
  out, err = p.communicate()
  for line in out.splitlines():
    if 'snap-bench' in line:
      try:
        pid = int(line.split(None, 2)[1])
        os.kill(pid, 9)
      except OSError:
        pass

  return 0

{'fraction_non_alphanumeric': 0.1690450054884742, 'fraction_numerical': 0.009879253567508232, 'mean_word_length': 3.900537634408602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4959091', 'n_tokens_mistral': 676, 'n_tokens_neox': 659, 'n_words': 143}