<commit_before>#ue.exec('pip2.py')

import subprocess
import sys
import unreal_engine as ue
import _thread as thread

ue.log(sys.path)

#define some convenience paths
def PythonHomePath():
	for path in sys.path:
		if ('UnrealEnginePython' in path and
			path.endswith('Binaries/Win64')):
			return path
	
	#return sys.path[1]
	return "not found"

def PythonHomeScriptsPath():
	home = PythonHomePath()
	return home + "/Scripts"

_PythonHomePath = PythonHomePath()

def FolderCommand(folder):
	#replace backslashes
	folder = folder.replace('/','\\')

	changefolder = "cd /d \"" + folder + "\" & "
	return changefolder


#main public function
def run(process, folder=_PythonHomePath):
	#todo: change folder
	fullcommand = FolderCommand(folder) + process
	ue.log("Started cmd <" + fullcommand + ">")
	stdoutdata = subprocess.getstatusoutput(fullcommand)
	ue.log("cmd Result: ")
	ue.log(stdoutdata[1])
	return stdoutdata[1] #return the data for dependent functions


def Test():
	#debug test - 
	run('dir')	<commit_msg>add cmd convenience wrappers<commit_after>#ue.exec('pip2.py')

import subprocess
import sys
import unreal_engine as ue
import _thread as thread

#ue.log(sys.path)

#define some convenience paths
def PythonHomePath():
	for path in sys.path:
		if ('UnrealEnginePython' in path and
			path.endswith('Binaries/Win64')):
			return path
	
	#return sys.path[1]
	return "not found"

def PythonHomeScriptsPath():
	home = PythonHomePath()
	return home + "/Scripts"

_PythonHomePath = PythonHomePath()

def FolderCommand(folder):
	#replace backslashes
	folder = folder.replace('/','\\')

	changefolder = "cd /d \"" + folder + "\" & "
	return changefolder

#main public function
def run(process, path=_PythonHomePath):
	#todo: change folder
	fullcommand = FolderCommand(path) + process
	ue.log("Started cmd <" + fullcommand + ">")
	stdoutdata = subprocess.getstatusoutput(fullcommand)
	ue.log("cmd Result: ")
	ue.log(stdoutdata[1])
	return stdoutdata[1] #return the data for dependent functions

#convenience wrappers
def dir(path=_PythonHomePath):
	run('dir', path)

def ls(path=_PythonHomePath):
	dir(path)

def md(folder, path=_PythonHomePath):
	run('md ' + folder, path)

def mkdir(folder, path=_PythonHomePath):
	md(folder, path)
{'fraction_non_alphanumeric': 0.1274597495527728, 'fraction_numerical': 0.005366726296958855, 'mean_word_length': 5.145604395604396, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5905504', 'n_tokens_mistral': 779, 'n_tokens_neox': 746, 'n_words': 200}