<commit_before>from flask import Flask
import json
from service import execute_search, combine_duplicate_businesses, write_businesses

app = Flask(__name__)


@app.route('/api/<distance>/<location>/<query>')
def reviews(distance, location, query):
    locations = []
    coords = location.split(",")
    try:
        location = (float(coords[0]), float(coords[1]))
        locations.append(location)
        businesses = execute_search(locations, distance, query)
        return json.dumps(write_businesses(combine_duplicate_businesses(businesses)))
    except Exception:
        return "Wrong parameters"


if __name__ == '__main__':
    app.run(host='127.0.0.1', port=5000)<commit_msg>Enabling CORS<commit_after>from flask import Flask
import json
from service import execute_search, combine_duplicate_businesses, write_businesses
from flask_cors import CORS

app = Flask(__name__)
CORS(app)


@app.route('/api/<distance>/<location>/<query>')
def reviews(distance, location, query):
    locations = []
    coords = location.split(",")
    try:
        location = (float(coords[0]), float(coords[1]))
        locations.append(location)
        businesses = execute_search(locations, distance, query)
        return json.dumps(write_businesses(combine_duplicate_businesses(businesses)))
    except Exception:
        return "Wrong parameters"


if __name__ == '__main__':
    app.run(host='127.0.0.1', port=5000)
{'fraction_non_alphanumeric': 0.12322946175637393, 'fraction_numerical': 0.0169971671388102, 'mean_word_length': 4.455598455598456, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '5658479', 'n_tokens_mistral': 446, 'n_tokens_neox': 429, 'n_words': 91}