<commit_before>class URLHelper(object):
    @classmethod
    def url(cls, pattern, method='GET'):
        def _inner(func):
            setattr(func, '__drongo_url_pattern', pattern)
            setattr(func, '__drongo_url_method', method)
            return func

        return _inner

    @classmethod
    def mount(cls, app, instance, base_url=''):
        for attr in dir(instance):
            attr = getattr(instance, attr)
            if hasattr(attr, '__drongo_url_pattern'):
                app.add_url(<commit_msg>Adding doc for url helper.<commit_after>class URLHelper(object):
    """Helper class with using urls within the class"""

    @classmethod
    def url(cls, pattern, method='GET'):
        """Decorator to mark url pattern for a callable

        Args:
            pattern (:obj:`str`): URL pattern to add. This is usually '/'
                separated path. Parts of the URL can be parameterised using
                curly braces.
                Examples: "/", "/path/to/resource", "/resoures/{param}"
            method (:obj:`str`, :obj:`list` of :obj:`str`, optional): HTTP
                methods for the path specied. By default, GET method is added.
                Value can be either a single method, by passing a string, or
                multiple methods, by passing a list of strings.

        Note:
            A trailing '/' is always assumed in the pattern.
        """
        def _inner(func):
            setattr(func, '__drongo_url_pattern', pattern)
            setattr(func, '__drongo_url_method', method)
            return func

        return _inner

    @classmethod
    def mount(cls, app, instance, base_url=''):
        """Mount an instance with methods marked with url on to a drongo app.

        Args:
            app: Drongo app instance.
            instance: Instance that contains methods with url decorator.
            base_url: URL prefix for all the url patterns used.
        """
        for attr in dir(instance):
            attr = getattr(instance, attr)
            if hasattr(attr, '__drongo_url_pattern'):
                app.add_url(
{'fraction_non_alphanumeric': 0.09354226020892688, 'fraction_numerical': 0.0, 'mean_word_length': 2.031654676258993, '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': '4080783', 'n_tokens_mistral': 567, 'n_tokens_neox': 546, 'n_words': 198}