<commit_before>import requests
from polyline.codec import PolylineCodec
import json

def match(points, host='http://localhost:5000', geometry=False,gps_precision=-1, matching_beta=-1, decoded_polyline=True):
    url = host + '/match?'
    for loc, t in points:
        url += 'loc=' + str(loc[0]) + ',' + str(loc[1]) + '&t=' + str(t)
    # url += '&geometry=' + str(geometry) + '&gps_precision=' + str(gps_precision) + '&matching_beta=' + str(matching_beta)
    print url
    r = requests.get(url)
    r_json = r.json()

    if decoded_polyline:
        r_json = r_json
    #     for matching in r_json['matchings']:
    #         print [[point[1]/10.0, point[0]/10.0] for point in PolylineCodec().decode(matching['geometry'])]
    #     city_geojson['features'] = [city for city in city_geojson['features']]

    print r_json<commit_msg>add polyline decode support<commit_after>import requests
# from polyline.codec import PolylineCodec
import json

def match(points, host='http://localhost:5000', geometry=False,gps_precision=-1, matching_beta=-1, decode_polyline=True):
    url = host + '/match?'
    for loc, t in points:
        url += 'loc=' + str(loc[0]) + ',' + str(loc[1]) + '&t=' + str(t)
    # url += '&geometry=' + str(geometry) + '&gps_precision=' + str(gps_precision) + '&matching_beta=' + str(matching_beta)
    print url
    r = requests.get(url)
    r_json = r.json()
    if decode_polyline:
        for i, matching in enumerate(r_json['matchings']):
            my_new_value = 'something'
            r_json["matchings"][i]["geometry"] = my_new_value
    return r_json
{'fraction_non_alphanumeric': 0.16078184110970997, 'fraction_numerical': 0.015132408575031526, 'mean_word_length': 3.7091988130563798, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6917335', 'n_tokens_mistral': 556, 'n_tokens_neox': 534, 'n_words': 120}