<commit_before>import os
import django
from django.conf import settings


def setup():
    if not settings.configured:
        if not os.getenv('DJANGO_SETTINGS_MODULE'):
            os.environ['DJANGO_SETTINGS_MODULE'] = 'iepy.webui.webui.settings'
        django.setup()<commit_msg>setup now sets the settings with the name prefix<commit_after>import os
import sys
import django
from django.conf import settings


def setup(path=None, settings_prefix=None):
    if not settings.configured:
        if path is None:
            if not os.getenv('DJANGO_SETTINGS_MODULE'):
                os.environ['DJANGO_SETTINGS_MODULE'] = 'iepy.webui.webui.settings'
        else:
            if settings_prefix is None:
                settings_prefix = path.rsplit(os.sep, 1)[1]
            sys.path.append(path) # add to the first
            os.environ['DJANGO_SETTINGS_MODULE'] = "{}_settings".format(settings_prefix)

        django.setup()

{'fraction_non_alphanumeric': 0.09615384615384616, 'fraction_numerical': 0.002136752136752137, 'mean_word_length': 2.904166666666667, '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': '2527520', 'n_tokens_mistral': 286, 'n_tokens_neox': 282, 'n_words': 67}