<commit_before>from flask import Blueprint, request, jsonify
import os

from hadoopstack.services.cluster import make_connection
from hadoopstack.services.cluster import spawn_instances

app_v1 = Blueprint('v1', __name__, url_prefix='/v1')

@app_v1.route('/')
def version():
    return "v1 API. Jobs and clusters API are accessible at /jobs and /clusters respectively"

@app_v1.route('/clusters/', methods = ['GET','POST'])
def clusters():
    if request.method == 'POST':
        data = request.json
        number_of_vms = int(data['cluster']['node-recipes']['tasktracker']) + int(data['cluster']['node-recipes']['jobtracker'])
        output = open("foo.txt", "a")
        output.write(str(data['cluster']))
        conn=make_connection()
        spawn_instances(conn,number_of_vms)
        output.write("number_of_vms"+str(number_of_vms))
            
        return jsonify(**request.json)    
        
    return "To be implemented"

<commit_msg>CleanUp: Removed debugging code from v1.py<commit_after>from flask import Blueprint, request, jsonify

from hadoopstack.services.cluster import make_connection
from hadoopstack.services.cluster import spawn_instances

app_v1 = Blueprint('v1', __name__, url_prefix='/v1')

@app_v1.route('/')
def version():
    return "v1 API. Jobs and clusters API are accessible at /jobs and /clusters respectively"

@app_v1.route('/clusters/', methods = ['GET','POST'])
def clusters():
    if request.method == 'POST':
        data = request.json
        number_of_vms = int(data['cluster']['node-recipes']['tasktracker']) + int(data['cluster']['node-recipes']['jobtracker'])        
        conn=make_connection()
        spawn_instances(conn,number_of_vms)
            
        return jsonify(**request.json)    
        
    return "To be implemented"


{'fraction_non_alphanumeric': 0.13608477412158393, 'fraction_numerical': 0.007250418293363078, 'mean_word_length': 3.771276595744681, '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': '2058757', 'n_tokens_mistral': 550, 'n_tokens_neox': 541, 'n_words': 124}