<commit_before>import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
import requests

name_associations = {
    'day': 'Daily',
    'week': 'Weekly',
    'month': 'Monthly'
}


def submission_title(board_name):
    cur_time = datetime.utcnow()

    if board_name == "day":
        date_string = cur_time.strftime('%B %d, %Y')
    elif board_name == "week":
        date_string = cur_time.strftime('%B %d, %Y')
    elif board_name == "month":
        # monthly boards are reset during the 1st, so we need the name of the
        # previous month
        prev_time = cur_time - relativedelta(months=1)
        date_string = prev_time.strftime('%B %Y')
    else:
        raise ValueError("Invalid board name argument; valid names are "
                         "day/week/month")

    submission_title = "%s Leaderboard Log/Statistics for %s" %\
        (name_associations[board_name], date_string)

    return submission_title


def time_str(seconds):
    return time.strftime('%H:%M:%S', time.gmtime(int(seconds)))<commit_msg>fix time_str to not truncate days<commit_after>import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
import requests

name_associations = {
    'day': 'Daily',
    'week': 'Weekly',
    'month': 'Monthly'
}


def submission_title(board_name):
    cur_time = datetime.utcnow()

    if board_name == "day":
        date_string = cur_time.strftime('%B %d, %Y')
    elif board_name == "week":
        date_string = cur_time.strftime('%B %d, %Y')
    elif board_name == "month":
        # monthly boards are reset during the 1st, so we need the name of the
        # previous month
        prev_time = cur_time - relativedelta(months=1)
        date_string = prev_time.strftime('%B %Y')
    else:
        raise ValueError("Invalid board name argument; valid names are "
                         "day/week/month")

    submission_title = "%s Leaderboard Log/Statistics for %s" %\
        (name_associations[board_name], date_string)

    return submission_title


def time_str(seconds):
    # https://stackoverflow.com/a/8907407
    hours, remainder = divmod(int(seconds), 60 * 60)
    minutes, seconds = divmod(remainder, 60)
    return "%d:%d:%d" % (hours, minutes, seconds)
{'fraction_non_alphanumeric': 0.1164021164021164, 'fraction_numerical': 0.007495590828924162, 'mean_word_length': 3.1254545454545455, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3766505', 'n_tokens_mistral': 737, 'n_tokens_neox': 705, 'n_words': 190}