<commit_before>import json

from ns_api import Station, NSAPI
from local_settings import USERNAME, APIKEY


def update_station_data():
    nsapi = NSAPI(USERNAME, APIKEY)
    stations = nsapi.get_stations()

    data = {'stations': []}
    for station in stations:
        # if station.country == "NL" and "Utrecht" in station.names['long']:
        if station.country == "NL":
            names = station.names
            data['stations'].append({'names': names, 'lon': station.lon, 'lat': station.lat, 'type': station.stationtype})

    json_data = json.dumps(data, indent=4, sort_keys=True)
    with open('stations.json', 'w') as fileout:
        fileout.write(json_data)


if __name__ == "__main__":
    update_station_data()<commit_msg>Move location of generated stations.json to data directory<commit_after>import json

from ns_api import Station, NSAPI
from local_settings import USERNAME, APIKEY


def update_station_data():
    nsapi = NSAPI(USERNAME, APIKEY)
    stations = nsapi.get_stations()

    data = {'stations': []}
    for station in stations:
        # if station.country == "NL" and "Utrecht" in station.names['long']:
        if station.country == "NL":
            names = station.names
            data['stations'].append({'names': names, 'lon': station.lon, 'lat': station.lat, 'type': station.stationtype})

    json_data = json.dumps(data, indent=4, sort_keys=True)
    with open('./data/stations.json', 'w') as fileout:
        fileout.write(json_data)


if __name__ == "__main__":
    update_station_data()
{'fraction_non_alphanumeric': 0.13411458333333334, 'fraction_numerical': 0.0013020833333333333, 'mean_word_length': 3.5473372781065087, 'pattern_counts': {'":': 4, '<': 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': '2189810', 'n_tokens_mistral': 486, 'n_tokens_neox': 481, 'n_words': 124}