<commit_before>from flask import Flask
from flask import render_template
from flask import request

app = Flask(__name__)

@app.route('/calculate', methods=['GET'])
def calc():
    length = request.args.get('length', '')
    lunit = request.args.get('lengthunit', '')
    weight = request.args.get('weight', '')
    wunit = request.args.get('weightunit', '')
    fiber = request.args.get('fiber', '')
    plies = request.args.get('plies', '')
    
    pounds = to_pounds(weight,wunit)
    hanks = to_hanks(length, lunit, fiber)

    hanks_per_pound = float(hanks) / float(pounds)
    size = int(float(hanks_per_pound) * int(plies))
    if fiber == "wool":
        size_formatted = str(plies)+"/"+str(size)
    else:
        size_formatted = str(size)+"/"+str(plies)

    return render_template('result.html', size=size_formatted)

def to_pounds(weight, unit):
    if unit == "lb":
        pounds = weight
    elif unit == "oz":
        pounds = float(weight) / 16
    elif unit == "kg":
        pounds = float(weight) * 2.2
    else: # grams
        pounds = float(weight) * 2.2 *.001

    return pounds

def to_hanks(length, unit, fiber):
    yards_per_hank = {
        'cotton': 840,
        'linen': 300,
        'silk': 840,
        'wool': 560
    }

    if unit == "yd":
        yards = length
    elif unit == "m":
        yards = float(length) * 1.093

    hanks = float(yards) / float(yards_per_hank[fiber])
    return hanks

@app.route('/')
def index():
    return render_template('index.html')

if __name__ == '__main__':
    app.run(debug=True)<commit_msg>...but don't include debug mode<commit_after>from flask import Flask
from flask import render_template
from flask import request

app = Flask(__name__)

@app.route('/calculate', methods=['GET'])
def calc():
    length = request.args.get('length', '')
    lunit = request.args.get('lengthunit', '')
    weight = request.args.get('weight', '')
    wunit = request.args.get('weightunit', '')
    fiber = request.args.get('fiber', '')
    plies = request.args.get('plies', '')
    
    pounds = to_pounds(weight,wunit)
    hanks = to_hanks(length, lunit, fiber)

    hanks_per_pound = float(hanks) / float(pounds)
    size = int(float(hanks_per_pound) * int(plies))
    if fiber == "wool":
        size_formatted = str(plies)+"/"+str(size)
    else:
        size_formatted = str(size)+"/"+str(plies)

    return render_template('result.html', size=size_formatted)

def to_pounds(weight, unit):
    if unit == "lb":
        pounds = weight
    elif unit == "oz":
        pounds = float(weight) / 16
    elif unit == "kg":
        pounds = float(weight) * 2.2
    else: # grams
        pounds = float(weight) * 2.2 *.001

    return pounds

def to_hanks(length, unit, fiber):
    yards_per_hank = {
        'cotton': 840,
        'linen': 300,
        'silk': 840,
        'wool': 560
    }

    if unit == "yd":
        yards = length
    elif unit == "m":
        yards = float(length) * 1.093

    hanks = float(yards) / float(yards_per_hank[fiber])
    return hanks

@app.route('/')
def index():
    return render_template('index.html')

if __name__ == '__main__':
    app.run()
{'fraction_non_alphanumeric': 0.15807888040712467, 'fraction_numerical': 0.015903307888040712, 'mean_word_length': 2.8353658536585367, 'pattern_counts': {'":': 12, '<': 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': '2285152', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1079, 'n_words': 241}