<commit_before># -*- coding: utf-8 -*-

"""Utilities for working with Markdoc configurations."""

import os

import cherrypy.wsgiserver
import markdown
import yaml

import markdoc.exc


class ConfigNotFound(markdoc.exc.AbortError):
    """The configuration file was not found."""
    pass


class MarkdocConfig(dict):
    
    """A dictionary which represents the Markdoc configuration."""
    
    def __init__(self, config_file, config):
        super(MarkdocConfig, self).__init__(config)
        self.setdefault('meta', {})['config_file'] = config_file
    
    @classmethod<commit_msg>Put the wiki root directory into config['meta']['root'].<commit_after># -*- coding: utf-8 -*-

"""Utilities for working with Markdoc configurations."""

import os

import cherrypy.wsgiserver
import markdown
import yaml

import markdoc.exc


class ConfigNotFound(markdoc.exc.AbortError):
    """The configuration file was not found."""
    pass


class MarkdocConfig(dict):
    
    """A dictionary which represents a single wiki's Markdoc configuration."""
    
    def __init__(self, config_file, config):
        super(MarkdocConfig, self).__init__(config)
        self.setdefault('meta', {})['config_file'] = config_file
        self['meta']['root'] = os.path.dirname(config_file)
    
    @classmethod
{'fraction_non_alphanumeric': 0.12277992277992278, 'fraction_numerical': 0.0015444015444015444, 'mean_word_length': 3.853932584269663, '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': '7422656', 'n_tokens_mistral': 371, 'n_tokens_neox': 363, 'n_words': 103}