<commit_before><?php
require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client();
$url = "https://irail.be/stations/NMBS";
$response = $client->get($url, [
    'headers' => [
        'Accept'     => 'application/json',
    ]
]);

$json = $response->getBody();
echo $json;<commit_msg>Fix #1<commit_after><?php
require 'vendor/autoload.php';

use GuzzleHttp\Client;

$dist = "dist/stops.txt";

function getStops(){
	$client = new Client();
	$url = "https://irail.be/stations/NMBS";
	$response = $client->get($url, [
	    'headers' => [
	        'Accept'     => 'application/json',
	    ]
	]);

	$json = $response->getBody();

	return json_decode($json);
}

function appendCSV($dist, $csv) {
	file_put_contents($dist, trim($csv).PHP_EOL, FILE_APPEND);
}

// header CSV
$header = "stop_id,stop_name,stop_lat,stop_long,location_type";
appendCSV($dist, $header);

// content
$stops = getStops()->{"@graph"};

$csv = "";
for($i=0; $i<count($stops); $i++){
	$stop = $stops[$i];

	$csv .= $stop->{"@id"} . ",";
	$csv .= $stop->{"name"} . ",";
	$csv .= $stop->{"latitude"} . ",";
	$csv .= $stop->{"longitude"} . ",";
	$csv .= "1"; // what we describe are all parent_stations, which have "platforms"

	appendCSV($dist,$csv);
	$csv = "";
}


{'fraction_non_alphanumeric': 0.24118589743589744, 'fraction_numerical': 0.002403846153846154, 'mean_word_length': 3.9760956175298805, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 16, 'https://': 2, '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': '2096739', 'n_tokens_mistral': 494, 'n_tokens_neox': 480, 'n_words': 84}