<commit_before># Fixer.py
# Take a C++ file run astyle and remove any badness done by astyle
import sys
import string
import os
import glob
import stat

tempname = "FixStyle.tmp"
recurse = 1

def fixCode(code):
	#code = string.replace(code, "if(", "if (")
	return code
	
def fixLine(line, inComment):
	line = string.rstrip(line)
	if inComment:
		if string.find(line, "*/") != -1:
			inComment = 0
	else:
		if string.find(line, "#include") == 0:
			line = string.replace(line, " / ", "/")
			line = string.replace(line, "< ", "<")
			line = string.replace(line, " >", ">")
		elif string.find(line, "/*") != -1:
			inComment = 1
		elif string.find(line, "//") != -1:
			pos = string.find(line, "//")
			code = line[:pos]
			comment = line[pos:]
			line = fixCode(code) + comment
		else:
			line = fixCode(line)
	return line, inComment
	
def fixFile(filename):
	os.system("astyle -tapO %s" % filename)
	out = open(tempname, "wt")
	cfile = open(filename, "rt")
	lastLine = 1
	#~ print "processing", filename
	inComment = 0
	for line in cfile.readlines():
		line, inComment = fixLine(line, inComment)
		if line or lastLine:
			out.write(line)
			out.write("\n")
		lastLine = line
	out.close()
	cfile.close()
	os.unlink(filename)
	os.rename(tempname, filename)<commit_msg>Removing space from "return ;"<commit_after># Fixer.py
# Take a C++ file run astyle and remove any badness done by astyle
import sys
import string
import os
import glob
import stat

tempname = "FixStyle.tmp"
recurse = 1

def fixCode(code):
	#code = string.replace(code, "if(", "if (")
	code = string.replace(code, "return ;", "return;")
	return code

def fixLine(line, inComment):
	line = string.rstrip(line)
	if inComment:
		if string.find(line, "*/") != -1:
			inComment = 0
	else:
		if string.find(line, "#include") == 0:
			line = string.replace(line, " / ", "/")
			line = string.replace(line, "< ", "<")
			line = string.replace(line, " >", ">")
		elif string.find(line, "/*") != -1:
			inComment = 1
		elif string.find(line, "//") != -1:
			pos = string.find(line, "//")
			code = line[:pos]
			comment = line[pos:]
			line = fixCode(code) + comment
		else:
			line = fixCode(line)
	return line, inComment

def fixFile(filename):
	os.system("astyle -tapO %s" % filename)
	out = open(tempname, "wt")
	cfile = open(filename, "rt")
	lastLine = 1
	#~ print "processing", filename
	inComment = 0
	for line in cfile.readlines():
		line, inComment = fixLine(line, inComment)
		if line or lastLine:
			out.write(line)
			out.write("\n")
		lastLine = line
	out.close()
	cfile.close()
	os.unlink(filename)
	os.rename(tempname, filename)
{'fraction_non_alphanumeric': 0.16891111966140823, 'fraction_numerical': 0.006925740669488265, 'mean_word_length': 3.66786355475763, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1306288', 'n_tokens_mistral': 1036, 'n_tokens_neox': 956, 'n_words': 253}