<commit_before>#!/usr/bin/python3
'''
Run simulations with parameter samples.
'''

import model


countries = model.datasheet.get_country_list()
# Move these to the front.
countries_to_plot = ['United States of America',
                     'South Africa',
                     'Uganda',
                     'Nigeria',
                     'India',
                     'Rwanda']
for c in countries_to_plot:
    countries.remove(c)
countries = countries_to_plot + countries


def _run_country(country, target):
    print('Running {}, {!s}.'.format(country, target))
    parametersamples = model.parameters.Samples(country)
    multisim = model.simulation.MultiSim(parametersamples, target)
    return multisim


def _main():
    for country in countries:
        for target in model.target.all_:
            if not model.results.exists(country, target):
                results = _run_country(country, target)
                model.results.dump(results)


if __name__ == '__main__':
    _main()
<commit_msg>Minor cleanup.<commit_after>#!/usr/bin/python3
'''
Run simulations with parameter samples.
'''

import model


countries = model.datasheet.get_country_list()
# Move these to the front.
countries_to_plot = ['United States of America',
                     'South Africa',
                     'Uganda',
                     'Nigeria',
                     'India',
                     'Rwanda']
for c in countries_to_plot:
    countries.remove(c)
countries = countries_to_plot + countries


def _run_one(country, target):
    print('Running {}, {!s}.'.format(country, target))
    parameter_samples = model.parameters.Samples(country)
    results = model.simulation.MultiSim(parameter_samples, target)
    model.results.dump(results)


def _main():
    for country in countries:
        for target in model.target.all_:
            if not model.results.exists(country, target):
                _run_one(country, target)


if __name__ == '__main__':
    _main()

{'fraction_non_alphanumeric': 0.10761421319796954, 'fraction_numerical': 0.0010152284263959391, 'mean_word_length': 2.43979057591623, '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': '3896379', 'n_tokens_mistral': 582, 'n_tokens_neox': 550, 'n_words': 136}