<commit_before>from flask import *
import fun_requests as f
import requests

app = Flask(__name__)
app.config.from_object('config')


@app.route('/itinerary/create', methods=['POST'])
def create_itinerary():
    """Creates an itinerary with the given JSON itinerary data.

    returns:
        { "createdAt": "2014-09-20T18:13:06.612Z", "objectId": "damL3gBx0e" }
    """
    r = requests.post('https://api.parse.com/1/classes/Itinerary',
                      headers=app.config['PARSE_HEADERS'],
                      data=request.get_data())
    return jsonify(r.json())


@app.route('/itinerary/<parseid>', methods=['GET'])
def get_itinerary(parseid):
    """Gets the itinerary for a given parseid.

    returns:
        { "itinerary": [ { "id": "abcdefg", "lat": 12.34, "lon": 34.56, "name": "test" } ] }
    """
    r = requests.get('https://api.parse.com/1/classes/Itinerary/{}'.format(parseid),
                     headers=app.config['PARSE_HEADERS'])
    return render_template('index.html',
                           itinerary=jsonify(itinerary=r.json()['itinerary']))


@app.route('/itinerary/<parseid>', methods=['POST'])
def update_itinerary(parseid):
    """ Gets the itinerary for a particular parseid

    POST data must follow this format:

        { "itinerary": [ {
                "id": "abcdefg",
                "name": "test",
                "lat": 12.34,
                "lon": 34.56
         }, ] }

    returns:
        { "updatedAt": "2014-09-20T17:57:36.171Z" }
    """
    json_header = {'Content-Type': 'application/json'}
    update_headers = dict(app.config['PARSE_HEADERS'].items() + json_header.items())
    r = requests.put('https://api.parse.com/1/classes/Itinerary/{}'.format(parseid),
                     headers=update_headers, data=request.get_data())
    return jsonify(r.json())


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

<commit_msg>dont commit if it's broken plebes<commit_after>from flask import *
import fun_requests as f
import requests

app = Flask(__name__)
app.config.from_object('config')


@app.route('/itinerary/create', methods=['POST'])
def create_itinerary():
    """Creates an itinerary with the given JSON itinerary data.

    returns:
        { "createdAt": "2014-09-20T18:13:06.612Z", "objectId": "damL3gBx0e" }
    """
    r = requests.post('https://api.parse.com/1/classes/Itinerary',
                      headers=app.config['PARSE_HEADERS'],
                      data=request.get_data())
    return jsonify(r.json())


@app.route('/itinerary/<parseid>', methods=['GET'])
def get_itinerary(parseid):
    """Gets the itinerary for a given parseid.

    returns:
        { "itinerary": [ { "id": "abcdefg", "lat": 12.34, "lon": 34.56, "name": "test" } ] }
    """
    r = requests.get('https://api.parse.com/1/classes/Itinerary/{}'.format(parseid),
                     headers=app.config['PARSE_HEADERS'])

    return jsonify(itinerary=r.json()['itinerary'])


@app.route('/itinerary/<parseid>', methods=['POST'])
def update_itinerary(parseid):
    """ Gets the itinerary for a particular parseid

    POST data must follow this format:

        { "itinerary": [ {
                "id": "abcdefg",
                "name": "test",
                "lat": 12.34,
                "lon": 34.56
         }, ] }

    returns:
        { "updatedAt": "2014-09-20T17:57:36.171Z" }
    """
    json_header = {'Content-Type': 'application/json'}
    update_headers = dict(app.config['PARSE_HEADERS'].items() + json_header.items())
    r = requests.put('https://api.parse.com/1/classes/Itinerary/{}'.format(parseid),
                     headers=update_headers, data=request.get_data())
    return jsonify(r.json())


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


{'fraction_non_alphanumeric': 0.17333686721441824, 'fraction_numerical': 0.029154518950437316, 'mean_word_length': 2.758964143426295, 'pattern_counts': {'":': 26, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, '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': '1278770', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1230, 'n_words': 222}