<commit_before>import requests

def checkBlockContainer(configuration,name):
	if name not in configuration:
		print 'No url in config info for ' + name
		return False
	
	url = configuration[name]
	
	bounced = False
	try:
		response = requests.get(url + '/')
		if response.status_code != 200:
			bounced = True
	except:
		bounced = True
	
	if bounced:	
		print 'Could not contact ' + name + ' at ' + url
		return False
	return True

def loadblocks(configuration):
	BLOCKS = {}
	
	if checkBlockContainer(configuration,'PYTHON2_URL'):
		import qpython2
		qpython2.PYTHON2_URL = configuration['PYTHON2_URL']
		BLOCKS['python2'] = qpython2.process_python2_code
		print 'PYTHON2 enabled'
	
	if checkBlockContainer(configuration,'SAGE_URL'):
		import qsage
		qsage.SAGE_URL = configuration['SAGE_URL']
		BLOCKS['sage'] = qsage.process_sage_code
		print 'SAGE enabled'
	
	return BLOCKS<commit_msg>fixed empty config block options<commit_after>import requests

def checkBlockContainer(configuration,name):
	if name not in configuration:
		print 'No url in config info for ' + name
		return False

	url = configuration[name]
	if type(url) is not str:
		print 'No url in config info for ' + name
		return False
	
	bounced = False
	try:
		response = requests.get(url + '/')
		if response.status_code != 200:
			bounced = True
	except:
		bounced = True
	
	if bounced:	
		print 'Could not contact ' + name + ' at ' + url
		return False
	return True

def loadblocks(configuration):
	BLOCKS = {}
	
	if checkBlockContainer(configuration,'PYTHON2_URL'):
		import qpython2
		qpython2.PYTHON2_URL = configuration['PYTHON2_URL']
		BLOCKS['python2'] = qpython2.process_python2_code
		print 'PYTHON2 enabled'
	
	if checkBlockContainer(configuration,'SAGE_URL'):
		import qsage
		qsage.SAGE_URL = configuration['SAGE_URL']
		BLOCKS['sage'] = qsage.process_sage_code
		print 'SAGE enabled'
	
	return BLOCKS
{'fraction_non_alphanumeric': 0.0935672514619883, 'fraction_numerical': 0.012759170653907496, 'mean_word_length': 4.408045977011494, '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': '2040940', 'n_tokens_mistral': 680, 'n_tokens_neox': 610, 'n_words': 166}