<commit_before># -*- coding: utf-8 -*-
"""
Sphinx Auto-API
"""

import fnmatch
import shutil

from .domains import DotNetDomain, PythonDomain, GoDomain


def ignore_file(app, filename):
    for pat in app.config.autoapi_ignore:
        if fnmatch.fnmatch(filename, pat):
            return True
    return False


def load_yaml(app):
    """
    Load AutoAPI data from the filesystem.
    """

    if not app.config.autoapi_dir:
        print "You must configure an autodapi_dir setting."
        return
    app.env.autoapi_data = []

    if app.config.autoapi_type == 'dotnet':
        domain = DotNetDomain(app)
    elif app.config.autoapi_type == 'python':
        domain = PythonDomain(app)
    elif app.config.autoapi_type == 'go':
        domain = GoDomain(app)
    domain.full()


def build_finished(app, exception):
    if not app.config.autoapi_keep_files:
        if app.verbosity > 1:
            print "Cleaning autoapi out"
        shutil.rmtree(app.config.autoapi_root)


def setup(app):
    app.connect('builder-inited', load_yaml)
    app.connect('build-finished', build_finished)
    app.add_config_value('autoapi_type', 'dotnet', 'html')
    app.add_config_value('autoapi_root', 'autoapi', 'html')
    app.add_config_value('autoapi_ignore', ['*migrations*'], 'html')
    app.add_config_value('autoapi_file_pattern', '*', 'html')
    app.add_config_value('autoapi_dir', '', 'html')
    app.add_config_value('autoapi_keep_files', True, 'html')
    app.add_stylesheet('autoapi.css')<commit_msg>Default autoapi to python instead of dotnet<commit_after># -*- coding: utf-8 -*-
"""
Sphinx Auto-API
"""

import fnmatch
import shutil

from .domains import DotNetDomain, PythonDomain, GoDomain


def ignore_file(app, filename):
    for pat in app.config.autoapi_ignore:
        if fnmatch.fnmatch(filename, pat):
            return True
    return False


def load_yaml(app):
    """
    Load AutoAPI data from the filesystem.
    """

    if not app.config.autoapi_dir:
        print "You must configure an autodapi_dir setting."
        return
    app.env.autoapi_data = []

    if app.config.autoapi_type == 'dotnet':
        domain = DotNetDomain(app)
    elif app.config.autoapi_type == 'python':
        domain = PythonDomain(app)
    elif app.config.autoapi_type == 'go':
        domain = GoDomain(app)
    domain.full()


def build_finished(app, exception):
    if not app.config.autoapi_keep_files:
        if app.verbosity > 1:
            print "Cleaning autoapi out"
        shutil.rmtree(app.config.autoapi_root)


def setup(app):
    app.connect('builder-inited', load_yaml)
    app.connect('build-finished', build_finished)
    app.add_config_value('autoapi_type', 'python', 'html')
    app.add_config_value('autoapi_root', 'autoapi', 'html')
    app.add_config_value('autoapi_ignore', ['*migrations*'], 'html')
    app.add_config_value('autoapi_file_pattern', '*', 'html')
    app.add_config_value('autoapi_dir', '', 'html')
    app.add_config_value('autoapi_keep_files', True, 'html')
    app.add_stylesheet('autoapi.css')
{'fraction_non_alphanumeric': 0.12926509186351706, 'fraction_numerical': 0.0013123359580052493, 'mean_word_length': 3.3997113997114, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2183473', 'n_tokens_mistral': 1008, 'n_tokens_neox': 985, 'n_words': 209}