<commit_before>import os
mapnik_data_dir = os.path.dirname(os.path.realpath(__file__))
env = {
    'ICU_DATA': os.path.join(mapnik_data_dir, 'icu'),
    'GDAL_DATA': os.path.join(mapnik_data_dir, 'gdal'),
    'PROJ_LIB': os.path.join(mapnik_data_dir, 'proj')
}
<commit_msg>Made mapnik settings only work in relative path if necessary<commit_after>import os
mapnik_data_dir = os.path.dirname(os.path.realpath(__file__))

env = {}
icu_path = os.path.join(mapnik_data_dir, 'icu')
if os.path.isdir(icu_path):
    env['ICU_DATA'] = icu_path
gdal_path = os.path.join(mapnik_data_dir, 'gdal')
if os.path.isdir(gdal_path):
    env['GDAL_DATA'] = gdal_path
proj_path = os.path.join(mapnik_data_dir, 'proj')
if os.path.isdir(proj_path):
    env['PROJ_LIB'] = proj_path
{'fraction_non_alphanumeric': 0.15303430079155672, 'fraction_numerical': 0.0, 'mean_word_length': 5.716814159292035, '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': '2727969', 'n_tokens_mistral': 320, 'n_tokens_neox': 312, 'n_words': 49}