<commit_before><commit_msg>Added example (load submissions for contest by it's id)<commit_after>#!/usr/bin/env python3

"""
In this example we are loading submissions for contest by it's id
"""

import os
import sys

from api import CodeforcesAPI


def main(argv):
    api = CodeforcesAPI()

    contest_id = int(argv[1])

    submissions = api.contest_status(contest_id)

    print('{:^20}{}'.format('Submission ID', 'Party members'))

    for s in submissions:
        print('{:^20}{}'.format(s.id, ', '.join(member.handle for member in s.author.members)))


if __name__ == '__main__':
    if len(sys.argv) == 2:
        main(sys.argv)
    else:
        print("Invalid number of arguments")
        print("Usage: python {} [contest id]".format(os.path.basename(sys.argv[0])))
{'fraction_non_alphanumeric': 0.15057915057915058, 'fraction_numerical': 0.010296010296010296, 'mean_word_length': 3.7151515151515153, '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': '815826', 'n_tokens_mistral': 268, 'n_tokens_neox': 253, 'n_words': 68}