<commit_before>
import subprocess
import sys
import setup_util
import os

def start(args):
  setup_util.replace_text("ringojs/ringo-main.js", "dbHost = '.*';", "dbHost = '" + args.database_host + "';")

  try:
    subprocess.check_call("ringo --production ringo-main.js", shell=True, cwd="ringojs")
    return 0
  except subprocess.CalledProcessError:
    return 1
def stop():
  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
  out, err = p.communicate()
  for line in out.splitlines():
    if 'ringo-main.js' in line:
      pid = int(line.split(None, 2)[1])
      try:
        os.kill(pid, 9)
      except OSError:
        pass
  return 0
<commit_msg>yeah we need pipe, check_call waits<commit_after>
import subprocess
import sys
import setup_util
import os

def start(args):
  setup_util.replace_text("ringojs/ringo-main.js", "dbHost = '.*';", "dbHost = '" + args.database_host + "';")

  try:
    subprocess.Popen("ringo --production ringo-main.js", shell=True, cwd="ringojs")
    return 0
  except subprocess.CalledProcessError:
    return 1
def stop():
  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
  out, err = p.communicate()
  for line in out.splitlines():
    if 'ringo-main.js' in line:
      pid = int(line.split(None, 2)[1])
      try:
        os.kill(pid, 9)
      except OSError:
        pass
  return 0

{'fraction_non_alphanumeric': 0.147735708982925, 'fraction_numerical': 0.008908685968819599, 'mean_word_length': 3.3766233766233764, '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': '7414012', 'n_tokens_mistral': 494, 'n_tokens_neox': 480, 'n_words': 115}