<commit_before>from pylons.i18n import ugettext as _
from paste.registry import StackedObjectProxy

# The central feed cache, used by the Feed widget.
feed_cache = StackedObjectProxy()

# All loaded moksha applications
apps = StackedObjectProxy()

# All loaded ToscaWidgets
_widgets = StackedObjectProxy()

# Per-request stomp callbacks registered by rendered widget
stomp = StackedObjectProxy()

def get_widget(name):
    """ Get a widget by name.

    This method returns a dictionary in the following format:

        { 'name': 'widgetname',
          'widget': <Widget instance>,
          'path': '/path/to/widget' }
    """
    return _widgets[name]
<commit_msg>Have our moksha.get_widget method only return the widget instance<commit_after>from pylons.i18n import ugettext as _
from paste.registry import StackedObjectProxy

# The central feed cache, used by the Feed widget.
feed_cache = StackedObjectProxy()

# All loaded moksha applications
apps = StackedObjectProxy()

# All loaded ToscaWidgets
_widgets = StackedObjectProxy()

# Per-request stomp callbacks registered by rendered widget
stomp = StackedObjectProxy()

def get_widget(name):
    """ Get a widget by name.

    This method returns a dictionary in the following format:

        { 'name': 'widgetname',
          'widget': <Widget instance>,
          'path': '/path/to/widget' }
    """
    return _widgets[name]['widget']

{'fraction_non_alphanumeric': 0.08798283261802575, 'fraction_numerical': 0.002861230329041488, 'mean_word_length': 3.926056338028169, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '872991', 'n_tokens_mistral': 407, 'n_tokens_neox': 392, 'n_words': 138}