<commit_before>-module(kublai).
-compile(export_all).
writeTile(Map,X,Y,Z)->
Path = filename:absname(""),
Inname = lists:concat([Map, ".mbtiles"]),
Pathparts = [Path,"tiles",Inname],
Tileset = filename:join(Pathparts),
{ok, Db} = sqlite3:start_link(mpo,[{file, Tileset}]),
Qparts = ["SELECT tile_data FROM tiles WHERE zoom_level = ", Z, "  AND tile_column = ", X, " AND tile_row = ", Y],
Sql = lists:concat(Qparts),
[{columns,["tile_data"]},{rows,[{{blob,Tile}}]}] = sqlite3:sql_exec(Db, Sql),
Outputlist = [Y, ".png"],
Outname = lists:concat(Outputlist),
file:write_file(Outname,Tile).<commit_msg>cleaner code<commit_after>-module(kublai).
-compile(export_all).
writeTile(Map,X,Y,Z)->
{ok, Db} = sqlite3:start_link(mpo,[{file, filename:join([filename:absname(""),"tiles",lists:concat([Map, ".mbtiles"])])}]),

[{columns,["tile_data"]},{rows,[{{blob,Tile}}]}] = sqlite3:sql_exec(Db, lists:concat(["SELECT tile_data FROM tiles WHERE zoom_level = ", Z, "  AND tile_column = ", X, " AND tile_row = ", Y])),

file:write_file(lists:concat([Y, ".png"]),Tile).
{'fraction_non_alphanumeric': 0.23171889838556506, 'fraction_numerical': 0.003798670465337132, 'mean_word_length': 8.24561403508772, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '41759', 'n_tokens_mistral': 409, 'n_tokens_neox': 394, 'n_words': 66}