<commit_before>import os
import requests as re
from flask import Flask, jsonify, request, redirect, url_for,session
from flask_cors import CORS
import json

from werkzeug import secure_filename

UPLOAD_FOLDER = 'tmp'
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg'])

app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
CORS(app)
app.secret_key = 'development'

# xe.com
xe_account_id = '<KEY>'
xe_api_key = '<KEY>'


def allowed_file(filename):
    return '.' in filename and \
        filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS


@app.route("/")
def helloWorld():
    return "Hello, world! <a href='https://github.com/rhnvrm/'>Fork me on GitHub!</a>"


@app.route('/translate', methods=['GET'])
def translate(text):
    if request.method == 'GET':
        input_text  = text
        print(text)
        pass


@app.route('/convert', methods=['GET'])
def convert(value=10.0, _to='CAD', _from='INR'):
    if request.method == 'GET':
        print(value, _to, _from)
        params = (
            ('from', _from),
            ('to', _to),
            ('amount', value),
        )

        resp = re.get('https://xecdapi.xe.com/v1/convert_from.json/', params=params, auth=(xe_account_id, xe_api_key))
        result = {"result": resp.json()["to"][0]["mid"]}

        return jsonify(result)




if __name__ == '__main__':
    port = int(os.environ.get("PORT", 5000))
    app.run(host='0.0.0.0', port=port,debug=True)<commit_msg>fix endpoint<commit_after>import os
import requests as re
from flask import Flask, jsonify, request, redirect, url_for,session
from flask_cors import CORS
import json

from werkzeug import secure_filename

UPLOAD_FOLDER = 'tmp'
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg'])

app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
CORS(app)
app.secret_key = 'development'

# xe.com
xe_account_id = '<KEY>'
xe_api_key = '<KEY>'


def allowed_file(filename):
    return '.' in filename and \
        filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS


@app.route("/")
def helloWorld():
    return "Hello, world! <a href='https://github.com/rhnvrm/'>Fork me on GitHub!</a>"


@app.route('/translate', methods=['GET'])
def translate(text):
    if request.method == 'GET':
        input_text  = text
        print(text)
        pass


@app.route('/convert/<val>/<_to>/<_from>', methods=['GET'])
def convert(val, _to, _from):
    if request.method == 'GET':
        print(val, _to, _from)
        params = (
            ('from', _from),
            ('to', _to),
            ('amount', val),
        )

        resp = re.get('https://xecdapi.xe.com/v1/convert_from.json/', params=params, auth=(xe_account_id, xe_api_key))
        result = {"result": resp.json()["to"][0]["mid"], 'status': 'OK'}

        return jsonify(result)




if __name__ == '__main__':
    port = int(os.environ.get("PORT", 5000))
    app.run(host='0.0.0.0', port=port,debug=True)
{'fraction_non_alphanumeric': 0.17401791867677463, 'fraction_numerical': 0.009303928325292901, 'mean_word_length': 3.3984848484848484, 'pattern_counts': {'":': 2, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '837529', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1028, 'n_words': 224}