<commit_before>from adhocracy4.dashboard import components
from adhocracy4.dashboard import ProjectDashboard
from meinberlin.apps.projects import get_project_type


default_app_config = 'meinberlin.apps.dashboard.apps.Config'


class TypedProjectDashboard(ProjectDashboard):
    def __init__(self, project):
        self.project_type = get_project_type(project)
        if self.project_type == 'bplan':
            project = project.externalproject.bplan
        elif self.project_type == 'external':
            project = project.externalproject
        elif self.project_type == 'container':
            project = project.projectcontainer
        super().__init__(project)

    def get_project_components(self):
        if self.project_type == 'bplan':
            return [components.projects.get('bplan'),
                    components.projects.get('adminlog')]
        elif self.project_type == 'external':
            return [components.projects.get('external'),
                    components.projects.get('adminlog')]
        elif self.project_type == 'container':
            return [components.projects.get('container-basic'),
                    components.projects.get('container-information'),
                    components.projects.get('container-projects')]

        return [component for component in components.get_project_components()
                if component.is_effective(self.project)]

    def get_module_components(self):
        if self.project_type == 'bplan':
            return []
        elif self.project_type == 'external':
            return []
        elif self.project_type == 'container':
            return []

        return components.get_module_components()<commit_msg>add topic and point to container form<commit_after>from adhocracy4.dashboard import components
from adhocracy4.dashboard import ProjectDashboard
from meinberlin.apps.projects import get_project_type


default_app_config = 'meinberlin.apps.dashboard.apps.Config'


class TypedProjectDashboard(ProjectDashboard):
    def __init__(self, project):
        self.project_type = get_project_type(project)
        if self.project_type == 'bplan':
            project = project.externalproject.bplan
        elif self.project_type == 'external':
            project = project.externalproject
        elif self.project_type == 'container':
            project = project.projectcontainer
        super().__init__(project)

    def get_project_components(self):
        if self.project_type == 'bplan':
            return [components.projects.get('bplan'),
                    components.projects.get('adminlog')]
        elif self.project_type == 'external':
            return [components.projects.get('external'),
                    components.projects.get('adminlog')]
        elif self.project_type == 'container':
            return [components.projects.get('container-basic'),
                    components.projects.get('container-information'),
                    components.projects.get('topics'),
                    components.projects.get('point'),
                    components.projects.get('container-projects')]

        return [component for component in components.get_project_components()
                if component.is_effective(self.project)]

    def get_module_components(self):
        if self.project_type == 'bplan':
            return []
        elif self.project_type == 'external':
            return []
        elif self.project_type == 'container':
            return []

        return components.get_module_components()
{'fraction_non_alphanumeric': 0.09957805907172995, 'fraction_numerical': 0.0011251758087201125, 'mean_word_length': 2.581067472306143, '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': '1542940', 'n_tokens_mistral': 886, 'n_tokens_neox': 869, 'n_words': 171}