<commit_before>from converters.gis_converter.extract.statistics.osm_groups import *  # noqa: ignore * import
from converters.gis_converter.helper.default_postgres import get_default_postgres_wrapper


def gather_statistics(outfile):
    out_file = open(outfile, 'w')
    all_stats = Statistics().gather_all()
    for stat in all_stats:
        print(';'.join(stat), file=out_file)
    out_file.close()

<commit_msg>using with<commit_after>from converters.gis_converter.extract.statistics.osm_groups import *  # noqa: ignore * import
from converters.gis_converter.helper.default_postgres import get_default_postgres_wrapper


def gather_statistics(outfile):
    with open(outfile, 'w') as out_file:
        all_stats = Statistics().gather_all()
        for stat in all_stats:
            print(';'.join(stat), file=out_file)


{'fraction_non_alphanumeric': 0.1006060606060606, 'fraction_numerical': 0.0, 'mean_word_length': 4.776223776223776, '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': '7323465', 'n_tokens_mistral': 268, 'n_tokens_neox': 266, 'n_words': 50}