<commit_before>local simplehttp = require'simplehttp'
local sql = require'lsqlite3'
local iconv = require'iconv'
local json = require'json'

local utf2iso = iconv.new('iso-8859-15', 'utf-8')

local days = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }

local urlEncode = function(str)
	return str:gsub(
		'([^%w ])',
		function (c)
			return string.format ("%%%02X", string.byte(c))
		end
	):gsub(' ', '_')
end

local trim = function(s)
	return s:match('^%s*(.-)%s*$')
end

local parseDate = function(datestr)
	local year, month, day, hour, min, sec = datestr:match("([^-]+)%-([^-]+)%-([^T]+)T([^:]+):([^:]+):(%d%d)")
	return os.time{
		year = year,
		month = month,
		day = day,
		hour = hour,
		min = min,
		sec = sec,
	}
end

local formatPeriod = function(period)
	local out = {}

	table.insert(out, string.format("%s, %s°C", period.symbol.name, period.temperature.value))

	if(period.precipitation.value ~= "0") then
		table.insert(out, string.format("%s-%s mm", period.precipitation.minvalue, period.precipitation.maxvalue))
	end

	table.insert(out,
		string.format(
			"%s, %s %s mps",<commit_msg>yr: Correctly output precipitation with no min/max value.<commit_after>local simplehttp = require'simplehttp'
local sql = require'lsqlite3'
local iconv = require'iconv'
local json = require'json'

local utf2iso = iconv.new('iso-8859-15', 'utf-8')

local days = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }

local urlEncode = function(str)
	return str:gsub(
		'([^%w ])',
		function (c)
			return string.format ("%%%02X", string.byte(c))
		end
	):gsub(' ', '_')
end

local trim = function(s)
	return s:match('^%s*(.-)%s*$')
end

local parseDate = function(datestr)
	local year, month, day, hour, min, sec = datestr:match("([^-]+)%-([^-]+)%-([^T]+)T([^:]+):([^:]+):(%d%d)")
	return os.time{
		year = year,
		month = month,
		day = day,
		hour = hour,
		min = min,
		sec = sec,
	}
end

local formatPeriod = function(period)
	local out = {}

	table.insert(out, string.format("%s, %s°C", period.symbol.name, period.temperature.value))

	local rain = period.precipitation
	if(rain.value ~= "0") then
		if(rain.minvalue and rain.maxvalue) then
			table.insert(out, string.format("%s-%s mm", rain.minvalue, rain.maxvalue))
		else
			table.insert(out, string.format("%s mm", rain.value))
		end
	end

	table.insert(out,
		string.format(
			"%s, %s %s mps",
{'fraction_non_alphanumeric': 0.2117746717492588, 'fraction_numerical': 0.010165184243964422, 'mean_word_length': 4.392694063926941, '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': '711841', 'n_tokens_mistral': 982, 'n_tokens_neox': 919, 'n_words': 213}