<commit_before>def begin(state):
	"This function sets null values for almost every variable, and sets all of the Address/State values to the state to begin with."
	street = ""
	po_street = ""
	city = ""
	address_state = state
	zip_code = ""
	po_city = ""
	po_state = state
	po_zip_code = ""
	fips = ""
	first_name = ""
	last_name = ""
	authority_name = ""
	phone = ""
	fax = ""
	email = ""
	website = ""
	hours = ""
	reg_street = ""
	reg_city = ""
	reg_state = state
	reg_zip_code = ""
	reg_po_street = ""
	reg_po_city = ""
	reg_po_state = state
	reg_po_zip_code = ""
	reg_authority_name = ""
	reg_first = ""
	reg_last = ""
	reg_phone = ""
	reg_fax = ""
	reg_email = ""
	reg_website = ""
	reg_hours = ""
	town_name = ""
	review = ""
	county_name = ""

	return authority_name, first_name, last_name, county_name, town_name, fips, street, city, address_state, zip_code, po_street, po_city, po_state, po_zip_code, reg_authority_name, reg_first, reg_last, reg_street, reg_city, reg_state, reg_zip_code, reg_po_street, reg_po_city, reg_po_state, reg_po_zip_code, reg_phone, reg_fax, reg_email, reg_website, reg_hours, phone, fax, email, website, hours, review


def find_fips(county_name, voter_state):
	"takes a county name and identifies its associated FIPS value"

	import os
	import re

	cdir = os.path.dirname(os.path.abspath(__file__)) + "/"

	fips_path = cdir + "fips.txt"

	fips_text = open(fips_path).read().lower()

	if "St " in county_name:
		county_name = county_name.replace("St ","St. ")

	fips_re_string = county_name.lower() + "\t" + voter_state.lower() + "\t" + "(\d+)"

	fips_re = re.compile(fips_re_string)

	fips_search = fips_re.findall(fips_text)
	if len(fips_search) == 0:
		return None
	else:
		return fips_search[0].title()

def insert(original, new, pos):
	"Inserts a string into a larger string."
	return original[:pos] + new + original[pos:]


def find_phone(phone_re, county, areacode = ""):
	"Identifies everything that looks like a phone #, and then puts them into a list."

	import re

	phone = ""<commit_msg>[TH] tweak fips regex to better match whole entries<commit_after>def begin(state):
	"This function sets null values for almost every variable, and sets all of the Address/State values to the state to begin with."
	street = ""
	po_street = ""
	city = ""
	address_state = state
	zip_code = ""
	po_city = ""
	po_state = state
	po_zip_code = ""
	fips = ""
	first_name = ""
	last_name = ""
	authority_name = ""
	phone = ""
	fax = ""
	email = ""
	website = ""
	hours = ""
	reg_street = ""
	reg_city = ""
	reg_state = state
	reg_zip_code = ""
	reg_po_street = ""
	reg_po_city = ""
	reg_po_state = state
	reg_po_zip_code = ""
	reg_authority_name = ""
	reg_first = ""
	reg_last = ""
	reg_phone = ""
	reg_fax = ""
	reg_email = ""
	reg_website = ""
	reg_hours = ""
	town_name = ""
	review = ""
	county_name = ""

	return authority_name, first_name, last_name, county_name, town_name, fips, street, city, address_state, zip_code, po_street, po_city, po_state, po_zip_code, reg_authority_name, reg_first, reg_last, reg_street, reg_city, reg_state, reg_zip_code, reg_po_street, reg_po_city, reg_po_state, reg_po_zip_code, reg_phone, reg_fax, reg_email, reg_website, reg_hours, phone, fax, email, website, hours, review


def find_fips(county_name, voter_state):
	"takes a county name and identifies its associated FIPS value"

	import os
	import re

	cdir = os.path.dirname(os.path.abspath(__file__)) + "/"

	fips_path = cdir + "fips.txt"

	fips_text = open(fips_path).read().lower()

	if "St " in county_name:
		county_name = county_name.replace("St ","St. ")

	fips_re_string = "^" + county_name.lower() + "\t" + voter_state.lower() + "\t" + "(\d+)"

	fips_re = re.compile(fips_re_string, re.MULTILINE)

	fips_search = fips_re.findall(fips_text)
	if len(fips_search) == 0:
		return None
	else:
		return fips_search[0].title()

def insert(original, new, pos):
	"Inserts a string into a larger string."
	return original[:pos] + new + original[pos:]


def find_phone(phone_re, county, areacode = ""):
	"Identifies everything that looks like a phone #, and then puts them into a list."

	import re

	phone = ""
{'fraction_non_alphanumeric': 0.13075060532687652, 'fraction_numerical': 0.0009685230024213075, 'mean_word_length': 4.4, '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': '709187', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1547, 'n_words': 381}