<commit_before>from __future__ import annotations

import abc
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from gaphor.core.modeling import Element
    from gaphor.diagram.diagramtoolbox import ToolboxDefinition


class Service(metaclass=abc.ABCMeta):
    """Base interface for all services in Gaphor."""

    @abc.abstractmethod
    def shutdown(self) -> None:
        """Shutdown the services, free resources."""


class ActionProvider(metaclass=abc.ABCMeta):
    """An action provider is a special service that provides actions (see
    gaphor/action.py)."""


class ModelingLanguage(metaclass=abc.ABCMeta):
    """A model provider is a special service that provides an entrypoint to a
    model implementation, such as UML, SysML, RAAML."""

    @abc.abstractproperty
    def name(self) -> str:
        """Human readable name of the model."""

    @abc.abstractproperty
    def toolbox_definition(self) -> ToolboxDefinition:
        """Get structure for the toolbox."""

    @abc.abstractmethod
    def lookup_element(self, name: str) -> type[Element] | None:
        """Look up a model element type (class) by name."""<commit_msg>Remove use of deprecated abstractproperty<commit_after>from __future__ import annotations

from abc import ABCMeta, abstractmethod
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from gaphor.core.modeling import Element
    from gaphor.diagram.diagramtoolbox import ToolboxDefinition


class Service(metaclass=ABCMeta):
    """Base interface for all services in Gaphor."""

    @abstractmethod
    def shutdown(self) -> None:
        """Shutdown the services, free resources."""


class ActionProvider(metaclass=ABCMeta):
    """An action provider is a special service that provides actions (see
    gaphor/action.py)."""


class ModelingLanguage(metaclass=ABCMeta):
    """A model provider is a special service that provides an entrypoint to a
    model implementation, such as UML, SysML, RAAML."""

    @property
    @abstractmethod
    def name(self) -> str:
        """Human readable name of the model."""

    @property
    @abstractmethod
    def toolbox_definition(self) -> ToolboxDefinition:
        """Get structure for the toolbox."""

    @abstractmethod
    def lookup_element(self, name: str) -> type[Element] | None:
        """Look up a model element type (class) by name."""
{'fraction_non_alphanumeric': 0.09637526652452026, 'fraction_numerical': 0.0, 'mean_word_length': 3.7586206896551726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '451050', 'n_tokens_mistral': 657, 'n_tokens_neox': 629, 'n_words': 226}