<commit_before>import os
import sys

# GitHub
GITHUB_CREDENTIALS_FILE_PATH = os.path.join(os.path.expanduser("~"), '.pullRequestMinerrc') 

# Paths
PULL_REQUESTS_PATH = os.path.abspath(os.path.join(os.getcwd(), './pulls'))
PULL_CACHE_INFO_FILENAME = '.pull-cache-info'
JCC_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../../ccjava/ccjava-plugin/build/eclipse/eclipse'))
JCC_ARGS = '-consoleLog -nosplash --launcher.suppressErrors -vmargs -Xms40m -Xmx1024m'
JCC_LOG_STDOUT = 'jcc-stdout.log'
JCC_LOG_STDERR = 'jcc-stderr.log'
PARTITION_RESULTS_FOLDER_NAME = 'ccjava-results'
PARTITION_RESULTS_FILENAME = 'partitions.csv'

# Misc
SERVER_PORT = 8080
MAX_DOWNLOAD_RETRIES = 3


def readOptionsFromFile(filePath):
	optVars = {}
	with open(filePath) as fin:
		for l in fin.readlines():
			l = l.strip()
			if l.startswith('#'):
				continue
			splitL = l.split('=', 1)
			if len(splitL) != 2:
				continue
			name, val = [s.strip(' "\'') for s in splitL]
			optVars[name] = val
	return optVars

def loadOptionsFromDisk():
	OPTIONS_LOCAL_PATH = 'options.local'
	if os.path.exists(OPTIONS_LOCAL_PATH):
		optVars = readOptionsFromFile(OPTIONS_LOCAL_PATH)
		module = sys.modules[__name__]
		for optName, optVal in optVars.iteritems():
			setattr(module, optName, optVal)

loadOptionsFromDisk()<commit_msg>Fix reading of options.local when dealing with numbers<commit_after>import os
import sys

# GitHub
GITHUB_CREDENTIALS_FILE_PATH = os.path.join(os.path.expanduser("~"), '.pullRequestMinerrc') 

# Paths
PULL_REQUESTS_PATH = os.path.abspath(os.path.join(os.getcwd(), './pulls'))
PULL_CACHE_INFO_FILENAME = '.pull-cache-info'
JCC_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../../ccjava/ccjava-plugin/build/eclipse/eclipse'))
JCC_ARGS = '-consoleLog -nosplash --launcher.suppressErrors -vmargs -Xms40m -Xmx1024m'
JCC_LOG_STDOUT = 'jcc-stdout.log'
JCC_LOG_STDERR = 'jcc-stderr.log'
PARTITION_RESULTS_FOLDER_NAME = 'ccjava-results'
PARTITION_RESULTS_FILENAME = 'partitions.csv'

# Misc
SERVER_PORT = 8080
MAX_DOWNLOAD_RETRIES = 3


def readOptionsFromFile(filePath):
	optVars = {}
	with open(filePath) as fin:
		for l in fin.readlines():
			l = l.strip()
			if l.startswith('#'):
				continue
			splitL = l.split('=', 1)
			if len(splitL) != 2:
				continue
			name, val = [s.strip(' "\'') for s in splitL]
			try: 
				val = int(val) #if it is an integer, convert to int
			except ValueError:
				pass 
			optVars[name] = val
	return optVars

def loadOptionsFromDisk():
	OPTIONS_LOCAL_PATH = 'options.local'
	if os.path.exists(OPTIONS_LOCAL_PATH):
		optVars = readOptionsFromFile(OPTIONS_LOCAL_PATH)
		module = sys.modules[__name__]
		for optName, optVal in optVars.iteritems():
			setattr(module, optName, optVal)

loadOptionsFromDisk()
{'fraction_non_alphanumeric': 0.1392128279883382, 'fraction_numerical': 0.009475218658892129, 'mean_word_length': 4.648148148148148, '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': '4587236', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1048, 'n_words': 200}