<commit_before># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.

from UM.PluginObject import PluginObject


##  Base class for plugins that extend the functionality of Uranium.
#   Every extension adds a (sub) menu to the extension menu with one or
#   more menu items.
class Extension(PluginObject):
    def __init__(self):
        super().__init__()
        self._menu_function_dict = {}
        self._menu_name = None

    ##  Add an item to the sub-menu of the extension
    #   \param name \type{string}
    #   \param function \type{function}
    def addMenuItem(self, name, function):
        self._menu_function_dict[name] = function

    ##  Set name of the menu where all menu items are placed in
    #   \param name \type{string}
    def setMenuName(self, name):
        self._menu_name = name

    ##  Get the name of the menu where all menu items are placed in
    #   \param menu name \type{string}
    def getMenuName(self):
        return self._menu_name

    ##  Call function associated with option<commit_msg>Keep the menuitems of an extension sorted<commit_after># Copyright (c) 2015 <NAME>.V.
# Uranium is released under the terms of the AGPLv3 or higher.

from UM.PluginObject import PluginObject
import collections

##  Base class for plugins that extend the functionality of Uranium.
#   Every extension adds a (sub) menu to the extension menu with one or
#   more menu items.
class Extension(PluginObject):
    def __init__(self):
        super().__init__()
        self._menu_function_dict = collections.OrderedDict()
        self._menu_name = None

    ##  Add an item to the sub-menu of the extension
    #   \param name \type{string}
    #   \param function \type{function}
    def addMenuItem(self, name, function):
        self._menu_function_dict[name] = function

    ##  Set name of the menu where all menu items are placed in
    #   \param name \type{string}
    def setMenuName(self, name):
        self._menu_name = name

    ##  Get the name of the menu where all menu items are placed in
    #   \param menu name \type{string}
    def getMenuName(self):
        return self._menu_name

    ##  Call function associated with option
{'fraction_non_alphanumeric': 0.07702702702702703, 'fraction_numerical': 0.0045045045045045045, 'mean_word_length': 2.9240282685512367, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2919237', 'n_tokens_mistral': 643, 'n_tokens_neox': 622, 'n_words': 251}