<commit_before>from cffi import FFI
import os

INCLUDE = ['/usr/include/nanomsg', '/usr/local/include/nanomsg']

def functions():
	
	for dir in INCLUDE:
		if os.path.exists(dir):
			break
	
	lines = []
	for fn in os.listdir(dir):
		with open(os.path.join(dir, fn)) as f:
			cont = ''
			for ln in f:
				
				if cont is ',':
					lines.append(ln)
					cont = ''
				if cont is '{':
					lines.append(ln)
					if '}' in ln:
						cont = ''
				if cont is '(':
					lines.append(ln)
					if ')' in ln:
						cont = ''
				if not (ln.startswith('NN_EXPORT')
					or ln.startswith('typedef')):
					continue
				
				lines.append(ln)
				cont = ln.strip()[-1]
	
	return ''.join(ln[10:] if ln.startswith('NN_') else ln for ln in lines)

def symbols(headers):<commit_msg>Don't use 'is' for string comparisons<commit_after>from cffi import FFI
import os

INCLUDE = ['/usr/include/nanomsg', '/usr/local/include/nanomsg']

def functions():
	
	for dir in INCLUDE:
		if os.path.exists(dir):
			break
	
	lines = []
	for fn in os.listdir(dir):
		with open(os.path.join(dir, fn)) as f:
			cont = ''
			for ln in f:
				
				if cont == ',':
					lines.append(ln)
					cont = ''
				if cont == '{':
					lines.append(ln)
					if '}' in ln:
						cont = ''
				if cont == '(':
					lines.append(ln)
					if ')' in ln:
						cont = ''
				if not (ln.startswith('NN_EXPORT')
					or ln.startswith('typedef')):
					continue
				
				lines.append(ln)
				cont = ln.strip()[-1]
	
	return ''.join(ln[10:] if ln.startswith('NN_') else ln for ln in lines)

def symbols(headers):
{'fraction_non_alphanumeric': 0.1640926640926641, 'fraction_numerical': 0.003861003861003861, 'mean_word_length': 2.4100877192982457, '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': '854220', 'n_tokens_mistral': 767, 'n_tokens_neox': 570, 'n_words': 151}