<commit_before>import dectate
from .request import Request
from .traject import Traject
from .settings import SettingSectionContainer
from .converter import ConverterRegistry
from .predicate import PredicateRegistry
from .tween import TweenRegistry
from reg import Registry as RegRegistry, CachingKeyLookup
from . import compat
from .implicit import set_implicit
from .mount import MountRegistry
from .reify import reify
from .template import TemplateEngineRegistry


COMPONENT_CACHE_SIZE = 5000
ALL_CACHE_SIZE = 5000
FALLBACK_CACHE_SIZE = 5000


class Registry(RegRegistry, MountRegistry, PredicateRegistry,
               ConverterRegistry, TweenRegistry, TemplateEngineRegistry):
    """A registry holding an application's configuration.
    """
    app = None  # app this registry belongs to. set later during scanning

    def __init__(self):
        RegRegistry.__init__(self)
        MountRegistry.__init__(self)
        PredicateRegistry.__init__(self)
        ConverterRegistry.__init__(self)
        TweenRegistry.__init__(self)
        TemplateEngineRegistry.__init__(self)
        self.settings = SettingSectionContainer()
        self.clear()

    def clear(self):
        """Clear all registrations in this application.
        """
        RegRegistry.clear(self)
        MountRegistry.clear(self)
        PredicateRegistry.clear(self)
        ConverterRegistry.clear(self)
        TweenRegistry.clear(self)
        TemplateEngineRegistry.clear(self)
        self.traject = Traject()

    @reify
    def lookup(self):
        return CachingKeyLookup(
            self,
            COMPONENT_CACHE_SIZE,
            ALL_CACHE_SIZE,
            FALLBACK_CACHE_SIZE).lookup()


class App(dectate.App):
    """A Morepath-based application object.

    You subclass App to create a morepath application class. You can
    then configure this class using Morepath decorator directives.

    An application can extend one or more other applications, if
    desired, by subclassing them. By subclassing App itself, you get
    the base configuration of the Morepath framework itself.

    Conflicting configuration within an app is automatically
    rejected. An subclass app cannot conflict with the apps it is
    subclassing however; instead configuration is overridden.

    You can turn your app class into a WSGI application by instantiating
    it. You can then call it with the ``environ`` and ``start_response``
    arguments.
    """
    parent = None<commit_msg>Note our base class and refer to dectate.<commit_after>import dectate
from reg import Registry as RegRegistry, CachingKeyLookup

from .request import Request
from .traject import Traject
from .settings import SettingSectionContainer
from .converter import ConverterRegistry
from .predicate import PredicateRegistry
from .tween import TweenRegistry
from . import compat
from .implicit import set_implicit
from .mount import MountRegistry
from .reify import reify
from .template import TemplateEngineRegistry


COMPONENT_CACHE_SIZE = 5000
ALL_CACHE_SIZE = 5000
FALLBACK_CACHE_SIZE = 5000


class Registry(RegRegistry, MountRegistry, PredicateRegistry,
               ConverterRegistry, TweenRegistry, TemplateEngineRegistry):
    """A registry holding an application's configuration.
    """
    app = None  # app this registry belongs to. set later during scanning

    def __init__(self):
        RegRegistry.__init__(self)
        MountRegistry.__init__(self)
        PredicateRegistry.__init__(self)
        ConverterRegistry.__init__(self)
        TweenRegistry.__init__(self)
        TemplateEngineRegistry.__init__(self)
        self.settings = SettingSectionContainer()
        self.clear()

    def clear(self):
        """Clear all registrations in this application.
        """
        RegRegistry.clear(self)
        MountRegistry.clear(self)
        PredicateRegistry.clear(self)
        ConverterRegistry.clear(self)
        TweenRegistry.clear(self)
        TemplateEngineRegistry.clear(self)
        self.traject = Traject()

    @reify
    def lookup(self):
        return CachingKeyLookup(
            self,
            COMPONENT_CACHE_SIZE,
            ALL_CACHE_SIZE,
            FALLBACK_CACHE_SIZE).lookup()


class App(dectate.App):
    """A Morepath-based application object.

    You subclass App to create a morepath application class. You can
    then configure this class using Morepath decorator directives.

    An application can extend one or more other applications, if
    desired, by subclassing them. By subclassing App itself, you get
    the base configuration of the Morepath framework itself.

    Conflicting configuration within an app is automatically
    rejected. An subclass app cannot conflict with the apps it is
    subclassing however; instead configuration is overridden.

    You can turn your app class into a WSGI application by instantiating
    it. You can then call it with the ``environ`` and ``start_response``
    arguments.

    Subclasses from :class:`dectate.App`, which provides the
    :meth:`dectate.App.directive` decorator to allow you to register
    new directives.
    """
    parent = None
{'fraction_non_alphanumeric': 0.05799922148695991, 'fraction_numerical': 0.004671078240560529, 'mean_word_length': 3.2896494156928213, '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': '2706083', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1261, 'n_words': 465}