<commit_before>from openassessment.xblock.defaults import (PEER_ASSESSMENT_MODULES, SELF_ASSESSMENT_MODULES,
                                            SELF_TO_PEER_ASSESSMENT_MODULES, SELF_TO_STAFF_ASSESSMENT_MODULES,
                                            STAFF_ASSESSMENT_MODULES)
from django.utils.translation import ugettext as _


class OpenAssessmentTemplatesMixin(object):
    """
    This helps to get templates for different type of assessment that is
    offered.
    """

    VALID_ASSESSMENT_TYPES_DISPLAY_NAMES = {
        "peer-assessment": _("Peer Assessment Only"),
        "self-assessment": _("Self Assessment Only"),
        "staff-assessment": _("Staff Assessment Only"),
        "self-to-peer": _("Self Assessment to Peer Assessment"),
        "self-to-staff": _("Self Assessment to Peer Assessment")
    }

    VALID_ASSESSMENT_TYPES_ASSESSMENT_MODULE = {
        "peer-assessment": PEER_ASSESSMENT_MODULES,
        "self-assessment": SELF_ASSESSMENT_MODULES,
        "staff-assessment": STAFF_ASSESSMENT_MODULES,
        "self-to-peer": SELF_TO_PEER_ASSESSMENT_MODULES,
        "self-to-staff": SELF_TO_STAFF_ASSESSMENT_MODULES
    }

    @classmethod
    def templates(cls):
        """
        Returns a list of dictionary field: value objects that describe possible templates.
        """
        templates = []
        for assesment_type, display_name in cls.VALID_ASSESSMENT_TYPES_DISPLAY_NAMES.items():
            template_id = assesment_type
            template = cls._create_template_dict(template_id, display_name)
            templates.append(template)
        return templates<commit_msg>Added comments explaining the class<commit_after>"""
    Open Assessment Template mixin helps out in generating different presets to display in studio.
"""

from openassessment.xblock.defaults import (PEER_ASSESSMENT_MODULES, SELF_ASSESSMENT_MODULES,
                                            SELF_TO_PEER_ASSESSMENT_MODULES, SELF_TO_STAFF_ASSESSMENT_MODULES,
                                            STAFF_ASSESSMENT_MODULES)
from django.utils.translation import ugettext as _


class OpenAssessmentTemplatesMixin:
    """
    This helps to get templates for different type of assessment that is
    offered.
    """

    VALID_ASSESSMENT_TYPES_DISPLAY_NAMES = {
        "peer-assessment": _("Peer Assessment Only"),
        "self-assessment": _("Self Assessment Only"),
        "staff-assessment": _("Staff Assessment Only"),
        "self-to-peer": _("Self Assessment to Peer Assessment"),
        "self-to-staff": _("Self Assessment to Staff Assessment")
    }

    VALID_ASSESSMENT_TYPES_ASSESSMENT_MODULE = {
        "peer-assessment": PEER_ASSESSMENT_MODULES,
        "self-assessment": SELF_ASSESSMENT_MODULES,
        "staff-assessment": STAFF_ASSESSMENT_MODULES,
        "self-to-peer": SELF_TO_PEER_ASSESSMENT_MODULES,
        "self-to-staff": SELF_TO_STAFF_ASSESSMENT_MODULES
    }

    @classmethod
    def templates(cls):
        """
        Returns a list of dictionary field: value objects that describe possible templates.
        """
        templates = []
        for assesment_type, display_name in cls.VALID_ASSESSMENT_TYPES_DISPLAY_NAMES.items():
            template_id = assesment_type
            template = cls._create_template_dict(template_id, display_name)
            templates.append(template)
        return templates
{'fraction_non_alphanumeric': 0.07887740029542098, 'fraction_numerical': 0.0, 'mean_word_length': 2.8346545866364665, 'pattern_counts': {'":': 20, '<': 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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5708419', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1002, 'n_words': 204}