<commit_before>"""uwsgi-for-Django module.

Website: https://uwsgi-docs.readthedocs.io/en/latest/
"""
import os
import shlex

def uwsgi(self, *args):
    if len(args) == 1:
        args = shlex.split(args[0])

    self.helper.setup_virtualenv()

    binargs = ['uwsgi'] + list(args)
    os.execvp(binargs[0], binargs)


def uwsgi_run(self, project=None, variant=None, *args):
    if len(args) == 1:
        args = shlex.split(args[0])

    self.helper.setup_virtualenv()

    project, variant = self.helper.setup_project_env(project, variant)

    config = self.config.get('configuration', {})
    config = config.get(variant, {})
    config = config.get(project, {})

    self.helper.setup_shell_env(config.get('shell_env', {}))

    socket_path = config.get('socket_path', '/tmp/%s-%s-%s.sock' %\
            (self.config['package_name'], project, variant))

    binargs = [
        'uwsgi',
        '--module=%s.wsgi:application' % project,
        '--socket=' + os.path.realpath(socket_path),
        '--chmod-socket',
        '--max-requests=%i' % config.get('max_requests', 5000),
        '--workers=%i' % config.get('worker_count', 1),
        '--master',
        '--die-on-term',
    ]
    if variant in ('dev', 'devel', 'development'):
        binargs.append('--honour-stdin')

    os.chdir(os.path.join(self.config['work_dir'], project))

    binargs += list(args)
    os.execvp(binargs[0], binargs)


commands = (uwsgi, uwsgi_run)<commit_msg>bugfix: removing class wrapper pt.2<commit_after>"""uwsgi-for-Django module.

Website: https://uwsgi-docs.readthedocs.io/en/latest/
"""
import os
import shlex

def uwsgi(loader, *args):
    if len(args) == 1:
        args = shlex.split(args[0])

    loader.setup_virtualenv()

    binargs = ['uwsgi'] + list(args)
    os.execvp(binargs[0], binargs)


def uwsgi_run(loader, project=None, variant=None, *args):
    if len(args) == 1:
        args = shlex.split(args[0])

    loader.setup_virtualenv()

    project, variant = loader.setup_project_env(project, variant)

    config = loader.config.get('configuration', {})
    config = config.get(variant, {})
    config = config.get(project, {})

    loader.setup_shell_env(config.get('shell_env', {}))

    socket_path = config.get('socket_path', '/tmp/%s-%s-%s.sock' %\
            (self.config['package_name'], project, variant))

    binargs = [
        'uwsgi',
        '--module=%s.wsgi:application' % project,
        '--socket=' + os.path.realpath(socket_path),
        '--chmod-socket',
        '--max-requests=%i' % config.get('max_requests', 5000),
        '--workers=%i' % config.get('worker_count', 1),
        '--master',
        '--die-on-term',
    ]
    if variant in ('dev', 'devel', 'development'):
        binargs.append('--honour-stdin')

    os.chdir(os.path.join(self.config['work_dir'], project))

    binargs += list(args)
    os.execvp(binargs[0], binargs)


commands = (uwsgi, uwsgi_run)
{'fraction_non_alphanumeric': 0.18531228551818807, 'fraction_numerical': 0.007892930679478381, 'mean_word_length': 3.026243093922652, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5251066', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1019, 'n_words': 165}