<commit_before>#!/usr/bin/python

def properDataFormat(value):
		out = ""
		if(type(value) is bool):
			out = "toBoolean("+str(value)+")"
		elif(type(value) is str):
			out = "toString(\""+value+"\")"
		elif(type(value) is int):
			out = "toInteger("+str(value)+")"
		elif(type(value) is float):
			out = "toFloat("+str(value)+")"
		return out

class Filter:

	def build(self):
		return self.name + ": " + properDataFormat(self.value)

	def __init__(self, fname, fvalue):
		self.name = fname
		self.value = fvalue

class Where:

	def printFilter(self):
		print(self.build())

	def build(self):
		out = "{"
		temp = ""
		for x in xrange(0,len(self.filter)):
			out = out + temp + self.filter[x].build()
			temp = ", "
		out = out + "}"
		return out

	def addFilter(self, name, value):
		self.filter.append(Filter(name, value))
		out = Where(self.filter)
		return out

	def __init__(self, init_filter = []):
		self.filter = init_filter

class FilterID:

	 def build(self):
	 	return "ID("+self.context_name+") = "+str(self.eyed)

	 def __init__(self, context_name, eyed):
	 	self.context_name = context_name
	 	self.eyed = eyed

class WhereID:

	def printFilter(self):
		print(self.build())

	def build(self):<commit_msg>Added comment for future people to understand my code<commit_after>#!/usr/bin/python

def properDataFormat(value):
		out = ""
		if(type(value) is bool):
			out = "toBoolean("+str(value)+")"
		elif(type(value) is str):
			out = "toString(\""+value+"\")"
		elif(type(value) is int):
			out = "toInteger("+str(value)+")"
		elif(type(value) is float):
			out = "toFloat("+str(value)+")"
		return out

class Filter:

	def build(self):
		return self.name + ": " + properDataFormat(self.value)

	def __init__(self, fname, fvalue):
		self.name = fname
		self.value = fvalue

class Where:

	def printFilter(self):
		print(self.build())

	def build(self):
		out = "{"
		temp = ""
		for x in xrange(0,len(self.filter)):
			out = out + temp + self.filter[x].build()
			temp = ", "
		out = out + "}"
		return out

	def addFilter(self, name, value):
		self.filter.append(Filter(name, value))
		out = Where(self.filter)
		return out

	def __init__(self, init_filter = []):
		self.filter = init_filter

class FilterID:

	 def build(self):
	 	return "ID("+self.context_name+") = "+str(self.eyed)

	 def __init__(self, context_name, eyed):
	 	self.context_name = context_name
	 	self.eyed = eyed

class WhereID: # When searching for an ID the context name passed in findNode(...) mus be the same as in WhereId(...)

	def printFilter(self):
		print(self.build())

	def build(self):
{'fraction_non_alphanumeric': 0.16698953893839596, 'fraction_numerical': 0.0007748934521503294, 'mean_word_length': 3.890151515151515, 'pattern_counts': {'":': 2, '<': 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': '3735519', 'n_tokens_mistral': 1024, 'n_tokens_neox': 917, 'n_words': 225}