<commit_before>from flask import Flask, render_template, request
app = Flask(__name__)

@app.route('/')
def hello():
	#return 'helloworld'
	if request.method == 'GET':
		return render_template('index.html')

@app.route('/user/<username>')
@app.route('/user/<username>/<int:post_id>', methods=['POST'])
def user(username, post_id=None):
	q = request.args.get('q', '')
	if post_id is not None:
		# request.form
		return '{}: {} with q={}'.format(username, post_id, q)
	return render_template('user/index.html', username=username, q=q)


if __name__ == '__main__':
	app.run(debug=True)<commit_msg>Better example of query params.<commit_after>from flask import Flask, render_template, request
app = Flask(__name__)

@app.route('/')
def hello():
	#return 'helloworld'
	if request.method == 'GET':
		return render_template('index.html')

@app.route('/user/<username>')
@app.route('/user/<username>/<int:post_id>', methods=['GET'])
def user(username, post_id=None):
	q = request.args.get('q', '') # /user/g?fields=name
	if post_id is not None:
		# request.form
		return '{}: {} with q={}'.format(
			username, post_id, q
		)
	return render_template(
		'user/index.html',
		username=username,
		q=q
	)


if __name__ == '__main__':
	app.run(debug=True)
{'fraction_non_alphanumeric': 0.18825422365245373, 'fraction_numerical': 0.0, 'mean_word_length': 5.282828282828283, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6672707', 'n_tokens_mistral': 468, 'n_tokens_neox': 449, 'n_words': 96}