<commit_before>import os
from eve import Eve

app = Eve()

def before_insert_data(documents):
	print "A POST to data was just performed!"
	for d in documents:
		print "Posting " + d["s"] + " data from " + d["p"] + " to the database"
		
def deploy_new_pod(request, payload):
	for d in documents:
		print "DEPLOYING a new POD, " + d["urlid"] + " !"
		# g = app.data.find_one(gateways,{"urlid":"robogateway"})
		print json.dumps(g)
		
def deploy_new_gateway(request, payload):
	for d in documents:
		print "DEPLOYING a new GATEWAY, " + d["urlid"] + " !"

# Heroku defines a $PORT environment variable that we use to determine
# if we're running locally or not.
port = os.environ.get('PORT')
if port:
    host = '0.0.0.0'
    port = int(port)
else:
    host = '0.0.0.0'
    port = 3000

# Start the application
if __name__ == '__main__':
# Adding data to the system:
	app.on_insert_data += before_insert_data
# Administering pods, gateways, and sensors:
	app.on_insert_pods += deploy_new_pod
	app.on_insert_gateways += deploy_new_gateway
# Run the program:
	app.run(host=host, port=port, debug=True)<commit_msg>Updated deploy_new_pod function args<commit_after>import os
from eve import Eve

app = Eve()

def before_insert_data(documents):
	print "A POST to data was just performed!"
	for d in documents:
		print "Posting " + d["s"] + " data from " + d["p"] + " to the database"
		
def deploy_new_pod(documents):
	for d in documents:
		print "DEPLOYING a new POD, " + d["urlid"] + " !"
		
def deploy_new_gateway(documents):
	for d in documents:
		print "DEPLOYING a new GATEWAY, " + d["urlid"] + " !"

# Heroku defines a $PORT environment variable that we use to determine
# if we're running locally or not.
port = os.environ.get('PORT')
if port:
    host = '0.0.0.0'
    port = int(port)
else:
    host = '0.0.0.0'
    port = 3000

# Start the application
if __name__ == '__main__':
# Adding data to the system:
	app.on_insert_data += before_insert_data
# Administering pods, gateways, and sensors:
	app.on_insert_pods += deploy_new_pod
	app.on_insert_gateways += deploy_new_gateway
# Run the program:
	app.run(host=host, port=port, debug=True)
{'fraction_non_alphanumeric': 0.12470808033629145, 'fraction_numerical': 0.011209715086408221, 'mean_word_length': 4.136690647482014, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3764878', 'n_tokens_mistral': 806, 'n_tokens_neox': 761, 'n_words': 234}