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

@app.route('/')
def home():
    if 'q' in request.args:
        return redirect(query(request.args.get('q')), code=302)
    else:
        return "Under Construction"

def query(str):
	if str.split(' ', 1)[0] == "ocvs":
		return "https://github.com/Itseez/opencv/search?q=\"" + \
		str.split(' ', 1)[1] + "\""
	else:
		return "http://www.google.com/search?q="+str

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)<commit_msg>adding translate, paste, and google search<commit_after>from flask import request, Flask, redirect
import os
app = Flask(__name__)

@app.route('/')
def home():
    if 'q' in request.args:
        return redirect(query(request.args.get('q')), code=302)
    else:
        return "Under Construction"

def query(str):
	try:
		command = str.split(' ', 1)[0]
	except Exception, e:
		command = ""

	try:
		queryText = str.split(' ', 1)[1]
	except Exception, e:
		queryText = ""

	if command == "ocvs":
		return "https://github.com/Itseez/opencv/search?q=\"" + \
			queryText + "\""
	elif command == 's' or command == 'g':
		return "http://www.google.com/search?q="+queryText
	elif command == 't':
		return "https://translate.google.com/#en/ar/"+queryText
	elif command == 'p':
		return "https://pastie.org"
	else:
		return "http://www.google.com/search?q="+str

if __name__ == '__main__':
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)
{'fraction_non_alphanumeric': 0.19572261827608556, 'fraction_numerical': 0.019442644199611146, 'mean_word_length': 3.608955223880597, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 2, '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': '25720', 'n_tokens_mistral': 594, 'n_tokens_neox': 562, 'n_words': 126}