<commit_before>from flask import Flask, render_template, redirect, request
import math

app = Flask(__name__)
app.debug = False

@app.route('/', methods=['GET','POST'])
def result():
	if request.method == 'GET':
		return render_template('index.html', title='WGTSR?')
	else: #Method is Post

		app.normrooms = [] #area of each room as percent
		app.logscalerooms = [] #log of room areas
		app.lognormrooms = [] #log adjusted area of each room as percent
		app.price = [] #rent for each room based on all of this stuff
		app.rent = request.form["rent"] #total rent
		app.rooms = request.form.values() #post request from the form
		app.rooms.remove(app.rent) #remove the rent from list
		app.rooms.sort() 
		app.rooms.reverse()

		app.rent = float(app.rent)
		app.rooms = [float(i) for i in app.rooms]

		app.nrooms = len(app.rooms) #number of rooms
		app.sumrooms = sum(app.rooms) #total area of rooms

		for x in app.rooms: #normalise room area
			app.normrooms.append(x/app.sumrooms)
		for x in app.normrooms: #log of the normalised room areas
			app.logscalerooms.append(math.log10(x*app.rent))
		for x in app.logscalerooms: #calc log scale factor for rooms
			app.lognormrooms.append(x/sum(app.logscalerooms))
		for x in app.lognormrooms: #do the scaling
			app.price.append(round(x*app.rent,2))

		app.price.sort()
		app.price.reverse()

		return render_template('index2.html', title='WGTSR?',rooms=app.rooms,rent=app.rent,price=app.price)

@app.route('/about')
def about():
	return render_template('about.html', title='About')

if __name__ == '__main__':
    app.run()<commit_msg>app server for prod<commit_after>from flask import Flask, render_template, redirect, request
import math

app = Flask(__name__)
app.debug = False

@app.route('/', methods=['GET','POST'])
def result():
	if request.method == 'GET':
		return render_template('index.html', title='WGTSR?')
	else: #Method is Post

		app.normrooms = [] #area of each room as percent
		app.logscalerooms = [] #log of room areas
		app.lognormrooms = [] #log adjusted area of each room as percent
		app.price = [] #rent for each room based on all of this stuff
		app.rent = request.form["rent"] #total rent
		app.rooms = request.form.values() #post request from the form
		app.rooms.remove(app.rent) #remove the rent from list
		app.rooms.sort() 
		app.rooms.reverse()

		app.rent = float(app.rent)
		app.rooms = [float(i) for i in app.rooms]

		app.nrooms = len(app.rooms) #number of rooms
		app.sumrooms = sum(app.rooms) #total area of rooms

		for x in app.rooms: #normalise room area
			app.normrooms.append(x/app.sumrooms)
		for x in app.normrooms: #log of the normalised room areas
			app.logscalerooms.append(math.log10(x*app.rent))
		for x in app.logscalerooms: #calc log scale factor for rooms
			app.lognormrooms.append(x/sum(app.logscalerooms))
		for x in app.lognormrooms: #do the scaling
			app.price.append(round(x*app.rent,2))

		app.price.sort()
		app.price.reverse()

		return render_template('index2.html', title='WGTSR?',rooms=app.rooms,rent=app.rent,price=app.price)

@app.route('/about')
def about():
	return render_template('about.html', title='About')

if __name__ == '__main__':
    app.run(host='0.0.0.0')
{'fraction_non_alphanumeric': 0.13927227101631118, 'fraction_numerical': 0.0037641154328732747, 'mean_word_length': 4.271074380165289, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1380732', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1091, 'n_words': 302}