<commit_before>from app.models import TimeExercisesTaxonomy
from app.service import TimeExercisesTaxonomyService

class TimeExercisesManagement(object):
    """
    Interactions with TimeExercises both Histories and Taxonomies

    I N T E R F A C E   G U A R AN T E E D
    --------------------------------------

    submit_taxonomy_entry(name):
        -- Creates and adds a TimeExercisesTaxonomy to the database. Returns the added entry
    """
    @staticmethod
    def submit_taxonomy_entry(name):
        entry_to_add = TimeExercisesTaxonomy(name=name)

        TimeExercisesTaxonomyService.add_entry_to_db(entry_to_add)

        return entry_to_add
<commit_msg>submit history entry in time exercises management<commit_after>from app.models import TimeExercisesTaxonomy, TimeExercisesHistory
from app.service import TimeExercisesTaxonomyService, TimeExercisesHistoryService


class TimeExercisesManagement(object):
    """
    Interactions with TimeExercises both Histories and Taxonomies

    I N T E R F A C E   G U A R AN T E E D
    --------------------------------------
    submit_history_entry(user_id, exercise_id, distance, duration, exercise_date):
        -- Creates and adds a TimeExercisesHistory to the database for the user_id that's passed in
        -- Returns the added entry


    submit_taxonomy_entry(name):
        -- Creates and adds a TimeExercisesTaxonomy to the database. Returns the added entry
    """
    @staticmethod
    def submit_history_entry(user_id, exercise_id, distance, duration, exercise_date):
        entry_to_add = TimeExercisesHistory(
            user_id=user_id,
            exercise_id=exercise_id,
            distance=distance,
            duration=duration,
            exercise_date=exercise_date
        )

        TimeExercisesHistoryService.add_entry_to_db(entry_to_add)

        return entry_to_add

    @staticmethod
    def submit_taxonomy_entry(name):
        entry_to_add = TimeExercisesTaxonomy(name=name)

        TimeExercisesTaxonomyService.add_entry_to_db(entry_to_add)

        return entry_to_add

{'fraction_non_alphanumeric': 0.08454106280193237, 'fraction_numerical': 0.0, 'mean_word_length': 2.8710280373831774, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5105163', 'n_tokens_mistral': 590, 'n_tokens_neox': 573, 'n_words': 160}