<commit_before>
import subprocess
import sys
import setup_util
from os.path import expanduser

home = expanduser("~")

##############
# start(args)
##############
def start(args):
  setup_util.replace_text("treefrog/config/database.ini", "HostName=.*", "HostName=" + args.database_host)

  # 1. Generate Makefile
  # 2. Compile applicaton
  # 3. Clean log files
  # 4. Start TreeFrog
  try:
    subprocess.check_call("qmake -r CONFIG+=release", shell=True, cwd="treefrog")
    subprocess.check_call("make", shell=True, cwd="treefrog")
    subprocess.check_call("rm -f ./*.log", shell=True, cwd="treefrog/log")
    subprocess.check_call("treefrog -d " + home + "/FrameworkBenchmarks/treefrog", shell=True)
    return 0
  except subprocess.CalledProcessError:
    return 1

##############
# stop()
##############
def stop():
  try:
    subprocess.call("treefrog -k abort " + home + "/FrameworkBenchmarks/treefrog", shell=True)
    return 0
  except subprocess.CalledProcessError:
    return 1
<commit_msg>remove log files before benchmarking.<commit_after>
import subprocess
import sys
import setup_util
from os.path import expanduser

home = expanduser("~")

##############
# start(args)
##############
def start(args):
  setup_util.replace_text("treefrog/config/database.ini", "HostName=.*", "HostName=" + args.database_host)

  # 1. Generate Makefile
  # 2. Compile applicaton
  # 3. Clean log files
  # 4. Start TreeFrog
  try:
    subprocess.check_call("qmake -r CONFIG+=release", shell=True, cwd="treefrog")
    subprocess.check_call("make", shell=True, cwd="treefrog")
    subprocess.check_call("rm -f log/*.log", shell=True, cwd="treefrog")
    subprocess.check_call("treefrog -d " + home + "/FrameworkBenchmarks/treefrog", shell=True)
    return 0
  except subprocess.CalledProcessError:
    return 1

##############
# stop()
##############
def stop():
  try:
    subprocess.call("treefrog -k abort " + home + "/FrameworkBenchmarks/treefrog", shell=True)
    return 0
  except subprocess.CalledProcessError:
    return 1

{'fraction_non_alphanumeric': 0.17899408284023668, 'fraction_numerical': 0.007889546351084813, 'mean_word_length': 4.574175824175824, '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': '5036070', 'n_tokens_mistral': 691, 'n_tokens_neox': 667, 'n_words': 152}