<commit_before>from flask import Flask, render_template, request, abort, redirect, url_for, jsonify
from main import *

app = Flask(__name__)


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


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


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


@app.route('/api/twoByTwo', methods=["POST", "GET"])
def api_twoByTwo():
	if request.method == "GET":
		return abort(403)

	try:
		a11 = float(request.form["a11"])
		a12 = float(request.form["a12"])
		a21 = float(request.form["a21"])
		a22 = float(request.form["a22"])
		A = [None,[None,a11, a12], [None,a21, a22]]
		matrixA = twoBytwo(copy.deepcopy(A),2)
		returned_determinant = matrixA.determinant()
		returned_square = str(matrixA.multiply(matrixA))
		returned_transpose = str(matrixA.transpose())
		if returned_determinant == 0:
			returned_inverse = "Inverse does not exist."
		else:
			returned_inverse = str(matrixA.inverse())
		return jsonify(returned_determinant, returned_transpose, returned_inverse, returned_square)
	except Exception, e:
		return str(e)


@app.route('/api/threeByThree', methods=["POST", "GET"])
def api_threeByThree():
	if request.method == "GET":
		return abort(403)

	try:
		a11 = float(request.form["a11"])
		a12 = float(request.form["a12"])
		a13 = float(request.form["a13"])<commit_msg>Add blank line for neatness.<commit_after>from flask import Flask, render_template, request, abort, redirect, url_for, jsonify
from main import *

app = Flask(__name__)


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


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


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


@app.route('/api/twoByTwo', methods=["POST", "GET"])
def api_twoByTwo():
	if request.method == "GET":
		return abort(403)

	try:
		a11 = float(request.form["a11"])
		a12 = float(request.form["a12"])
		a21 = float(request.form["a21"])
		a22 = float(request.form["a22"])
		A = [None,[None,a11, a12], [None,a21, a22]]
		matrixA = twoBytwo(copy.deepcopy(A),2)
		returned_determinant = matrixA.determinant()
		returned_square = str(matrixA.multiply(matrixA))
		returned_transpose = str(matrixA.transpose())
		if returned_determinant == 0:
			returned_inverse = "Inverse does not exist."
		else:
			returned_inverse = str(matrixA.inverse())
		return jsonify(returned_determinant, returned_transpose, returned_inverse, returned_square)
		
	except Exception, e:
		return str(e)


@app.route('/api/threeByThree', methods=["POST", "GET"])
def api_threeByThree():
	if request.method == "GET":
		return abort(403)

	try:
		a11 = float(request.form["a11"])
		a12 = float(request.form["a12"])
		a13 = float(request.form["a13"])
{'fraction_non_alphanumeric': 0.1639747191011236, 'fraction_numerical': 0.03089887640449438, 'mean_word_length': 5.549425287356322, 'pattern_counts': {'":': 4, '<': 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': '4236955', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1012, 'n_words': 203}