<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys

import app_manage

gettext = lambda s: s


DJANGO_MIGRATION_MODULES = {
    'djangocms_column': 'djangocms_column.migrations_django',
    'djangocms_file': 'djangocms_file.migrations_django',
    'djangocms_flash': 'djangocms_flash.migrations_django',
    'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
    'djangocms_inherit': 'djangocms_inherit.migrations_django',
    'djangocms_link': 'djangocms_link.migrations_django',
    'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django',
    'djangocms_picture': 'djangocms_picture.migrations_django',
    'djangocms_style': 'djangocms_style.migrations_django',
    'djangocms_teaser': 'djangocms_teaser.migrations_django',
    'djangocms_video': 'djangocms_video.migrations_django',
    'meta': 'cms.test_utils.project.pluginapp.plugins.meta.migrations',
    'manytomany_rel': 'cms.test_utils.project.pluginapp.plugins.manytomany_rel.migrations',
    'fileapp': 'cms.test_utils.project.fileapp.migrations',
    'placeholderapp': 'cms.test_utils.project.placeholderapp.migrations',
    'sampleapp': 'cms.test_utils.project.sampleapp.migrations',
    'emailuserapp': 'cms.test_utils.project.emailuserapp.migrations',
    'fakemlng': 'cms.test_utils.project.fakemlng.migrations',
    'extra_context': 'cms.test_utils.project.pluginapp.plugins.extra_context.migrations',
    'one_thing': 'cms.test_utils.project.pluginapp.plugins.one_thing.migrations',
    'bunch_of_plugins': 'cms.test_utils.project.bunch_of_plugins.migrations',
    'extensionapp': 'cms.test_utils.project.extensionapp.migrations',
    'objectpermissionsapp': 'cms.test_utils.project.objectpermissionsapp.migrations',
    'mti_pluginapp': 'cms.test_utils.project.mti_pluginapp.migrations',
}


class DisableMigrations(object):
    def __contains__(self, _):
        return True

    def __getitem__(self, _):
        return "notmigrations"


class DjangoMigrationsFlag(app_manage.Config):
    def get_value(self, argv, environ):
        value = super(DjangoMigrationsFlag, self).get_value(argv, environ)
        if value:
            return DJANGO_MIGRATION_MODULES
        else:
            return DisableMigrations()


def install_auth_user_model(settings, value):
    if value is None:
        return
    custom_user_app = 'cms.test_utils.project.' + value.split('.')[0]
    settings['INSTALLED_APPS'].insert(
        settings['INSTALLED_APPS'].index('cms'),
        custom_user_app
    )
    settings['AUTH_USER_MODEL'] = value<commit_msg>migration handling is already being done<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys

import app_manage

gettext = lambda s: s


def install_auth_user_model(settings, value):
    if value is None:
        return
    custom_user_app = 'cms.test_utils.project.' + value.split('.')[0]
    settings['INSTALLED_APPS'].insert(
        settings['INSTALLED_APPS'].index('cms'),
        custom_user_app
    )
    settings['AUTH_USER_MODEL'] = value
{'fraction_non_alphanumeric': 0.12274368231046931, 'fraction_numerical': 0.0013127666557269445, 'mean_word_length': 4.644444444444445, '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': '3155425', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1060, 'n_words': 140}