<commit_before>import sys
import os
import argparse
from dataactcore.scripts.configure import ConfigureCore
from dataactcore.scripts.setupJobTrackerDB import setupJobTrackerDB
from dataactcore.scripts.setupErrorDB import setupErrorDB
from dataactcore.scripts.setupUserDB import setupUserDB
from dataactvalidator.scripts.setupValidationDB import setupValidationDB
from dataactvalidator.scripts.setupStagingDB import setupStaging
from dataactvalidator.scripts.configure import ConfigureValidator

def baseScript():
	if ( os.getuid() != 0) :
		print ("Please run this script with sudo")

	parser = argparse.ArgumentParser()
	parser.add_argument("-i", "--initialize", action="store_true",help="Runs all of the setup options")
	parser.add_argument("-c", "--configValidator", action="store_true",help="Configures validator settings" )
	parser.add_argument("-l", "--loadValidator", action="store_true",help="Loads validator Schema files and rules" )
	parser.add_argument("-cdb", "--configDB", action="store_true",help="Configures database connection" )
	parser.add_argument("-aws","--configAWS", action="store_true",help="Configures AWS settings" )
	parser.add_argument("-db", "--setupDB", action="store_true",help="Creates the database schema" )
	parser.add_argument("-s", "--start", action="store_true",help="Starts the validator" )
	args = parser.parse_args()
	optionsDict = vars(args)

	noArgs = True
	for arg in optionsDict:
		if(optionsDict[arg]):
			noArgs = False
			globals()[arg]()

	if(noArgs):
		print ("Please enter an argument.")


def initialize():
	# print "in initialize"
	configAWS()
	configDB()
	configValidator()
	setupDB()
	loadValidator()
	print ("The validator has been initialized. You may now run the validator with the -start argument.")

def configValidator():
	ConfigureValidator.promptWebservice()

def loadValidator():
	ConfigureValidator.promptForAppropriations()
	ConfigureValidator.promptForTAS()

def configAWS():
	ConfigureCore.promptS3()

def configDB():
	ConfigureCore.promptDatabase()

def setupDB():
	setupJobTrackerDB(hardReset=True)
	setupValidationDB(True)
	setupErrorDB(True)
	setupUserDB(True)
	setupStaging()

def start():
	from dataactvalidator.app import runApp
	runApp()

if __name__ == '__main__':
	baseScript()<commit_msg>Linking logging to the install of validator.<commit_after>import sys
import os
import argparse
from dataactcore.scripts.configure import ConfigureCore
from dataactcore.scripts.setupJobTrackerDB import setupJobTrackerDB
from dataactcore.scripts.setupErrorDB import setupErrorDB
from dataactcore.scripts.setupUserDB import setupUserDB
from dataactvalidator.scripts.setupValidationDB import setupValidationDB
from dataactvalidator.scripts.setupStagingDB import setupStaging
from dataactvalidator.scripts.configure import ConfigureValidator

def baseScript():
	if ( os.getuid() != 0) :
		print ("Please run this script with sudo")

	parser = argparse.ArgumentParser()
	parser.add_argument("-i", "--initialize", action="store_true",help="Runs all of the setup options")
	parser.add_argument("-c", "--configValidator", action="store_true",help="Configures validator settings" )
	parser.add_argument("-l", "--loadValidator", action="store_true",help="Loads validator Schema files and rules" )
	parser.add_argument("-cdb", "--configDB", action="store_true",help="Configures database connection" )
	parser.add_argument("-aws","--configAWS", action="store_true",help="Configures AWS settings" )
	parser.add_argument("-db", "--setupDB", action="store_true",help="Creates the database schema" )
	parser.add_argument("-s", "--start", action="store_true",help="Starts the validator" )
	args = parser.parse_args()
	optionsDict = vars(args)

	noArgs = True
	for arg in optionsDict:
		if(optionsDict[arg]):
			noArgs = False
			globals()[arg]()

	if(noArgs):
		print ("Please enter an argument.")


def initialize():
	# print "in initialize"
	configAWS()
	configDB()
	configValidator()
	setupDB()
	loadValidator()
	print ("The validator has been initialized. You may now run the validator with the -start argument.")

def configValidator():
	ConfigureValidator.promptWebservice()

def loadValidator():
	ConfigureValidator.promptForAppropriations()
	ConfigureValidator.promptForTAS()

def configAWS():
	ConfigureCore.promptS3()
	ConfigureCore.promptLogging()

def configDB():
	ConfigureCore.promptDatabase()

def setupDB():
	setupJobTrackerDB(hardReset=True)
	setupValidationDB(True)
	setupErrorDB(True)
	setupUserDB(True)
	setupStaging()

def start():
	from dataactvalidator.app import runApp
	runApp()

if __name__ == '__main__':
	baseScript()
{'fraction_non_alphanumeric': 0.12064459930313588, 'fraction_numerical': 0.0008710801393728223, 'mean_word_length': 6.642262895174709, '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': '1352079', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1368, 'n_words': 338}