<commit_before>import os

def configure(conf):
	# This is interpreted relative to the build path
	if not conf.env.BRICK_LOGFILES:
		conf.env.BRICK_LOGFILES = './logfiles'

	# This is interpreted relative to the build path
	if not conf.env.BRICK_RESULTS:
		conf.env.BRICK_RESULTS = './results'

	if not conf.env.PROJECT_ROOT:
		conf.env.PROJECT_ROOT = '../../'
	if not conf.path.find_dir(conf.env.PROJECT_ROOT):
		conf.path.make_node(conf.env.PROJECT_ROOT).mkdir()
	os.environ['PROJECT_ROOT'] = conf.path.make_node(conf.env.PROJECT_ROOT).abspath()

def build(bld):
	if not bld.bldnode.find_dir(bld.env.BRICK_RESULTS):
		bld.bldnode.make_node(bld.env.BRICK_RESULTS).mkdir()
	os.environ['BRICK_RESULTS'] = bld.bldnode.make_node(bld.env.BRICK_RESULTS).abspath()

	if not bld.bldnode.find_dir(bld.env.BRICK_LOGFILES):
		bld.bldnode.make_node(bld.env.BRICK_LOGFILES).mkdir()
	os.environ['BRICK_LOGFILES'] = bld.bldnode.make_node(bld.env.BRICK_LOGFILES).abspath()
	os.environ['PROJECT_ROOT'] = bld.path.make_node(bld.env.PROJECT_ROOT).abspath()


from waflib.Configure import conf
from waflib.Errors import WafError
@conf
def convert_string_paths(self,list_of_paths):
	SOURCES = []
	if not type(list_of_paths) == type([]):
		self.fatal('You must give a list of strings as parameter to convert_string_paths')

	for src in list_of_paths:
		if not os.path.exists(src):
			if os.path.isabs(src):
				SOURCES.append(self.root.make_node(src))
			else:
				SOURCES.append(self.path.make_node(src))
		if os.path.isabs(src):
			SOURCES.append(self.root.find_node(src))
		else:
			SOURCES.append(self.path.find_node(src))

	return SOURCES<commit_msg>added error handling to brick_general.py<commit_after>import os

def configure(conf):
	# This is interpreted relative to the build path
	if not conf.env.BRICK_LOGFILES:
		conf.env.BRICK_LOGFILES = './logfiles'

	# This is interpreted relative to the build path
	if not conf.env.BRICK_RESULTS:
		conf.env.BRICK_RESULTS = './results'

	if not conf.env.PROJECT_ROOT:
		conf.env.PROJECT_ROOT = '../../'
	if not conf.path.find_dir(conf.env.PROJECT_ROOT):
		conf.path.make_node(conf.env.PROJECT_ROOT).mkdir()
	os.environ['PROJECT_ROOT'] = conf.path.make_node(conf.env.PROJECT_ROOT).abspath()

def build(bld):
	if not bld.bldnode.find_dir(bld.env.BRICK_RESULTS):
		bld.bldnode.make_node(bld.env.BRICK_RESULTS).mkdir()
	os.environ['BRICK_RESULTS'] = bld.bldnode.make_node(bld.env.BRICK_RESULTS).abspath()

	if not bld.bldnode.find_dir(bld.env.BRICK_LOGFILES):
		bld.bldnode.make_node(bld.env.BRICK_LOGFILES).mkdir()
	os.environ['BRICK_LOGFILES'] = bld.bldnode.make_node(bld.env.BRICK_LOGFILES).abspath()
	os.environ['PROJECT_ROOT'] = bld.path.make_node(bld.env.PROJECT_ROOT).abspath()


from waflib.Configure import conf
from waflib.Errors import WafError
@conf
def convert_string_paths(self,list_of_paths):
	SOURCES = []
	if not type(list_of_paths) == type([]):
		self.fatal('You must give a list of strings as parameter to convert_string_paths')

	for src in list_of_paths:
		if not os.path.exists(src):
			if os.path.isabs(src):
				SOURCES.append(self.root.make_node(src))
			else:
				SOURCES.append(self.path.make_node(src))
		if os.path.isabs(src):
			if not self.root.find_node(src):
				self.fatal('Source file not found: '+src)
			SOURCES.append(self.root.find_node(src))
		else:
			if not self.path.find_node(src):
				self.fatal('Source file not found: '+src)
			SOURCES.append(self.path.find_node(src))

	return SOURCES

# vim: noexpandtab
{'fraction_non_alphanumeric': 0.1360368133448375, 'fraction_numerical': 0.0, 'mean_word_length': 4.875, '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': '3280161', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1369, 'n_words': 225}