<commit_before>import sys
sys.path.append('../build_tools/scripts')
sys.path.append('../build_tools/scripts/vendor')
import os
import base
import libwindows
import dependence
import traceback

if (sys.version_info[0] >= 3):
  unicode = str
  
def install_module(path):
  base.print_info('Install: ' + path)
  base.cmd_in_dir(path, 'npm', ['install'])

def run_module(directory, args=[]):
  base.run_nodejs_in_dir(directory, args)

def find_rabbitmqctl(base_path):
  return base.find_file(os.path.join(base_path, 'RabbitMQ Server'), 'rabbitmqctl.bat')

def restart_win_rabbit():
  base.print_info('restart RabbitMQ node to prevent "Erl.exe high CPU usage every Monday morning on Windows" https://groups.google.com/forum/#!topic/rabbitmq-users/myl74gsYyYg')
  rabbitmqctl = find_rabbitmqctl(os.environ['PROGRAMW6432']) or find_rabbitmqctl(os.environ['ProgramFiles(x86)'])
  if rabbitmqctl is not None:
    base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['stop_app'])
    base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['start_app'])
  else:
    base.print_info('Missing rabbitmqctl.bat')

def start_mac_services():
  base.print_info('Restart MySQL Server')
  base.run_process(['mysql.server', 'restart'])
  base.print_info('Start RabbitMQ Server')
  base.run_process(['rabbitmq-server'])
  base.print_info('Start Redis')
  base.run_process(['redis-server'])

def run_integration_example():
  base.cmd_in_dir('../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])

def check_dependencies():
  checksResult = _dependence.CDependencies()
  
  checksResult.append(dependence.check_nodejs())
  checksResult.append(dependence.check_java())
  checksResult.append(dependence.check_erlang())
  checksResult.append(dependence.check_rabbitmq())
  checksResult.append(dependence.check_gruntcli())
  checksResult.append(dependence.check_buildTools())
  checksResult.append(dependence.check_mysqlInstaller())
  checksResult.append(dependence.check_mysqlServer())
  
  if (len(checksResult.install) > 0):
    install_args = ['../build_tools/scripts/install.py']<commit_msg>[run] Move<commit_after>import sys
sys.path.append('../build_tools/scripts')
sys.path.append('../build_tools/scripts/vendor')
import os
import base
import libwindows
import dependence
import traceback

if (sys.version_info[0] >= 3):
  unicode = str
  
def install_module(path):
  base.print_info('Install: ' + path)
  base.cmd_in_dir(path, 'npm', ['install'])

def run_module(directory, args=[]):
  base.run_nodejs_in_dir(directory, args)

def find_rabbitmqctl(base_path):
  return base.find_file(os.path.join(base_path, 'RabbitMQ Server'), 'rabbitmqctl.bat')

def restart_win_rabbit():
  base.print_info('restart RabbitMQ node to prevent "Erl.exe high CPU usage every Monday morning on Windows" https://groups.google.com/forum/#!topic/rabbitmq-users/myl74gsYyYg')
  rabbitmqctl = find_rabbitmqctl(os.environ['PROGRAMW6432']) or find_rabbitmqctl(os.environ['ProgramFiles(x86)'])
  if rabbitmqctl is not None:
    base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['stop_app'])
    base.cmd_in_dir(base.get_script_dir(rabbitmqctl), 'rabbitmqctl.bat', ['start_app'])
  else:
    base.print_info('Missing rabbitmqctl.bat')

def start_mac_services():
  base.print_info('Restart MySQL Server')
  base.run_process(['mysql.server', 'restart'])
  base.print_info('Start RabbitMQ Server')
  base.run_process(['rabbitmq-server'])
  base.print_info('Start Redis')
  base.run_process(['redis-server'])

def run_integration_example():
  base.cmd_in_dir('../document-server-integration/web/documentserver-example/nodejs', 'python', ['run-develop.py'])

def check_dependencies():
  checksResult = dependence.CDependencies()
  
  checksResult.append(dependence.check_nodejs())
  checksResult.append(dependence.check_java())
  checksResult.append(dependence.check_erlang())
  checksResult.append(dependence.check_rabbitmq())
  checksResult.append(dependence.check_gruntcli())
  checksResult.append(dependence.check_buildTools())
  checksResult.append(dependence.check_mysqlInstaller())
  checksResult.append(dependence.check_mysqlServer())
  
  if (len(checksResult.install) > 0):
    install_args = ['../build_tools/scripts/install.py']
{'fraction_non_alphanumeric': 0.14292386735170481, 'fraction_numerical': 0.005137786081270434, 'mean_word_length': 6.435763888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '863037', 'n_tokens_mistral': 1494, 'n_tokens_neox': 1403, 'n_words': 218}