<commit_before># API
from pyramid.scaffolds import PyramidTemplate
import os
import logging


def _underscore_to_upper_camel_case(the_str):
    return ''.join([w.capitalize() for w in the_str.split('_')])


class MyTemplate(PyramidTemplate):
    def pre(self, command, output_dir, vars):
        the_args = command.args

        logging.warning('command: %s output_dir: %s vars: %s args: %s', command, output_dir, vars, command.args)
        module_name = the_args[1] if len(the_args) >= 2 else ''
        self._setup_module(vars, module_name)

        return PyramidTemplate.pre(self, command, output_dir, vars)

    def _setup_module(self, vars, full_module_name):
        full_module_path = full_module_name.replace('.', os.path.sep)

        module_name = os.path.basename(full_module_path)
        class_name = _underscore_to_upper_camel_case(module_name)

        sub_pkg_dir = os.path.dirname(full_module_path)
        sub_pkg_name = sub_pkg_dir.replace(os.path.sep, '.')

        test_name = '' if not module_name else 'test_' + module_name
        sub_pkg_dir_list = [] if not sub_pkg_dir else sub_pkg_dir.split(os.path.sep)
        test_dir_list = ['test_' + each_pkg for each_pkg in sub_pkg_dir_list]
        test_dir = os.path.sep.join(test_dir_list)
        pkg_name = vars['package']
        if sub_pkg_name:<commit_msg>module name<commit_after># API
from pyramid.scaffolds import PyramidTemplate
import os
import logging


def _underscore_to_upper_camel_case(the_str):
    return ''.join([w.capitalize() for w in the_str.split('_')])


class MyTemplate(PyramidTemplate):
    def pre(self, command, output_dir, vars):
        the_args = command.args

        module_name = getattr(command.args, 'output_directory', '')

        logging.warning('command: %s output_dir: %s vars: %s args: %s module_name: %s', command, output_dir, vars, command.args, module_name)

        self._setup_module(vars, module_name)

        return PyramidTemplate.pre(self, command, output_dir, vars)

    def _setup_module(self, vars, full_module_name):
        full_module_path = full_module_name.replace('.', os.path.sep)

        module_name = os.path.basename(full_module_path)
        class_name = _underscore_to_upper_camel_case(module_name)

        sub_pkg_dir = os.path.dirname(full_module_path)
        sub_pkg_name = sub_pkg_dir.replace(os.path.sep, '.')

        test_name = '' if not module_name else 'test_' + module_name
        sub_pkg_dir_list = [] if not sub_pkg_dir else sub_pkg_dir.split(os.path.sep)
        test_dir_list = ['test_' + each_pkg for each_pkg in sub_pkg_dir_list]
        test_dir = os.path.sep.join(test_dir_list)
        pkg_name = vars['package']
        if sub_pkg_name:
{'fraction_non_alphanumeric': 0.10588670862643465, 'fraction_numerical': 0.0007404664938911515, 'mean_word_length': 3.6586206896551725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2810485', 'n_tokens_mistral': 939, 'n_tokens_neox': 909, 'n_words': 186}