<commit_before>"""Django module.

Django is a python CMS framework.

Website: http://www.djangoproject.com
"""
import os
import shlex

def django_admin(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', {}))

    binargs = ['django-admin'] + list(args)
    os.execvp(binargs[0], binargs)


def django_manage(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', {}))

    binargs = ['python', 'manage.py'] + list(args)
    os.chdir(os.path.join(loader.config['work_dir'], project))
    os.execvp(binargs[0], binargs)


def django_script(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', {}))

    binargs = ['python'] + list(args)
    os.chdir(os.path.join(loader.config['work_dir'], project))
    os.execvp(binargs[0], binargs)


commands = (django_admin, django_manage, django_script)<commit_msg>bugfix django-manage work_dir<commit_after>"""Django module.

Django is a python CMS framework.

Website: http://www.djangoproject.com
"""
import os
import shlex

def django_admin(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', {}))

    binargs = ['django-admin'] + list(args)
    os.execvp(binargs[0], binargs)


def django_manage(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', {}))

    work_dir = config.get('work_dir')
    if work_dir is None:
        work_dir = loader.config['work_dir']
    else:
        work_dir = os.path.join(loader.config['work_dir'], work_dir)

    binargs = ['python', 'manage.py'] + list(args)
    os.chdir(work_dir)
    os.execvp(binargs[0], binargs)


def django_script(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', {}))

    work_dir = config.get('work_dir')
    if work_dir is None:
        work_dir = loader.config['work_dir']
    else:
        work_dir = os.path.join(loader.config['work_dir'], work_dir)

    binargs = ['python'] + list(args)
    os.chdir(work_dir)
    os.execvp(binargs[0], binargs)


commands = (django_admin, django_manage, django_script)
{'fraction_non_alphanumeric': 0.1560082516761217, 'fraction_numerical': 0.0046415678184631255, 'mean_word_length': 3.8731155778894473, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4778093', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1280, 'n_words': 231}