<commit_before>"""Main module."""

from .containers import ApplicationContainer


if __name__ == '__main__':
    application = ApplicationContainer()
    application.config.from_ini('config.ini')

    user_repository = application.user_package.user_repository()
    photo_repository = application.photo_package.photo_repository()

    user1 = user_repository.get(id=1)
    user1_photos = photo_repository.get_photos(user1.id)
    print(f'Retrieve user id={user1.id}, photos count={len(user1_photos)}')

    user2 = user_repository.get(id=2)
    user2_photos = photo_repository.get_photos(user2.id)
    print(f'Retrieve user id={user2.id}, photos count={len(user2_photos)}')

    aggregation_service = application.analytics_package.aggregation_service()
    assert aggregation_service.user_repository is user_repository
    assert aggregation_service.photo_repository is photo_repository
    print('Aggregate analytics from user and photo packages')<commit_msg>Refactor main module<commit_after>"""Main module."""

from .containers import ApplicationContainer


def main() -> None:
    application = ApplicationContainer()
    application.config.from_ini('config.ini')

    user_repository = application.user_package.user_repository()
    photo_repository = application.photo_package.photo_repository()

    user1 = user_repository.get(id=1)
    user1_photos = photo_repository.get_photos(user1.id)
    print(f'Retrieve user id={user1.id}, photos count={len(user1_photos)}')

    user2 = user_repository.get(id=2)
    user2_photos = photo_repository.get_photos(user2.id)
    print(f'Retrieve user id={user2.id}, photos count={len(user2_photos)}')

    aggregation_service = application.analytics_package.aggregation_service()
    assert aggregation_service.user_repository is user_repository
    assert aggregation_service.photo_repository is photo_repository
    print('Aggregate analytics from user and photo packages')


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.10051020408163265, 'fraction_numerical': 0.012244897959183673, 'mean_word_length': 5.514950166112957, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6643817', 'n_tokens_mistral': 583, 'n_tokens_neox': 557, 'n_words': 107}